[ros-diffs] [ros-arm-bringup] 32654: - Forgot to commit previous HAL changes. - There is no reason to implement the Interlocked* APIs in assembly in the kernel -- just have them call the intrinsics. - Also fix the way we were overloading the exported APIs, we now use the intrinsics all the time. - Convert loader block address to virtual, and parse the addresses inside it and convert them to virtual too, after we don't use them in FreeLDR anymore -- the kernel will delete the p->v identity mapping, and eventually still need to touch the loader block. - Implement MmGetPhysicalAddress and MiGetUserPageDirectoryCount for ARM. - We now reach the point where we start initializing the boot drivers' memory information.

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Tue Mar 11 05:42:55 CET 2008


Author: ros-arm-bringup
Date: Mon Mar 10 23:42:54 2008
New Revision: 32654

URL: http://svn.reactos.org/svn/reactos?rev=3D32654&view=3Drev
Log:
- Forgot to commit previous HAL changes.
- There is no reason to implement the Interlocked* APIs in assembly in the =
kernel -- just have them call the intrinsics.
- Also fix the way we were overloading the exported APIs, we now use the in=
trinsics all the time.
- Convert loader block address to virtual, and parse the addresses inside i=
t and convert them to virtual too, after we don't use them in FreeLDR anymo=
re -- the kernel will delete the p->v identity mapping, and eventually stil=
l need to touch the loader block.
- Implement MmGetPhysicalAddress and MiGetUserPageDirectoryCount for ARM.
- We now reach the point where we start initializing the boot drivers' memo=
ry information.

Added:
    trunk/reactos/ntoskrnl/ex/exintrin.c   (with props)
Modified:
    trunk/reactos/hal/halarm/generic/hal.c
    trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S
    trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
    trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s
    trunk/reactos/ntoskrnl/mm/arm/stubs.c
    trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
    trunk/reactos/ntoskrnl/rtl/arm/rtlexcpt.c

Modified: trunk/reactos/hal/halarm/generic/hal.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/generic/ha=
l.c?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/hal/halarm/generic/hal.c (original)
+++ trunk/reactos/hal/halarm/generic/hal.c Mon Mar 10 23:42:54 2008
@@ -26,6 +26,11 @@
 #undef ExAcquireFastMutex
 #undef ExReleaseFastMutex
 #undef ExTryToAcquireFastMutex
+#undef KeAcquireSpinLock
+#undef KeGetCurrentIrql
+#undef KeLowerIrql
+#undef KeRaiseIrql
+#undef KeReleaseSpinLock
 =

 /* DATA ******************************************************************=
****/
 =

@@ -730,90 +735,12 @@
   return Address;
 }
 =

-
-#undef KeAcquireSpinLock
-VOID
-NTAPI
-KeAcquireSpinLock(
-  PKSPIN_LOCK SpinLock,
-  PKIRQL OldIrql)
-{
-  UNIMPLEMENTED;
-}
-
-
-KIRQL
-FASTCALL
-KeAcquireSpinLockRaiseToSynch(
-  PKSPIN_LOCK SpinLock)
-{
-  UNIMPLEMENTED;
-
-  return 0;
-}
-
-
-/*
- * @implemented
- */
-VOID
-FASTCALL
-KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,
-                               IN PKLOCK_QUEUE_HANDLE LockHandle)
-{
-    /* Simply raise to dispatch */
-    LockHandle->OldIrql =3D KeSwapIrql(DISPATCH_LEVEL);
-}
-
-/*
- * @implemented
- */
-VOID
-FASTCALL
-KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock,
-                                           IN PKLOCK_QUEUE_HANDLE LockHand=
le)
-{
-    /* Simply raise to synch */
-    LockHandle->OldIrql =3D KeSwapIrql(SYNCH_LEVEL);
-}
-
-/*
- * @implemented
- */
-VOID
-FASTCALL
-KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
-{
-    /* Simply lower IRQL back */
-    KeSwapIrql(LockHandle->OldIrql);
-}
-
 VOID
 NTAPI
 KeFlushWriteBuffer(VOID)
 {
   UNIMPLEMENTED;
 }
-
-#undef KeGetCurrentIrql
-KIRQL
-NTAPI
-KeGetCurrentIrql(VOID)
-{
-  UNIMPLEMENTED;
-
-  return (KIRQL)0;
-}
-
-#undef KeLowerIrql
-VOID
-NTAPI
-KeLowerIrql(
-  KIRQL NewIrql)
-{
-  UNIMPLEMENTED;
-}
-
 =

 LARGE_INTEGER
 NTAPI
@@ -829,47 +756,6 @@
   return Value;
 }
 =

-#undef KeRaiseIrql
-VOID
-NTAPI
-KeRaiseIrql(
-  KIRQL NewIrql,
-  PKIRQL OldIrql)
-{
-  UNIMPLEMENTED;
-}
-
-
-KIRQL
-NTAPI
-KeRaiseIrqlToDpcLevel(VOID)
-{
-  UNIMPLEMENTED;
-
-  return (KIRQL)0;
-}
-
-
-KIRQL
-NTAPI
-KeRaiseIrqlToSynchLevel(VOID)
-{
-  UNIMPLEMENTED;
-
-  return (KIRQL)0;
-}
-
-#undef KeReleaseSpinLock
-VOID
-NTAPI
-KeReleaseSpinLock(
-  PKSPIN_LOCK SpinLock,
-  KIRQL NewIrql)
-{
-  UNIMPLEMENTED;
-}
-
-
 VOID
 NTAPI
 KeStallExecutionProcessor(
@@ -878,42 +764,6 @@
   UNIMPLEMENTED;
 }
 =

-
-LOGICAL
-FASTCALL
-KeTryToAcquireQueuedSpinLock(
-  KSPIN_LOCK_QUEUE_NUMBER LockNumber,
-  PKIRQL OldIrql)
-{
-  UNIMPLEMENTED;
-
-  return FALSE;
-}
-
-
-BOOLEAN
-FASTCALL
-KeTryToAcquireQueuedSpinLockRaiseToSynch(
-  KSPIN_LOCK_QUEUE_NUMBER LockNumber,
-  PKIRQL OldIrql)
-{
-  UNIMPLEMENTED;
-
-  return FALSE;
-}
-
-
-KIRQL
-FASTCALL
-KfAcquireSpinLock(
-  PKSPIN_LOCK SpinLock)
-{
-  UNIMPLEMENTED;
-
-  return (KIRQL)0;
-}
-
-
 VOID
 FASTCALL
 KfLowerIrql(
@@ -932,17 +782,6 @@
 =

   return (KIRQL)0;
 }
-
-
-VOID
-FASTCALL
-KfReleaseSpinLock(
-  PKSPIN_LOCK SpinLock,
-  KIRQL NewIrql)
-{
-  UNIMPLEMENTED;
-}
-
 =

 VOID
 NTAPI
@@ -1071,31 +910,21 @@
 }
 =

 KIRQL
-FASTCALL
-KeAcquireQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
-{
-  UNIMPLEMENTED;
-  return (KIRQL)0;
+KeSwapIrql(IN KIRQL Irql)
+{
+    UNIMPLEMENTED;
+    return 0;
 }
 =

 KIRQL
-FASTCALL
-KeAcquireQueuedSpinLockRaiseToSynch(IN PKLOCK_QUEUE_HANDLE LockHandle)
+KeRaiseIrqlToDpcLevel(VOID)
 {
     UNIMPLEMENTED;
-    return (KIRQL)0;
-}
-
-VOID
-FASTCALL
-KeReleaseQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle,
-                        IN KIRQL OldIrql)
-{
-  UNIMPLEMENTED;
+    return 0;
 }
 =

 KIRQL
-KeSwapIrql(IN KIRQL Irql)
+KeRaiseIrqlToSynchLevel(VOID)
 {
     UNIMPLEMENTED;
     return 0;
@@ -1163,4 +992,195 @@
     KeArmFlushIcache();
 }
 =

+/*
+ * @implemented
+ */
+KIRQL
+NTAPI
+KeGetCurrentIrql(VOID)
+{
+    /* Return IRQL */
+    return PCR->CurrentIrql;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+KeLowerIrql(KIRQL NewIrql)
+{
+    /* Call the fastcall function */
+    KfLowerIrql(NewIrql);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+KeRaiseIrql(KIRQL NewIrql,
+            PKIRQL OldIrql)
+{
+    /* Call the fastcall function */
+    *OldIrql =3D KfRaiseIrql(NewIrql);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+KeAcquireSpinLock(PKSPIN_LOCK SpinLock,
+                  PKIRQL OldIrql)
+{
+    /* Call the fastcall function */
+    *OldIrql =3D KfAcquireSpinLock(SpinLock);
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+FASTCALL
+KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock)
+{
+    /* Simply raise to dispatch */
+    return KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+KeReleaseSpinLock(PKSPIN_LOCK SpinLock,
+                  KIRQL NewIrql)
+{
+    /* Call the fastcall function */
+    KfReleaseSpinLock(SpinLock, NewIrql);
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+FASTCALL
+KfAcquireSpinLock(PKSPIN_LOCK SpinLock)
+{
+    /* Simply raise to dispatch */
+    return KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KfReleaseSpinLock(PKSPIN_LOCK SpinLock,
+                  KIRQL OldIrql)
+{
+    /* Simply lower IRQL back */
+    KfLowerIrql(OldIrql);
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+FASTCALL
+KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
+{
+    /* Simply raise to dispatch */
+    return KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+KIRQL
+FASTCALL
+KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
+{
+    /* Simply raise to dispatch */
+    return KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,
+                               IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+    /* Simply raise to dispatch */
+    LockHandle->OldIrql =3D KfRaiseIrql(DISPATCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock,
+                                           IN PKLOCK_QUEUE_HANDLE LockHand=
le)
+{
+    /* Simply raise to synch */
+    LockHandle->OldIrql =3D KfRaiseIrql(SYNCH_LEVEL);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
+                        IN KIRQL OldIrql)
+{
+    /* Simply lower IRQL back */
+    KfLowerIrql(OldIrql);
+}
+
+/*
+ * @implemented
+ */
+VOID
+FASTCALL
+KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+    /* Simply lower IRQL back */
+    KfLowerIrql(LockHandle->OldIrql);
+}
+
+/*
+ * @implemented
+ */
+BOOLEAN
+FASTCALL
+KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNu=
mber,
+                                         IN PKIRQL OldIrql)
+{
+    /* Simply raise to dispatch */
+    *OldIrql =3D KfRaiseIrql(DISPATCH_LEVEL);
+    =

+    /* Always return true on UP Machines */
+    return TRUE;
+}
+
+/*
+ * @implemented
+ */
+LOGICAL
+FASTCALL
+KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
+                             OUT PKIRQL OldIrql)
+{
+    /* Simply raise to dispatch */
+    *OldIrql =3D KfRaiseIrql(DISPATCH_LEVEL);
+    =

+    /* Always return true on UP Machines */
+    return TRUE;
+}
+
 /* EOF */

Added: trunk/reactos/ntoskrnl/ex/exintrin.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/exintrin.=
c?rev=3D32654&view=3Dauto
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/ex/exintrin.c (added)
+++ trunk/reactos/ntoskrnl/ex/exintrin.c Mon Mar 10 23:42:54 2008
@@ -1,0 +1,75 @@
+/*
+ * PROJECT:         ReactOS Kernel
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            ntoskrnl/ex/exinrin.c
+ * PURPOSE:         Exported kernel functions which are now intrinsics
+ * PROGRAMMERS:     ReactOS Portable Systems Group
+ */
+
+/* INCLUDES **************************************************************=
*****/
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <debug.h>
+
+#undef InterlockedIncrement
+#undef InterlockedDecrement
+#undef InterlockedCompareExchange
+#undef InterlockedExchangeAdd
+#undef InterlockedExchange
+
+/* FUNCTIONS *************************************************************=
*****/
+
+LONG
+FASTCALL
+InterlockedIncrement(IN LONG volatile *Addend)
+{
+    //
+    // Call the intrinsic
+    //
+    return _InterlockedIncrement(Addend);    =

+}
+
+LONG
+FASTCALL
+InterlockedDecrement(IN LONG volatile *Addend)
+{
+    //
+    // Call the intrinsic
+    //
+    return _InterlockedDecrement(Addend);
+}
+
+LONG
+FASTCALL
+InterlockedCompareExchange(IN OUT LONG volatile *Destination,
+                           IN LONG Exchange,
+                           IN LONG Comperand)
+{
+    //
+    // Call the intrinsic
+    //
+    return _InterlockedCompareExchange(Destination, Exchange, Comperand);
+}
+
+LONG
+FASTCALL
+InterlockedExchange(IN OUT LONG volatile *Destination,
+                    IN LONG Value)
+{
+    //
+    // Call the intrinsic
+    //
+    return _InterlockedExchange(Destination, Value);
+}
+
+LONG
+FASTCALL
+InterlockedExchangeAdd(IN OUT LONG volatile *Addend,
+                       IN LONG Increment)
+{
+    //
+    // Call the intrinsic
+    //
+    return _InterlockedExchangeAdd(Addend, Increment);
+}

Propchange: trunk/reactos/ntoskrnl/ex/exintrin.c
---------------------------------------------------------------------------=
---
    svn:eol-style =3D native

Propchange: trunk/reactos/ntoskrnl/ex/exintrin.c
---------------------------------------------------------------------------=
---
    svn:mime-type =3D text/plain

Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/i386/fast=
interlck_asm.S?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S (original)
+++ trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S Mon Mar 10 23:42:54 2=
008
@@ -558,54 +558,6 @@
     /* Return */
     ret
 =

-/*ULONG
- *FASTCALL
- *InterlockedIncrement(IN PLONG Addend)
- */
-.global @InterlockedIncrement at 4
- at InterlockedIncrement@4:
-
-    /* Do the op */
-    mov eax, 1
-    LOCK xadd dword ptr [ecx], eax
-
-    /* Return */
-    inc eax
-    ret
-
-/*ULONG
- *FASTCALL
- *InterlockedDecrement(IN PLONG Addend)
- */
-.global @InterlockedDecrement at 4
- at InterlockedDecrement@4:
-
-    /* Do the op */
-    mov eax, -1
-    LOCK xadd dword ptr [ecx], eax
-
-    /* Return */
-    dec eax
-    ret
-
-/*PVOID
- *FASTCALL
- *InterlockedCompareExchange(IN OUT PVOID *Destination,
- *                           IN PVOID Exchange,
- *                           IN PVOID Comperand)
- */
-.global @InterlockedCompareExchange at 12
- at InterlockedCompareExchange@12:
-
-    /* Get comperand */
-    mov eax, [esp+4]
-
-    /* Do the op */
-    LOCK cmpxchg dword ptr [ecx], edx
-
-    /* Return */
-    ret 4
-
 /*PVOID
  *FASTCALL
  *ExfInterlockedCompareExchange64(IN PLONGLONG Destination,
@@ -669,21 +621,6 @@
     /* Return */
     ret 8
 =

-/*PVOID
- *FASTCALL
- *InterlockedExchangeAdd(IN OUT PLONG Addend,
- *                       IN LONG Increment)
- */
-.global @InterlockedExchangeAdd at 8
- at InterlockedExchangeAdd@8:
-
-    /* Do the op */
-    LOCK xadd dword ptr [ecx], edx
-
-    /* Return */
-    mov eax, edx
-    ret
-
 /*** Non-586 functions ***/
 =

 /*PSINGLE_LIST_ENTRY

Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/inte=
rnal/ntoskrnl.h?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Mon Mar 10 23:42:54 =
2008
@@ -21,6 +21,16 @@
 #define KeGetPreviousMode   _KeGetPreviousMode
 #undef  PsGetCurrentProcess
 #define PsGetCurrentProcess _PsGetCurrentProcess
+
+//
+// We are very lazy on ARM -- we just import intrinsics
+// Question: Why wasn't this done for x86 too? (see fastintrlck.asm)
+//
+#define InterlockedDecrement        _InterlockedDecrement
+#define InterlockedIncrement        _InterlockedIncrement
+#define InterlockedCompareExchange  _InterlockedCompareExchange
+#define InterlockedExchange         _InterlockedExchange
+#define InterlockedExchangeAdd      _InterlockedExchangeAdd
 =

 #include "ke.h"
 #include "i386/mm.h"
@@ -54,15 +64,6 @@
 #include "vdm.h"
 #include "hal.h"
 #include "arch/intrin_i.h"
-
-//
-// We are very lazy on ARM -- we just import intrinsics
-// Question: Why wasn't this done for x86 too? (see fastintrlck.asm)
-//
-#define InterlockedDecrement        _InterlockedDecrement
-#define InterlockedIncrement        _InterlockedIncrement
-#define InterlockedCompareExchange  _InterlockedCompareExchange
-#define InterlockedExchangeAdd      _InterlockedExchangeAdd
 =

 #include <pshpack1.h>
 /*

Modified: trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/stubs=
_asm.s?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s (original)
+++ trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s Mon Mar 10 23:42:54 2008
@@ -31,11 +31,6 @@
 GENERATE_ARM_STUB Exi386InterlockedDecrementLong =

 GENERATE_ARM_STUB Exi386InterlockedExchangeUlong =

 GENERATE_ARM_STUB Exi386InterlockedIncrementLong =

-GENERATE_ARM_STUB InterlockedCompareExchange =

-GENERATE_ARM_STUB InterlockedDecrement =

-GENERATE_ARM_STUB InterlockedExchange =

-GENERATE_ARM_STUB InterlockedExchangeAdd =

-GENERATE_ARM_STUB InterlockedIncrement =

 GENERATE_ARM_STUB InterlockedPopEntrySList =

 GENERATE_ARM_STUB InterlockedPushEntrySList =

 =


Modified: trunk/reactos/ntoskrnl/mm/arm/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/stubs=
.c?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/mm/arm/stubs.c (original)
+++ trunk/reactos/ntoskrnl/mm/arm/stubs.c Mon Mar 10 23:42:54 2008
@@ -11,6 +11,7 @@
 #include <ntoskrnl.h>
 #define NDEBUG
 #include <debug.h>
+
 /* GLOBALS ***************************************************************=
*****/
 =

 #undef UNIMPLEMENTED
@@ -551,15 +552,50 @@
  */
 PHYSICAL_ADDRESS
 NTAPI
-MmGetPhysicalAddress(IN PVOID vaddr)
-{
-    PHYSICAL_ADDRESS p;
-
-    //
-    // TODO
-    //
-    UNIMPLEMENTED;
-    return p;
+MmGetPhysicalAddress(IN PVOID Address)
+{
+    PHYSICAL_ADDRESS PhysicalAddress =3D {{0}};
+    PMMPTE PointerPte;
+    DPRINT1("MmGetPhysicalAddress(%lx)\n", Address);
+
+    //
+    // Early boot PCR check
+    //
+    if (Address =3D=3D PCR)
+    {
+        //
+        // ARM Hack while we still use a section PTE
+        //
+        PointerPte =3D MiGetPdeAddress(PCR);
+        ASSERT(PointerPte->u.Hard.L1.Section.Type =3D=3D SectionPte);
+        PhysicalAddress.QuadPart =3D PointerPte->u.Hard.L1.Section.BaseAdd=
ress;
+        PhysicalAddress.QuadPart <<=3D CPT_SHIFT;
+        DPRINT1("Base: %p\n", PhysicalAddress.LowPart);
+        PhysicalAddress.LowPart +=3D BYTE_OFFSET(Address);
+        return PhysicalAddress;
+    }
+    =

+    //
+    // Get the PTE
+    //
+    PointerPte =3D MiGetPteAddress(Address);
+    if (PointerPte->u.Hard.L1.Fault.Type =3D=3D FaultPte)
+    {
+        //
+        // Invalid address
+        //
+        DPRINT1("Address invalid: %p\n", Address);
+        return PhysicalAddress;
+    }
+
+    //
+    // Return the information
+    //
+    ASSERT(PointerPte->u.Hard.L2.Small.Type !=3D SmallPte);
+    PhysicalAddress.QuadPart =3D PointerPte->u.Hard.L2.Small.BaseAddress;
+    PhysicalAddress.QuadPart <<=3D PAGE_SHIFT;
+    PhysicalAddress.LowPart +=3D BYTE_OFFSET(Address);
+    return PhysicalAddress;
 }
 =

 PVOID
@@ -691,10 +727,9 @@
 MiGetUserPageDirectoryCount(VOID)
 {
     //
-    // TODO
-    //
-    UNIMPLEMENTED;
-    return 0;
+    // Return the index
+    //
+    return MiGetPdeOffset(MmSystemRangeStart);
 }
 =

 VOID

Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-gen=
eric.rbuild?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild Mon Mar 10 23:42:54 2008
@@ -181,6 +181,7 @@
 		<file>efi.c</file>
 		<file>event.c</file>
 		<file>evtpair.c</file>
+		<file>exintrin.c</file>
 		<file>fmutex.c</file>
 		<file>handle.c</file>
 		<file>harderr.c</file>

Modified: trunk/reactos/ntoskrnl/rtl/arm/rtlexcpt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/arm/rtle=
xcpt.c?rev=3D32654&r1=3D32653&r2=3D32654&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/ntoskrnl/rtl/arm/rtlexcpt.c (original)
+++ trunk/reactos/ntoskrnl/rtl/arm/rtlexcpt.c Mon Mar 10 23:42:54 2008
@@ -1,17 +1,16 @@
 /*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS kernel
- * FILE:            ntoskrnl/rtl/libsupp.c
- * PURPOSE:         RTL Support Routines
- * PROGRAMMERS:     Alex Ionescu (alex at relsoft.net)
- *                  Gunnar Dalsnes
+ * PROJECT:         ReactOS Kernel
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            ntoskrnl/rtl/arm/rtlexcpt.c
+ * PURPOSE:         ARM Exception Helper Routines for Stack Walking
+ * PROGRAMMERS:     ReactOS Portable Systems Group
  */
 =

-/* INCLUDES **************************************************************=
****/
+/* INCLUDES **************************************************************=
*****/
 =

 #include <ntoskrnl.h>
 #define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
 =

 /* FUNCTIONS *************************************************************=
****/
 =





More information about the Ros-diffs mailing list