Author: hpoussin
Date: Mon Jan 1 17:50:16 2007
New Revision: 25264
URL:
http://svn.reactos.org/svn/reactos?rev=25264&view=rev
Log:
Better support for non X86 systems
Modified:
trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/i386/mmtypes.h
trunk/reactos/include/ndk/psfuncs.h
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/ndk/rtltypes.h
trunk/reactos/lib/mingw/cpu_features.c
trunk/reactos/lib/mingw/wcrt1.c
trunk/reactos/lib/pseh/pseh.rbuild
trunk/reactos/lib/rossym/find.c
trunk/reactos/lib/rtl/rtl.rbuild
trunk/reactos/ntoskrnl/io/iomgr/driver.c
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild Mon Jan 1 17:50:16 2007
@@ -68,13 +68,15 @@
<file>pixel.c</file>
<file>video.c</file>
</directory>
- <directory name="windows">
- <file>conversion.c</file>
- <file>peloader.c</file>
- <file>winldr.c</file>
- <file>wlmemory.c</file>
- <file>wlregistry.c</file>
- </directory>
+ <if property="ARCH" value="i386">
+ <directory name="windows">
+ <file>conversion.c</file>
+ <file>peloader.c</file>
+ <file>winldr.c</file>
+ <file>wlmemory.c</file>
+ <file>wlregistry.c</file>
+ </directory>
+ </if>
<file>freeldr.c</file>
<file>debug.c</file>
<file>version.c</file>
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Mon Jan 1 17:50:16 2007
@@ -5219,83 +5219,6 @@
ULONG Spare1;
} KFLOATING_SAVE, *PKFLOATING_SAVE;
-#define PAGE_SIZE 0x1000
-#define PAGE_SHIFT 12L
-
-extern NTKERNELAPI PVOID MmHighestUserAddress;
-extern NTKERNELAPI PVOID MmSystemRangeStart;
-extern NTKERNELAPI ULONG_PTR MmUserProbeAddress;
-
-#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
-#define MM_SYSTEM_RANGE_START MmSystemRangeStart
-#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
-#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
-#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0C00000
-
-#define KI_USER_SHARED_DATA 0xffdf0000
-#define SharedUserData ((KUSER_SHARED_DATA * CONST)
KI_USER_SHARED_DATA)
-
-#define EFLAG_SIGN 0x8000
-#define EFLAG_ZERO 0x4000
-#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO)
-
-#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
-#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) &
EFLAG_SELECT)
-#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
-
-typedef enum _INTERLOCKED_RESULT {
- ResultNegative = RESULT_NEGATIVE,
- ResultZero = RESULT_ZERO,
- ResultPositive = RESULT_POSITIVE
-} INTERLOCKED_RESULT;
-
-typedef VOID
-(NTAPI *PciPin2Line)(
- IN struct _BUS_HANDLER *BusHandler,
- IN struct _BUS_HANDLER *RootHandler,
- IN PCI_SLOT_NUMBER SlotNumber,
- IN PPCI_COMMON_CONFIG PciData
-);
-
-typedef VOID
-(NTAPI *PciLine2Pin)(
- IN struct _BUS_HANDLER *BusHandler,
- IN struct _BUS_HANDLER *RootHandler,
- IN PCI_SLOT_NUMBER SlotNumber,
- IN PPCI_COMMON_CONFIG PciNewData,
- IN PPCI_COMMON_CONFIG PciOldData
-);
-
-typedef VOID
-(NTAPI *PciReadWriteConfig)(
- IN struct _BUS_HANDLER *BusHandler,
- IN PCI_SLOT_NUMBER Slot,
- IN PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length
-);
-
-#define PCI_DATA_TAG TAG('P', 'C', 'I', ' ')
-#define PCI_DATA_VERSION 1
-
-typedef struct _PCIBUSDATA
-{
- ULONG Tag;
- ULONG Version;
- PciReadWriteConfig ReadConfig;
- PciReadWriteConfig WriteConfig;
- PciPin2Line Pin2Line;
- PciLine2Pin Line2Pin;
- PCI_SLOT_NUMBER ParentSlot;
- PVOID Reserved[4];
-} PCIBUSDATA, *PPCIBUSDATA;
-
-NTHALAPI
-KIRQL
-DDKAPI
-KeGetCurrentIrql(
- VOID);
-
static __inline
ULONG
DDKAPI
@@ -5319,6 +5242,84 @@
#error Unknown compiler
#endif
}
+#endif /* _X86_ */
+
+#define PAGE_SIZE 0x1000
+#define PAGE_SHIFT 12L
+
+extern NTKERNELAPI PVOID MmHighestUserAddress;
+extern NTKERNELAPI PVOID MmSystemRangeStart;
+extern NTKERNELAPI ULONG_PTR MmUserProbeAddress;
+
+#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
+#define MM_SYSTEM_RANGE_START MmSystemRangeStart
+#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
+#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
+#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0C00000
+
+#define KI_USER_SHARED_DATA 0xffdf0000
+#define SharedUserData ((KUSER_SHARED_DATA * CONST)
KI_USER_SHARED_DATA)
+
+#define EFLAG_SIGN 0x8000
+#define EFLAG_ZERO 0x4000
+#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO)
+
+#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
+#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) &
EFLAG_SELECT)
+#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) &
EFLAG_SELECT)
+
+typedef enum _INTERLOCKED_RESULT {
+ ResultNegative = RESULT_NEGATIVE,
+ ResultZero = RESULT_ZERO,
+ ResultPositive = RESULT_POSITIVE
+} INTERLOCKED_RESULT;
+
+typedef VOID
+(NTAPI *PciPin2Line)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN struct _BUS_HANDLER *RootHandler,
+ IN PCI_SLOT_NUMBER SlotNumber,
+ IN PPCI_COMMON_CONFIG PciData
+);
+
+typedef VOID
+(NTAPI *PciLine2Pin)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN struct _BUS_HANDLER *RootHandler,
+ IN PCI_SLOT_NUMBER SlotNumber,
+ IN PPCI_COMMON_CONFIG PciNewData,
+ IN PPCI_COMMON_CONFIG PciOldData
+);
+
+typedef VOID
+(NTAPI *PciReadWriteConfig)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN PCI_SLOT_NUMBER Slot,
+ IN PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length
+);
+
+#define PCI_DATA_TAG TAG('P', 'C', 'I', ' ')
+#define PCI_DATA_VERSION 1
+
+typedef struct _PCIBUSDATA
+{
+ ULONG Tag;
+ ULONG Version;
+ PciReadWriteConfig ReadConfig;
+ PciReadWriteConfig WriteConfig;
+ PciPin2Line Pin2Line;
+ PciLine2Pin Line2Pin;
+ PCI_SLOT_NUMBER ParentSlot;
+ PVOID Reserved[4];
+} PCIBUSDATA, *PPCIBUSDATA;
+
+NTHALAPI
+KIRQL
+DDKAPI
+KeGetCurrentIrql(
+ VOID);
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
@@ -5415,8 +5416,6 @@
#define RtlCopyMemoryNonTemporal RtlCopyMemory
#define KeGetDcacheFillSize() 1L
-
-#endif /* _X86_ */
@@ -10579,13 +10578,13 @@
IN ULONG Status);
ULONG
-__cdecl
+DDKCDECLAPI
DbgPrint(
IN PCCH Format,
IN ...);
ULONG
-__cdecl
+DDKCDECLAPI
DbgPrintEx(
IN ULONG ComponentId,
IN ULONG Level,
Modified: trunk/reactos/include/ndk/i386/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/mmtypes.h…
==============================================================================
--- trunk/reactos/include/ndk/i386/mmtypes.h (original)
+++ trunk/reactos/include/ndk/i386/mmtypes.h Mon Jan 1 17:50:16 2007
@@ -34,7 +34,7 @@
//
// Sanity checks for Paging Macros
//
-#ifndef __GNUC__
+#ifdef C_ASSERT
C_ASSERT(PAGE_SIZE == (1 << PAGE_SHIFT));
C_ASSERT(MM_ALLOCATION_GRANULARITY == (1 << MM_ALLOCATION_GRANULARITY_SHIFT));
C_ASSERT(MM_ALLOCATION_GRANULARITY &&
Modified: trunk/reactos/include/ndk/psfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/psfuncs.h (original)
+++ trunk/reactos/include/ndk/psfuncs.h Mon Jan 1 17:50:16 2007
@@ -229,6 +229,7 @@
);
#ifndef NTOS_MODE_USER
+#if defined(_M_IX86)
FORCEINLINE
PTEB
NtCurrentTeb(VOID)
@@ -248,6 +249,9 @@
#endif
}
#endif
+#else
+struct _TEB * NtCurrentTeb(void);
+#endif
NTSYSCALLAPI
NTSTATUS
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h (original)
+++ trunk/reactos/include/ndk/pstypes.h Mon Jan 1 17:50:16 2007
@@ -1216,7 +1216,7 @@
#endif
union
{
- HARDWARE_PTE_X86 PagedirectoryPte;
+ HARDWARE_PTE PagedirectoryPte;
ULONGLONG Filler;
};
ULONG Session;
Modified: trunk/reactos/include/ndk/rtltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtltypes.h (original)
+++ trunk/reactos/include/ndk/rtltypes.h Mon Jan 1 17:50:16 2007
@@ -138,7 +138,7 @@
HEAP_CREATE_ALIGN_16 | \
HEAP_CREATE_ENABLE_TRACING | \
HEAP_CREATE_ENABLE_EXECUTE)
-#ifndef __GNUC__
+#ifdef C_ASSERT
C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
#endif
Modified: trunk/reactos/lib/mingw/cpu_features.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/mingw/cpu_features.c?r…
==============================================================================
--- trunk/reactos/lib/mingw/cpu_features.c (original)
+++ trunk/reactos/lib/mingw/cpu_features.c Mon Jan 1 17:50:16 2007
@@ -29,6 +29,7 @@
void __cpu_features_init (void)
{
+#ifdef __i386__
unsigned int eax, ebx, ecx, edx;
/* Try to change the value of CPUID bit (bit 21) in EFLAGS.
If the bit can be toggled, CPUID is supported. */
@@ -75,8 +76,7 @@
__cpu_features |= _CRT_3DNOW;
if (edx & EDX_3DNOWP)
__cpu_features |= _CRT_3DNOWP;
-
- return;
+#endif
}
#ifdef TEST
Modified: trunk/reactos/lib/mingw/wcrt1.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/mingw/wcrt1.c?rev=2526…
==============================================================================
--- trunk/reactos/lib/mingw/wcrt1.c (original)
+++ trunk/reactos/lib/mingw/wcrt1.c Mon Jan 1 17:50:16 2007
@@ -218,7 +218,11 @@
/* Align the stack to 16 bytes for the sake of SSE ops in main
or in functions inlined into main. */
+#if defined(__i386__)
asm __volatile__ ("andl $-16, %%esp" : : : "%esp");
+#else
+#error Unsupported architecture
+#endif
/*
* Call the main function. If the user does not supply one
Modified: trunk/reactos/lib/pseh/pseh.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/pseh.rbuild?rev=2…
==============================================================================
--- trunk/reactos/lib/pseh/pseh.rbuild (original)
+++ trunk/reactos/lib/pseh/pseh.rbuild Mon Jan 1 17:50:16 2007
@@ -1,8 +1,10 @@
<module name="pseh" type="staticlibrary">
<define name="__USE_W32API" />
- <directory name="i386">
- <file>framebased.asm</file>
- <file>setjmp.asm</file>
- </directory>
+ <if property="ARCH" value="i386">
+ <directory name="i386">
+ <file>framebased.asm</file>
+ <file>setjmp.asm</file>
+ </directory>
+ </if>
<file>framebased.c</file>
</module>
Modified: trunk/reactos/lib/rossym/find.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rossym/find.c?rev=2526…
==============================================================================
--- trunk/reactos/lib/rossym/find.c (original)
+++ trunk/reactos/lib/rossym/find.c Mon Jan 1 17:50:16 2007
@@ -104,7 +104,6 @@
if (RosSymInfo->Symbols == NULL || RosSymInfo->SymbolsCount == 0 ||
RosSymInfo->Strings == NULL || RosSymInfo->StringsLength == 0)
{
-__asm__("int $3\n");
DPRINT1("Uninitialized RosSymInfo\n");
return FALSE;
}
Modified: trunk/reactos/lib/rtl/rtl.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=252…
==============================================================================
--- trunk/reactos/lib/rtl/rtl.rbuild (original)
+++ trunk/reactos/lib/rtl/rtl.rbuild Mon Jan 1 17:50:16 2007
@@ -35,7 +35,7 @@
<file>rtlmem.s</file>
<file>pow_asm.s</file>
<file>res_asm.s</file>
- <file>seh.s</file>
+ <file>seh.s</file>
<file>sin_asm.s</file>
<file>sqrt_asm.s</file>
<file>tan_asm.s</file>
@@ -46,10 +46,10 @@
<file>tree.c</file>
</directory>
- <ifnot property="ARCH" value="i386">
- <file>memgen.c</file>
- <file>mem.c</file>
- </ifnot>
+ <ifnot property="ARCH" value="i386">
+ <file>memgen.c</file>
+ <file>mem.c</file>
+ </ifnot>
<file>access.c</file>
<file>acl.c</file>
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Mon Jan 1 17:50:16 2007
@@ -857,6 +857,10 @@
if (FileNameWithoutPath == NULL)
{
FileNameWithoutPath = ModuleName->Buffer;
+ }
+ else
+ {
+ FileNameWithoutPath++;
}
/*