[ros-diffs] [ros-arm-bringup] 34656: - Not only did r34637 break the ARM build, it also doesn't make sense on x86 (or other) builds, because it assumes invalid data layout. For example, on x64 builds, the code would read random data. - In the future, please refer to other code which loops the current processors and gets their KPRCB before attempting a half-assed implementation. KiProcessorBlock should be used.

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Tue Jul 22 07:37:02 CEST 2008


Author: ros-arm-bringup
Date: Tue Jul 22 00:37:01 2008
New Revision: 34656

URL: http://svn.reactos.org/svn/reactos?rev=34656&view=rev
Log:
- Not only did r34637 break the ARM build, it also doesn't make sense on x86 (or other) builds, because it assumes invalid data layout. For example, on x64 builds, the code would read random data.
- In the future, please refer to other code which loops the current processors and gets their KPRCB before attempting a half-assed implementation. KiProcessorBlock should be used.


Modified:
    trunk/reactos/ntoskrnl/ex/sysinfo.c

Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=34656&r1=34655&r2=34656&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Tue Jul 22 00:37:01 2008
@@ -1180,7 +1180,7 @@
 QSI_DEF(SystemInterruptInformation)
 {
   PKPRCB Prcb;
-  PKIPCR Pcr;
+  PKPCR Pcr;
   LONG i;
   ULONG ti;
   PSYSTEM_INTERRUPT_INFORMATION sii = (PSYSTEM_INTERRUPT_INFORMATION)Buffer;
@@ -1192,10 +1192,10 @@
 
   ti = KeQueryTimeIncrement();
 
-  Prcb = KeGetPcr()->Prcb;
   for (i = 0; i < KeNumberProcessors; i++)
   {
-    Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
+    Prcb = KiProcessorBlock[i];
+    Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb);
     sii->ContextSwitches = Pcr->ContextSwitches;
     sii->DpcCount = Prcb->DpcData[0].DpcCount;
     sii->DpcRate = Prcb->DpcRequestRate;
@@ -1203,7 +1203,6 @@
     sii->DpcBypassCount = 0;
     sii->ApcBypassCount = 0;
     sii++;
-    Prcb = (PKPRCB)((ULONG_PTR)Prcb + PAGE_SIZE);
   }
 
   return STATUS_SUCCESS;



More information about the Ros-diffs mailing list