Better support for non X86 systems

svn path=/trunk/; revision=25264
This commit is contained in:
Hervé Poussineau 2007-01-01 14:50:16 +00:00
parent 4afb3f0181
commit f9b6e910f9
12 changed files with 64 additions and 50 deletions

View file

@ -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>

View file

@ -5219,6 +5219,31 @@ typedef struct _KFLOATING_SAVE {
ULONG Spare1;
} KFLOATING_SAVE, *PKFLOATING_SAVE;
static __inline
ULONG
DDKAPI
KeGetCurrentProcessorNumber(VOID)
{
#if defined(__GNUC__)
ULONG ret;
__asm__ __volatile__ (
"movl %%fs:%c1, %0\n"
: "=r" (ret)
: "i" (FIELD_OFFSET(KPCR, Number))
);
return ret;
#elif defined(_MSC_VER)
#if _MSC_FULL_VER >= 13012035
return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
#else
__asm { movzx eax, _PCR KPCR.Number }
#endif
#else
#error Unknown compiler
#endif
}
#endif /* _X86_ */
#define PAGE_SIZE 0x1000
#define PAGE_SHIFT 12L
@ -5296,30 +5321,6 @@ DDKAPI
KeGetCurrentIrql(
VOID);
static __inline
ULONG
DDKAPI
KeGetCurrentProcessorNumber(VOID)
{
#if defined(__GNUC__)
ULONG ret;
__asm__ __volatile__ (
"movl %%fs:%c1, %0\n"
: "=r" (ret)
: "i" (FIELD_OFFSET(KPCR, Number))
);
return ret;
#elif defined(_MSC_VER)
#if _MSC_FULL_VER >= 13012035
return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
#else
__asm { movzx eax, _PCR KPCR.Number }
#endif
#else
#error Unknown compiler
#endif
}
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
@ -5416,8 +5417,6 @@ KfReleaseSpinLock(
#define KeGetDcacheFillSize() 1L
#endif /* _X86_ */
/*
@ -10579,13 +10578,13 @@ DbgBreakPointWithStatus(
IN ULONG Status);
ULONG
__cdecl
DDKCDECLAPI
DbgPrint(
IN PCCH Format,
IN ...);
ULONG
__cdecl
DDKCDECLAPI
DbgPrintEx(
IN ULONG ComponentId,
IN ULONG Level,

View file

@ -34,7 +34,7 @@ Author:
//
// 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 &&

View file

@ -229,6 +229,7 @@ NtCreateThread(
);
#ifndef NTOS_MODE_USER
#if defined(_M_IX86)
FORCEINLINE
PTEB
NtCurrentTeb(VOID)
@ -248,6 +249,9 @@ NtCurrentTeb(VOID)
#endif
}
#endif
#else
struct _TEB * NtCurrentTeb(void);
#endif
NTSYSCALLAPI
NTSTATUS

View file

@ -1216,7 +1216,7 @@ typedef struct _EPROCESS
#endif
union
{
HARDWARE_PTE_X86 PagedirectoryPte;
HARDWARE_PTE PagedirectoryPte;
ULONGLONG Filler;
};
ULONG Session;

View file

@ -138,7 +138,7 @@ Author:
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

View file

@ -29,6 +29,7 @@ unsigned int __cpu_features = 0;
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 @@ void __cpu_features_init (void)
__cpu_features |= _CRT_3DNOW;
if (edx & EDX_3DNOWP)
__cpu_features |= _CRT_3DNOWP;
return;
#endif
}
#ifdef TEST

View file

@ -218,7 +218,11 @@ __mingw_wCRTStartup (void)
/* 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

View file

@ -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>

View file

@ -104,7 +104,6 @@ RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo,
if (RosSymInfo->Symbols == NULL || RosSymInfo->SymbolsCount == 0 ||
RosSymInfo->Strings == NULL || RosSymInfo->StringsLength == 0)
{
__asm__("int $3\n");
DPRINT1("Uninitialized RosSymInfo\n");
return FALSE;
}

View file

@ -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>

View file

@ -858,6 +858,10 @@ IopInitializeBuiltinDriver(
{
FileNameWithoutPath = ModuleName->Buffer;
}
else
{
FileNameWithoutPath++;
}
/*
* Load the module