Author: ros-arm-bringup
Date: Wed Mar 12 13:17:55 2008
New Revision: 32666
URL:
http://svn.reactos.org/svn/reactos?rev=3D32666&view=3Drev
Log:
- We now define a much simpler system call interface -- instead of using in=
terrupt 2E with the system call ID in the ip register, we use the system ca=
ll ID as the interrupt number! On ARM, all software interrupts have a gener=
ic handler, so ANY software interrupt will be a system call, and the interr=
upt number is the system call ID!
- Removed a bunch more i386-only exports from the ARM kernel.
- Implemented all the READ/WRITE_REGISTER* routines for ARM/PPC.
- Implement half of KiSoftwareInterruptException, which calls KiSoftwareInt=
erruptHandler, which calls KiSystemService. We now reach the first kernel-m=
ode system call! (ZwClose from PspInitPhase0).
- Reformat fastinterlck.c and change the way it's included per-architecture.
Modified:
trunk/reactos/ntoskrnl/ex/exintrin.c
trunk/reactos/ntoskrnl/ex/fastinterlck.c
trunk/reactos/ntoskrnl/ex/init.c
trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h
trunk/reactos/ntoskrnl/ke/arm/stubs_asm.s
trunk/reactos/ntoskrnl/ke/arm/trap.s
trunk/reactos/ntoskrnl/ke/arm/trapc.c
trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
trunk/reactos/ntoskrnl/ntoskrnl_arm.def
trunk/reactos/tools/nci/ncitool.c
Modified: trunk/reactos/ntoskrnl/ex/exintrin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/exintrin.=
c?rev=3D32666&r1=3D32665&r2=3D32666&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/exintrin.c (original)
+++ trunk/reactos/ntoskrnl/ex/exintrin.c Wed Mar 12 13:17:55 2008
@@ -17,6 +17,11 @@
#undef InterlockedCompareExchange
#undef InterlockedExchangeAdd
#undef InterlockedExchange
+
+//
+// HAL Port to Inlined Port
+//
+#define H2I(Port) PtrToUshort(Port)
=
/* FUNCTIONS *************************************************************=
*****/
=
Modified: trunk/reactos/ntoskrnl/ex/fastinterlck.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/fastinter=
lck.c?rev=3D32666&r1=3D32665&r2=3D32666&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/fastinterlck.c (original)
+++ trunk/reactos/ntoskrnl/ex/fastinterlck.c Wed Mar 12 13:17:55 2008
@@ -1,37 +1,49 @@
/*
* PROJECT: ReactOS Kernel
- * COPYRIGHT: GPL - See COPYING in the top level directory
- * FILE: ntoskrnl/ex/powerpc/fastinterlck.c
- * PURPOSE: Executive Atom Functions
- * PROGRAMMERS: Art Yerkes
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/ex/fastinterlck.c
+ * PURPOSE: Portable Ex*Interlocked and REGISTER routines for non-=
x86
+ * PROGRAMMERS: ReactOS Portable Systems Group
*/
=
-/* INCLUDES **************************************************************=
***/
+/* INCLUDES **************************************************************=
*****/
+
+#if defined(_ARM_) || defined(_PPC_) || defined(NTOS_USE_GENERICS)
=
#include <ntoskrnl.h>
-#include <internal/debug.h>
-
-NTKERNELAPI
+#define NDEBUG
+#include <debug.h>
+
+#undef ExInterlockedPushEntrySList
+#undef ExInterlockedPopEntrySList
+#undef ExInterlockedAddULong
+#undef ExInterlockedIncrementLong
+#undef ExInterlockedDecrementLong
+
+/* FUNCTIONS *************************************************************=
*****/
+
PSLIST_ENTRY
NTAPI
InterlockedPushEntrySList(IN PSLIST_HEADER ListHead,
IN PSLIST_ENTRY ListEntry)
{
=
- PSINGLE_LIST_ENTRY FirstEntry, NextEntry, Entry =3D (PVOID)ListEntry, =
Head =3D (PVOID)ListHead;
+ PSINGLE_LIST_ENTRY FirstEntry, NextEntry;
+ PSINGLE_LIST_ENTRY Entry =3D (PVOID)ListEntry, Head =3D (PVOID)ListHea=
d;
=
FirstEntry =3D Head->Next;
do
{
Entry->Next =3D FirstEntry;
NextEntry =3D FirstEntry;
- FirstEntry =3D (PVOID)_InterlockedCompareExchange((PLONG)Head, (LO=
NG)Entry, (LONG)FirstEntry);
+ FirstEntry =3D (PVOID)_InterlockedCompareExchange((PLONG)Head,
+ (LONG)Entry,
+ (LONG)FirstEntry);
} while (FirstEntry !=3D NextEntry);
=
return FirstEntry;
}
=
-NTKERNELAPI
PSLIST_ENTRY
NTAPI
InterlockedPopEntrySList(IN PSLIST_HEADER ListHead)
@@ -44,13 +56,14 @@
if (!FirstEntry) return NULL;
=
NextEntry =3D FirstEntry;
- FirstEntry =3D (PVOID)_InterlockedCompareExchange((PLONG)Head, (LO=
NG)FirstEntry->Next, (LONG)FirstEntry);
+ FirstEntry =3D (PVOID)_InterlockedCompareExchange((PLONG)Head,
+ (LONG)FirstEntry->=
Next,
+ (LONG)FirstEntry);
} while (FirstEntry !=3D NextEntry);
=
return FirstEntry; =
}
=
-NTKERNELAPI
PSINGLE_LIST_ENTRY
FASTCALL
ExInterlockedFlushSList(IN PSLIST_HEADER ListHead)
@@ -58,36 +71,27 @@
return (PVOID)_InterlockedExchange((PLONG)&ListHead->Next.Next, (LONG)=
NULL);
}
=
-#undef ExInterlockedPushEntrySList
-NTKERNELAPI
PSLIST_ENTRY
FASTCALL
-ExInterlockedPushEntrySList
-(IN PSLIST_HEADER ListHead,
- IN PSLIST_ENTRY ListEntry)
+ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead,
+ IN PSLIST_ENTRY ListEntry)
{
return InterlockedPushEntrySList(ListHead, ListEntry);
}
=
-#undef ExInterlockedPopEntrySList
-NTKERNELAPI
-PSINGLE_LIST_ENTRY
-NTAPI
-ExInterlockedPopEntrySList(
- IN PSLIST_HEADER ListHead,
- IN PKSPIN_LOCK Lock)
+PSINGLE_LIST_ENTRY
+NTAPI
+ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead,
+ IN PKSPIN_LOCK Lock)
{
return InterlockedPopEntrySList(ListHead);
}
=
-#undef ExInterlockedAddULong
-NTKERNELAPI
ULONG
NTAPI
-ExfInterlockedAddUlong(
- IN PULONG Addend,
- IN ULONG Increment,
- PKSPIN_LOCK Lock)
+ExfInterlockedAddUlong(IN PULONG Addend,
+ IN ULONG Increment,
+ PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
KeAcquireSpinLock(Lock, &OldIrql);
@@ -96,13 +100,11 @@
return *Addend;
}
=
-NTKERNELAPI
LONGLONG
FASTCALL
-ExfInterlockedCompareExchange64(
- IN OUT LONGLONG volatile *Destination,
- IN PLONGLONG Exchange,
- IN PLONGLONG Comperand)
+ExfInterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination,
+ IN PLONGLONG Exchange,
+ IN PLONGLONG Comperand)
{
LONGLONG Result;
=
@@ -111,13 +113,11 @@
return Result;
}
=
-NTKERNELAPI
-PLIST_ENTRY
-FASTCALL
-ExfInterlockedInsertHeadList(
- IN PLIST_ENTRY ListHead,
- IN PLIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+FASTCALL
+ExfInterlockedInsertHeadList(IN PLIST_ENTRY ListHead,
+ IN PLIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PLIST_ENTRY OldHead =3D NULL;
@@ -128,13 +128,11 @@
return OldHead;
}
=
-NTKERNELAPI
-PLIST_ENTRY
-FASTCALL
-ExfInterlockedInsertTailList(
- IN PLIST_ENTRY ListHead,
- IN PLIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+FASTCALL
+ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead,
+ IN PLIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PLIST_ENTRY OldHead =3D NULL;
@@ -145,129 +143,83 @@
return OldHead;
}
=
-NTKERNELAPI
-PSINGLE_LIST_ENTRY
-FASTCALL
-ExfInterlockedPopEntryList(
- IN PSINGLE_LIST_ENTRY ListHead,
- IN PKSPIN_LOCK Lock)
-{
+PSINGLE_LIST_ENTRY
+FASTCALL
+ExfInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
+ IN PKSPIN_LOCK Lock)
+{
+ UNIMPLEMENTED;
return NULL;
}
=
-NTKERNELAPI
-PSINGLE_LIST_ENTRY
-FASTCALL
-ExfInterlockedPushEntryList(
- IN PSINGLE_LIST_ENTRY ListHead,
- IN PSINGLE_LIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
-{
+PSINGLE_LIST_ENTRY
+FASTCALL
+ExfInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead,
+ IN PSINGLE_LIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
+{
+ UNIMPLEMENTED;
return NULL;
}
=
-NTKERNELAPI
-PLIST_ENTRY
-FASTCALL
-ExfInterlockedRemoveHeadList(
- IN PLIST_ENTRY ListHead,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+FASTCALL
+ExfInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead,
+ IN PKSPIN_LOCK Lock)
{
return ExInterlockedRemoveHeadList(ListHead, Lock);
}
=
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedIncrementLong(
- IN PLONG Addend)
-{
- return InterlockedIncrement(Addend);
-}
-
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedDecrementLong(
- IN PLONG Addend)
-{
- return InterlockedDecrement(Addend);
-}
-
-NTKERNELAPI
-ULONG
-FASTCALL
-Exfi386InterlockedExchangeUlong(
- IN PULONG Target,
- IN ULONG Value)
-{
- return (ULONG)_InterlockedExchange((PLONG)Target, Value);
-}
-
-NTKERNELAPI
LARGE_INTEGER
NTAPI
-ExInterlockedAddLargeInteger(
- IN PLARGE_INTEGER Addend,
- IN LARGE_INTEGER Increment,
- IN PKSPIN_LOCK Lock)
+ExInterlockedAddLargeInteger(IN PLARGE_INTEGER Addend,
+ IN LARGE_INTEGER Increment,
+ IN PKSPIN_LOCK Lock)
{
LARGE_INTEGER Integer =3D {{0}};
UNIMPLEMENTED;
return Integer;
}
=
-NTKERNELAPI
ULONG
NTAPI
-ExInterlockedAddUlong(
- IN PULONG Addend,
- IN ULONG Increment,
- PKSPIN_LOCK Lock)
+ExInterlockedAddUlong(IN PULONG Addend,
+ IN ULONG Increment,
+ PKSPIN_LOCK Lock)
{
return (ULONG)_InterlockedExchangeAdd((PLONG)Addend, Increment);
}
=
-#undef ExInterlockedIncrementLong
-NTKERNELAPI
INTERLOCKED_RESULT
NTAPI
-ExInterlockedIncrementLong(
- IN PLONG Addend,
- IN PKSPIN_LOCK Lock)
+ExInterlockedIncrementLong(IN PLONG Addend,
+ IN PKSPIN_LOCK Lock)
{
return _InterlockedIncrement(Addend);
}
=
-#undef ExInterlockedDecrementLong
-NTKERNELAPI
INTERLOCKED_RESULT
NTAPI
-ExInterlockedDecrementLong(
- IN PLONG Addend,
- IN PKSPIN_LOCK Lock)
+ExInterlockedDecrementLong(IN PLONG Addend,
+ IN PKSPIN_LOCK Lock)
{
return _InterlockedDecrement(Addend);
}
=
-NTKERNELAPI
ULONG
NTAPI
-ExInterlockedExchangeUlong(
- IN PULONG Target,
- IN ULONG Value,
- IN PKSPIN_LOCK Lock)
+ExInterlockedExchangeUlong(IN PULONG Target,
+ IN ULONG Value,
+ IN PKSPIN_LOCK Lock)
{
return (ULONG)_InterlockedExchange((PLONG)Target, Value);
}
=
-NTKERNELAPI
-PLIST_ENTRY
-NTAPI
-ExInterlockedInsertHeadList(
- IN PLIST_ENTRY ListHead,
- IN PLIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+NTAPI
+ExInterlockedInsertHeadList(IN PLIST_ENTRY ListHead,
+ IN PLIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PLIST_ENTRY OldHead =3D NULL;
@@ -278,13 +230,11 @@
return OldHead;
}
=
-NTKERNELAPI
-PLIST_ENTRY
-NTAPI
-ExInterlockedInsertTailList(
- IN PLIST_ENTRY ListHead,
- IN PLIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+NTAPI
+ExInterlockedInsertTailList(IN PLIST_ENTRY ListHead,
+ IN PLIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PLIST_ENTRY OldHead =3D NULL;
@@ -295,12 +245,10 @@
return OldHead;
}
=
-NTKERNELAPI
-PSINGLE_LIST_ENTRY
-NTAPI
-ExInterlockedPopEntryList(
- IN PSINGLE_LIST_ENTRY ListHead,
- IN PKSPIN_LOCK Lock)
+PSINGLE_LIST_ENTRY
+NTAPI
+ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PSINGLE_LIST_ENTRY OldHead =3D NULL;
@@ -310,13 +258,11 @@
return OldHead;
}
=
-NTKERNELAPI
-PSINGLE_LIST_ENTRY
-NTAPI
-ExInterlockedPushEntryList(
- IN PSINGLE_LIST_ENTRY ListHead,
- IN PSINGLE_LIST_ENTRY ListEntry,
- IN PKSPIN_LOCK Lock)
+PSINGLE_LIST_ENTRY
+NTAPI
+ExInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead,
+ IN PSINGLE_LIST_ENTRY ListEntry,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PSINGLE_LIST_ENTRY OldHead =3D NULL;
@@ -326,12 +272,10 @@
return OldHead;
}
=
-NTKERNELAPI
-PLIST_ENTRY
-NTAPI
-ExInterlockedRemoveHeadList(
- IN PLIST_ENTRY ListHead,
- IN PKSPIN_LOCK Lock)
+PLIST_ENTRY
+NTAPI
+ExInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
PLIST_ENTRY OldHead =3D NULL;
@@ -341,23 +285,20 @@
return OldHead;
}
=
-NTKERNELAPI
-VOID
-FASTCALL
-ExInterlockedAddLargeStatistic
-(IN PLARGE_INTEGER Addend,
- IN ULONG Increment)
+VOID
+FASTCALL
+ExInterlockedAddLargeStatistic(IN PLARGE_INTEGER Addend,
+ IN ULONG Increment)
{
UNIMPLEMENTED;
}
=
-NTKERNELAPI
LONGLONG
FASTCALL
-ExInterlockedCompareExchange64(IN OUT PLONGLONG Destination,
- IN PLONGLONG Exchange,
- IN PLONGLONG Comparand,
- IN PKSPIN_LOCK Lock)
+ExInterlockedCompareExchange64(IN OUT PLONGLONG Destination,
+ IN PLONGLONG Exchange,
+ IN PLONGLONG Comparand,
+ IN PKSPIN_LOCK Lock)
{
KIRQL OldIrql;
LONGLONG Result;
@@ -368,3 +309,149 @@
KeReleaseSpinLock(Lock, OldIrql);
return Result;
}
+
+VOID
+NTAPI
+READ_REGISTER_BUFFER_UCHAR(IN PUCHAR Register,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ PUCHAR registerBuffer =3D Register;
+ PUCHAR readBuffer =3D Buffer;
+ ULONG readCount;
+ =
+ for (readCount =3D Count; readCount--; readBuffer++, registerBuffer++)
+ {
+ *readBuffer =3D *(volatile UCHAR * const)registerBuffer;
+ }
+}
+
+VOID
+NTAPI
+READ_REGISTER_BUFFER_ULONG(IN PULONG Register,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ PULONG registerBuffer =3D Register;
+ PULONG readBuffer =3D Buffer;
+ ULONG readCount;
+ =
+ for (readCount =3D Count; readCount--; readBuffer++, registerBuffer++)
+ {
+ *readBuffer =3D *(volatile ULONG * const)registerBuffer;
+ }
+}
+
+VOID
+NTAPI
+READ_REGISTER_BUFFER_USHORT(IN PUSHORT Register,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ PUSHORT registerBuffer =3D Register;
+ PUSHORT readBuffer =3D Buffer;
+ ULONG readCount;
+ =
+ for (readCount =3D Count; readCount--; readBuffer++, registerBuffer++)
+ {
+ *readBuffer =3D *(volatile USHORT * const)registerBuffer;
+ }
+}
+
+UCHAR
+NTAPI
+READ_REGISTER_UCHAR(IN PUCHAR Register)
+{
+ return *(volatile UCHAR * const)Register;
+}
+
+ULONG
+NTAPI
+READ_REGISTER_ULONG(IN PULONG Register)
+{
+ return *(volatile ULONG * const)Register;
+}
+
+USHORT
+NTAPI
+READ_REGISTER_USHORT(IN PUSHORT Register)
+{
+ return *(volatile USHORT * const)Register; =
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_BUFFER_UCHAR(IN PUCHAR Register,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ PUCHAR registerBuffer =3D Register;
+ PUCHAR writeBuffer =3D Buffer;
+ ULONG writeCount;
+ for (writeCount =3D Count; writeCount--; writeBuffer++, registerBuffer=
++)
+ {
+ *(volatile UCHAR * const)registerBuffer =3D *writeBuffer;
+ }
+ KeFlushWriteBuffer();
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_BUFFER_ULONG(IN PULONG Register,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ PULONG registerBuffer =3D Register;
+ PULONG writeBuffer =3D Buffer;
+ ULONG writeCount;
+ for (writeCount =3D Count; writeCount--; writeBuffer++, registerBuffer=
++)
+ {
+ *(volatile ULONG * const)registerBuffer =3D *writeBuffer;
+ }
+ KeFlushWriteBuffer();
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_BUFFER_USHORT(IN PUSHORT Register,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ PUSHORT registerBuffer =3D Register;
+ PUSHORT writeBuffer =3D Buffer;
+ ULONG writeCount;
+ for (writeCount =3D Count; writeCount--; writeBuffer++, registerBuffer=
++)
+ {
+ *(volatile USHORT * const)registerBuffer =3D *writeBuffer;
+ }
+ KeFlushWriteBuffer();
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_UCHAR(IN PUCHAR Register,
+ IN UCHAR Value)
+{
+ *(volatile UCHAR * const)Register =3D Value;
+ KeFlushWriteBuffer(); =
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_ULONG(IN PULONG Register,
+ IN ULONG Value)
+{
+ *(volatile ULONG * const)Register =3D Value;
+ KeFlushWriteBuffer(); =
+}
+
+VOID
+NTAPI
+WRITE_REGISTER_USHORT(IN PUSHORT Register,
+ IN USHORT Value)
+{
+ *(volatile USHORT * const)Register =3D Value;
+ KeFlushWriteBuffer(); =
+}
+
+#endif
Modified: trunk/reactos/ntoskrnl/ex/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?re=
v=3D32666&r1=3D32665&r2=3D32666&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/init.c (original)
+++ trunk/reactos/ntoskrnl/ex/init.c Wed Mar 12 13:17:55 2008
@@ -1841,7 +1841,9 @@
InbvUpdateProgressBar(80);
=
/* Initialize VDM support */
+#ifdef i386
KeI386VdmInitialize();
+#endif
=
/* Initialize Power Subsystem in Phase 1*/
if (!PoInitSystem(1, AcpiTableDetected)) KeBugCheck(INTERNAL_POWER_ERR=
OR);
Modified: trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/inte=
rnal/arm/ksarm.h?rev=3D32666&r1=3D32665&r2=3D32666&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/arm/ksarm.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h Wed Mar 12 13:17:55=
2008
@@ -1,9 +1,20 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/include/internal/arm/ksarm.h
+ * PURPOSE: Definitions and offsets for ARM Assembly and C code
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ */
+
+#ifdef _ASM_
+
/*
* CPSR Values
*/
.equ CPSR_THUMB_ENABLE, 0x20 =
.equ CPSR_FIQ_DISABLE, 0x40
.equ CPSR_IRQ_DISABLE, 0x80
+.equ CPSR_USER_MODE, 0x10
.equ CPSR_FIQ_MODE, 0x11
.equ CPSR_IRQ_MODE, 0x12
.equ CPSR_SVC_MODE, 0x13
@@ -38,3 +49,21 @@
* PCR
*/
.equ KiPcr, 0xFFFFF000
+
+#else
+
+/*
+ * CPSR Values
+ */
+#define CPSR_THUMB_ENABLE 0x20 =
+#define CPSR_FIQ_DISABLE 0x40
+#define CPSR_IRQ_DISABLE 0x80
+#define CPSR_USER_MODE 0x10
+#define CPSR_FIQ_MODE 0x11
+#define CPSR_IRQ_MODE 0x12
+#define CPSR_SVC_MODE 0x13
+#define CPSR_ABORT_MODE 0x17
+#define CPSR_UND_MODE 0x1B
+#define CPSR_MODES 0x1F
+
+#endif
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=3D32666&r1=3D32665&r2=3D32666&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 Wed Mar 12 13:17:55 2008
@@ -1,20 +1,4 @@
#include <internal/arm/asmmacro.S>
-
-//
-// Port I/O and Register Access
-//
-GENERATE_ARM_STUB READ_REGISTER_BUFFER_UCHAR =
-GENERATE_ARM_STUB READ_REGISTER_BUFFER_ULONG =
-GENERATE_ARM_STUB READ_REGISTER_BUFFER_USHORT =
-GENERATE_ARM_STUB READ_REGISTER_UCHAR =
-GENERATE_ARM_STUB READ_REGISTER_ULONG =
-GENERATE_ARM_STUB READ_REGISTER_USHORT =
-GENERATE_ARM_STUB WRITE_REGISTER_BUFFER_UCHAR =
-GENERATE_ARM_STUB WRITE_REGISTER_BUFFER_ULONG =
-GENERATE_ARM_STUB WRITE_REGISTER_BUFFER_USHORT =
-GENERATE_ARM_STUB WRITE_REGISTER_UCHAR =
-GENERATE_ARM_STUB WRITE_REGISTER_ULONG =
-GENERATE_ARM_STUB WRITE_REGISTER_USHORT =
=
//
// Exceptions
@@ -30,31 +14,22 @@
//
GENERATE_ARM_STUB KiSwapContext
GENERATE_ARM_STUB DbgBreakPointWithStatus =
-GENERATE_ARM_STUB Ke386CallBios =
GENERATE_ARM_STUB KeConnectInterrupt =
GENERATE_ARM_STUB KeDcacheFlushCount =
GENERATE_ARM_STUB KeDisconnectInterrupt =
GENERATE_ARM_STUB KeFlushEntireTb =
GENERATE_ARM_STUB KeGetRecommendedSharedDataAlignment =
-GENERATE_ARM_STUB KeI386AllocateGdtSelectors =
-GENERATE_ARM_STUB KeI386FlatToGdtSelector =
-GENERATE_ARM_STUB KeI386ReleaseGdtSelectors =
GENERATE_ARM_STUB KeIcacheFlushCount =
GENERATE_ARM_STUB KeInitializeInterrupt =
GENERATE_ARM_STUB KeNumberProcessors =
GENERATE_ARM_STUB KeQueryActiveProcessors =
GENERATE_ARM_STUB KeRaiseUserException =
-GENERATE_ARM_STUB KeRestoreFloatingPointState =
-GENERATE_ARM_STUB KeSaveFloatingPointState =
GENERATE_ARM_STUB KeSaveStateForHibernate =
GENERATE_ARM_STUB KeSetDmaIoCoherency =
GENERATE_ARM_STUB KeSynchronizeExecution =
GENERATE_ARM_STUB KeUpdateRunTime =
GENERATE_ARM_STUB KeUpdateSystemTime =
GENERATE_ARM_STUB KeUserModeCallback =
-GENERATE_ARM_STUB Kei386EoiHelper =
-GENERATE_ARM_STUB KiCoprocessorError =
-GENERATE_ARM_STUB KiDispatchInterrupt =
GENERATE_ARM_STUB NtSetLdtEntries
GENERATE_ARM_STUB NtRaiseException
GENERATE_ARM_STUB NtCallbackReturn
@@ -66,12 +41,12 @@
//
// Internal Ke Arch-Specific Helpers
//
+GENERATE_ARM_STUB KiDispatchInterrupt
GENERATE_ARM_STUB KiSaveProcessorControlState
GENERATE_ARM_STUB KiInitializeUserApc
GENERATE_ARM_STUB KeDisableInterrupts
GENERATE_ARM_STUB KiDispatchException
GENERATE_ARM_STUB KiSwapProcess
-GENERATE_ARM_STUB KeI386VdmInitialize
GENERATE_ARM_STUB KeSwitchKernelStack
GENERATE_ARM_STUB KiInitMachineDependent
GENERATE_ARM_STUB KiComputeTimerTableIndex
Modified: trunk/reactos/ntoskrnl/ke/arm/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trap.=
s?rev=3D32666&r1=3D32665&r2=3D32666&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/trap.s (original)
+++ trunk/reactos/ntoskrnl/ke/arm/trap.s Wed Mar 12 13:17:55 2008
@@ -44,10 +44,35 @@
PROLOG_END KiSoftwareInterruptException
=
//
- // FIXME: TODO
- //
- b .
- =
+ // Save return address
+ //
+ str lr, [sp, #-4]!
+ =
+ //
+ // Make space for trap frame
+ //
+ sub sp, sp, #(4*17)
+ =
+ //
+ // Save user-mode registers
+ //
+ stmia sp, {r0-r12}
+ add r0, sp, #(4*13)
+ stmia r0, {r13-r14}^
+ mov r0, r0
+ =
+ //
+ // Save SPSR
+ //
+ mrs r0, spsr_all
+ str r0, [sp, #-4]!
+ =
+ //
+ // Call the C handler
+ //
+ mov r0, sp
+ bl KiSoftwareInterruptHandler
+
ENTRY_END KiSoftwareInterruptException
=
NESTED_ENTRY KiPrefetchAbortException
@@ -125,6 +150,7 @@
stmia sp, {r0-r12}
add r0, sp, #(4*13)
stmia r0, {r13-r14}^
+ mov r0, r0
=
//
// Save SPSR
Modified: trunk/reactos/ntoskrnl/ke/arm/trapc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trapc=
.c?rev=3D32666&r1=3D32665&r2=3D32666&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/trapc.c (original)
+++ trunk/reactos/ntoskrnl/ke/arm/trapc.c Wed Mar 12 13:17:55 2008
@@ -9,10 +9,14 @@
/* INCLUDES **************************************************************=
*****/
=
#include <ntoskrnl.h>
+#include <internal/arm/ksarm.h>
#define NDEBUG
#include <debug.h>
=
/* GLOBALS ***************************************************************=
*****/
+
+#define KiGetPreviousMode(tf) \
+ ((tf->Spsr & CPSR_MODES) =3D=3D CPSR_USER_MODE) ? UserMode: KernelMode
=
/* FUNCTIONS *************************************************************=
*****/
=
@@ -41,3 +45,60 @@
return STATUS_SUCCESS;
}
=
+NTSTATUS
+KiSystemService(IN PKTHREAD Thread,
+ IN PKTRAP_FRAME TrapFrame,
+ IN ULONG Instruction)
+{
+ ULONG Id;
+ PKPCR Pcr;
+ =
+ //
+ // Increase count of system calls
+ //
+ Pcr =3D (PKPCR)KeGetPcr();
+ Pcr->Prcb->KeSystemCalls++;
+ =
+ //
+ // Get the system call ID
+ //
+ Id =3D Instruction & 0xFFFFF;
+ DPRINT1("System call (%X) from thread: %p \n", Id, Thread); =
+ while (TRUE);
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+KiSoftwareInterruptHandler(IN PKTRAP_FRAME TrapFrame)
+{
+ PKTHREAD Thread;
+ KPROCESSOR_MODE PreviousMode;
+ ULONG Instruction;
+ DPRINT1("SWI @ %p %p \n", TrapFrame->Pc, TrapFrame->UserLr);
+ =
+ //
+ // Get the current thread
+ //
+ Thread =3D KeGetCurrentThread();
+ =
+ //
+ // Isolate previous mode
+ //
+ PreviousMode =3D KiGetPreviousMode(TrapFrame);
+ =
+ //
+ // Save previous mode and trap frame
+ //
+ Thread->TrapFrame =3D TrapFrame;
+ Thread->PreviousMode =3D PreviousMode;
+ =
+ //
+ // Read the opcode
+ //
+ Instruction =3D *(PULONG)(TrapFrame->Pc - sizeof(ULONG));
+ =
+ //
+ // Call the service call dispatcher
+ //
+ return KiSystemService(Thread, TrapFrame, Instruction);
+}
Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-gen=
eric.rbuild?rev=3D32666&r1=3D32665&r2=3D32666&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 Wed Mar 12 13:17:55 2008
@@ -166,17 +166,8 @@
<directory name=3D"i386">
<file>interlck_asm.S</file>
<file>fastinterlck_asm.S</file>
- <file>ioport.S</file>
- </directory>
- </if>
- <if property=3D"ARCH" value=3D"powerpc">
- <directory name=3D"powerpc">
- <file>ioport.s</file>
- </directory>
- <file>fastinterlck.c</file>
- </if>
- <if property=3D"ARCH" value=3D"arm">
- <file>fastinterlck.c</file>
+ <file>ioport.s</file>
+ </directory>
</if>
<file>atom.c</file>
<file>callback.c</file>
@@ -185,6 +176,7 @@
<file>event.c</file>
<file>evtpair.c</file>
<file>exintrin.c</file>
+ <file>fastinterlck.c</file>
<file>fmutex.c</file>
<file>handle.c</file>
<file>harderr.c</file>
Modified: trunk/reactos/ntoskrnl/ntoskrnl_arm.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl_arm=
.def?rev=3D32666&r1=3D32665&r2=3D32666&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_arm.def (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl_arm.def Wed Mar 12 13:17:55 2008
@@ -518,7 +518,6 @@
KdPollBreakIn
KdPowerTransition
KdSystemDebugControl
-Ke386CallBios
KeAcquireGuardedMutex
KeAcquireGuardedMutexUnsafe
KeAcquireSpinLockAtDpcLevel
@@ -550,16 +549,6 @@
KeGetCurrentThread
KeGetPreviousMode
KeGetRecommendedSharedDataAlignment
-;KeI386AbiosCall
-KeI386AllocateGdtSelectors
-;KeI386Call16BitCStyleFunction
-;KeI386Call16BitFunction
-KeI386FlatToGdtSelector
-;KeI386GetLid
-;KeI386MachineType DATA
-KeI386ReleaseGdtSelectors
-;KeI386ReleaseLid
-;KeI386SetGdtSelector
KeIcacheFlushCount DATA
KeInitializeApc
KeInitializeDeviceQueue
@@ -621,10 +610,8 @@
KeRemoveQueueDpc
KeRemoveSystemServiceTable
KeResetEvent
-KeRestoreFloatingPointState
KeRevertToUserAffinityThread
KeRundownQueue
-KeSaveFloatingPointState
KeSaveStateForHibernate
KeServiceDescriptorTable DATA
KeSetAffinityThread
@@ -658,13 +645,10 @@
KeWaitForSingleObject
KefAcquireSpinLockAtDpcLevel
KefReleaseSpinLockFromDpcLevel
-Kei386EoiHelper
KiAcquireSpinLock
;KiBugCheckData DATA
-KiCoprocessorError
KiCheckForKernelApcDelivery
KiDeliverApc
-KiDispatchInterrupt
KiEnableTimerWatchdog
KiIpiServiceRoutine
KiReleaseSpinLock
Modified: trunk/reactos/tools/nci/ncitool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/nci/ncitool.c?r=
ev=3D32666&r1=3D32665&r2=3D32666&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/tools/nci/ncitool.c (original)
+++ trunk/reactos/tools/nci/ncitool.c Wed Mar 12 13:17:55 2008
@@ -68,11 +68,7 @@
" j $8\n" \
" nop\n"
=
-//
-// For now, only supports 0-4 arguments
-//
-#define UserModeStub_arm " ldr r12, =3D%x\n" \
- " swi #0x2E\n" \
+#define UserModeStub_arm " swi #0x%x\n" \
" bx lr\n\n"
=
#elif defined(_MSC_VER)
@@ -104,8 +100,7 @@
#define KernelModeStub_mips " j KiSystemService\n" \
" nop\n"
=
-#define KernelModeStub_arm " ldr r12, =3D0x%x\n" \
- " swi #0x2E\n" \
+#define KernelModeStub_arm " swi #0x%x\n" \
" bx lr\n\n"
=
#elif defined(_MSC_VER)