We no longer generate broken kernel-mode system call stubs.

We now have per-architecture definition files, since stdcall differences between the architectures cannot be fixed (tried a combination of --kill-at, which is ignored, and -add-stdcall-alias and --enable-stdcall-fixup. This is the same problem that breaks MSVC builds, according to Alex.)
Fixed KeRaiseIrqlToSynchLevel.
Added an arm directory in /ke where we have all the stubs for non-implemented ARM routines. We can now build almost the entire kernel and link it.
We now use intrinsics to export the Interlocked* APIs, for the ARM build. Recommend doing this for x86 too.
Hal and bootvid build and link.

svn path=/trunk/; revision=32205
This commit is contained in:
ReactOS Portable Systems Group 2008-02-08 06:07:47 +00:00
parent 3f09812318
commit a81c54beff
17 changed files with 1862 additions and 7 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="bootvid" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="bootvid.dll">
<importlibrary definition="bootvid.def"></importlibrary>
<importlibrary definition="bootvid_$(ARCH).def"></importlibrary>
<bootstrap installbase="$(CDOUTPUT)" nameoncd="bootvid.dll" />
<include base="bootvid">.</include>
<library>ntoskrnl</library>

View file

@ -0,0 +1,15 @@
LIBRARY BOOTVID.DLL
EXPORTS
VidBitBlt
VidBufferToScreenBlt
VidCleanUp
VidDisplayString
VidDisplayStringXY
VidInitialize
VidResetDisplay
VidScreenToBufferBlt
VidSetScrollRegion
VidSetTextColor
VidSolidColorFill

View file

@ -2,7 +2,7 @@
<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
<group>
<module name="hal" type="kernelmodedll">
<importlibrary basename="hal" definition="hal.def" />
<importlibrary basename="hal" definition="hal_$(ARCH).def" />
<include base="ntoskrnl">include</include>
<library>ntoskrnl</library>
<define name="_NTHAL_" />

View file

@ -0,0 +1,98 @@
; Hardware Abstraction Layer - ReactOS Operating System
LIBRARY hal.dll
EXPORTS
ExAcquireFastMutex=ExiAcquireFastMutex
ExReleaseFastMutex=ExiReleaseFastMutex
ExTryToAcquireFastMutex=ExiTryToAcquireFastMutex
HalClearSoftwareInterrupt
HalRequestSoftwareInterrupt
HalSystemVectorDispatchEntry
KeAcquireInStackQueuedSpinLock
KeAcquireInStackQueuedSpinLockRaiseToSynch
KeAcquireSpinLockRaiseToSynch
KeAcquireQueuedSpinLock
KeAcquireQueuedSpinLockRaiseToSynch
KeReleaseInStackQueuedSpinLock
KeReleaseQueuedSpinLock
KeTryToAcquireQueuedSpinLock
KeTryToAcquireQueuedSpinLockRaiseToSynch
KfAcquireSpinLock
KfLowerIrql
KfRaiseIrql
KfReleaseSpinLock
HalAcquireDisplayOwnership
HalAdjustResourceList
HalAllProcessorsStarted
HalAllocateAdapterChannel
HalAllocateCommonBuffer
HalAllocateCrashDumpRegisters
HalAssignSlotResources
HalBeginSystemInterrupt
HalCalibratePerformanceCounter
HalDisableSystemInterrupt
HalDisplayString
HalEnableSystemInterrupt
HalEndSystemInterrupt
HalFlushCommonBuffer
HalFreeCommonBuffer
HalGetAdapter
HalGetBusData
HalGetBusDataByOffset
HalGetEnvironmentVariable
HalGetInterruptVector
HalHandleNMI
HalInitSystem
HalInitializeProcessor
HalMakeBeep
HalProcessorIdle
HalQueryDisplayParameters
HalQueryRealTimeClock
HalReadDmaCounter
HalReportResourceUsage
HalRequestIpi
HalReturnToFirmware
HalSetBusData
HalSetBusDataByOffset
HalSetDisplayParameters
HalSetEnvironmentVariable
HalSetProfileInterval
HalSetRealTimeClock
HalSetTimeIncrement
HalStartNextProcessor
HalStartProfileInterrupt
HalStopProfileInterrupt
HalTranslateBusAddress
IoAssignDriveLetters=HalpAssignDriveLetters
IoFlushAdapterBuffers
IoFreeAdapterChannel
IoFreeMapRegisters
IoMapTransfer
IoReadPartitionTable=HalpReadPartitionTable
IoSetPartitionInformation=HalpSetPartitionInformation
IoWritePartitionTable=HalpWritePartitionTable
KeAcquireSpinLock
KdComPortInUse=_KdComPortInUse DATA
KeFlushWriteBuffer
KeGetCurrentIrql
KeLowerIrql
KeQueryPerformanceCounter
KeRaiseIrql
KeRaiseIrqlToDpcLevel
KeRaiseIrqlToSynchLevel
KeReleaseSpinLock
KeStallExecutionProcessor
READ_PORT_BUFFER_UCHAR
READ_PORT_BUFFER_ULONG
READ_PORT_BUFFER_USHORT
READ_PORT_UCHAR
READ_PORT_ULONG
READ_PORT_USHORT
WRITE_PORT_BUFFER_UCHAR
WRITE_PORT_BUFFER_ULONG
WRITE_PORT_BUFFER_USHORT
WRITE_PORT_UCHAR
WRITE_PORT_ULONG
WRITE_PORT_USHORT

View file

@ -6,7 +6,7 @@
</directory>
<module name="halup" type="kernelmodedll" entrypoint="0">
<importlibrary definition="../hal/hal.def" />
<importlibrary definition="../hal/hal_i386.def" />
<bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" />
<include>include</include>
<include base="ntoskrnl">include</include>
@ -22,7 +22,7 @@
</directory>
</module>
<module name="halmp" type="kernelmodedll" entrypoint="0">
<importlibrary definition="../hal/hal.def" />
<importlibrary definition="../hal/hal_i386.def" />
<bootstrap installbase="$(CDOUTPUT)" />
<include>include</include>
<include base="ntoskrnl">include</include>
@ -47,7 +47,7 @@
</directory>
</module>
<module name="halxbox" type="kernelmodedll" entrypoint="0" allowwarnings="true">
<importlibrary definition="../hal/hal.def" />
<importlibrary definition="../hal/hal_i386.def" />
<include>include</include>
<include base="ntoskrnl">include</include>
<define name="_DISABLE_TIDENTS" />

View file

@ -108,6 +108,11 @@ KeSwapIrql(
IN KIRQL NewIrql
);
KIRQL
KeRaiseIrqlToSynchLevel(
VOID
);
KIRQL
KeRaiseIrqlToDpcLevel(
VOID

View file

@ -0,0 +1,17 @@
//
// @name GENERATE_INT_HANDLER
//
// This macro creates an unexpected interrupt handler.
//
// @param None.
//
// @remark None.
//
.macro GENERATE_ARM_STUB Name
.global &Name
.func &Name
&Name:
b .
.endfunc
.endm

View file

@ -55,6 +55,15 @@
#include "vdm.h"
#include "hal.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>
/*
* Defines a descriptor as it appears in the processor tables

View file

@ -0,0 +1,9 @@
#include "ntoskrnl.h"
#define NDEBUG
#include "debug.h"
ULONG KeActiveProcessors;
ULONG KeProcessorArchitecture;
ULONG KeProcessorLevel;
ULONG KeProcessorRevision;
ULONG KeFeatureBits;

View file

@ -0,0 +1,171 @@
#include <internal/arm/asmmacro.S>
GENERATE_ARM_STUB KiSwapContext
GENERATE_ARM_STUB KeSwapIrql
GENERATE_ARM_STUB DbgBreakPointWithStatus
GENERATE_ARM_STUB ExInterlockedAddLargeInteger
GENERATE_ARM_STUB ExInterlockedAddLargeStatistic
GENERATE_ARM_STUB ExInterlockedAddUlong
GENERATE_ARM_STUB ExInterlockedCompareExchange64
GENERATE_ARM_STUB ExInterlockedDecrementLong
GENERATE_ARM_STUB ExInterlockedExchangeUlong
GENERATE_ARM_STUB ExInterlockedFlushSList
GENERATE_ARM_STUB ExInterlockedIncrementLong
GENERATE_ARM_STUB ExInterlockedInsertHeadList
GENERATE_ARM_STUB ExInterlockedInsertTailList
GENERATE_ARM_STUB ExInterlockedPopEntryList
GENERATE_ARM_STUB ExInterlockedPopEntrySList
GENERATE_ARM_STUB ExInterlockedPushEntryList
GENERATE_ARM_STUB ExInterlockedPushEntrySList
GENERATE_ARM_STUB ExInterlockedRemoveHeadList
GENERATE_ARM_STUB ExfInterlockedAddUlong
GENERATE_ARM_STUB ExfInterlockedCompareExchange64
GENERATE_ARM_STUB ExfInterlockedInsertHeadList
GENERATE_ARM_STUB ExfInterlockedInsertTailList
GENERATE_ARM_STUB ExfInterlockedPopEntryList
GENERATE_ARM_STUB ExfInterlockedPushEntryList
GENERATE_ARM_STUB ExfInterlockedRemoveHeadList
GENERATE_ARM_STUB Exfi386InterlockedDecrementLong
GENERATE_ARM_STUB Exfi386InterlockedExchangeUlong
GENERATE_ARM_STUB Exfi386InterlockedIncrementLong
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
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 KiUnexpectedInterrupt
GENERATE_ARM_STUB MmGetPhysicalAddress
GENERATE_ARM_STUB NtVdmControl
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 RtlCaptureContext
GENERATE_ARM_STUB RtlCompareMemory
GENERATE_ARM_STUB RtlCompareMemoryUlong
GENERATE_ARM_STUB RtlFillMemory
GENERATE_ARM_STUB RtlFillMemoryUlong
GENERATE_ARM_STUB RtlGetCallersAddress
GENERATE_ARM_STUB RtlMoveMemory
GENERATE_ARM_STUB RtlPrefetchMemoryNonTemporal
GENERATE_ARM_STUB RtlUlongByteSwap
GENERATE_ARM_STUB RtlUlonglongByteSwap
GENERATE_ARM_STUB RtlUnwind
GENERATE_ARM_STUB RtlUshortByteSwap
GENERATE_ARM_STUB RtlZeroMemory
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
GENERATE_ARM_STUB _abnormal_termination
GENERATE_ARM_STUB _alldiv
GENERATE_ARM_STUB _alldvrm
GENERATE_ARM_STUB _allmul
GENERATE_ARM_STUB _alloca_probe
GENERATE_ARM_STUB _allrem
GENERATE_ARM_STUB _allshl
GENERATE_ARM_STUB _allshr
GENERATE_ARM_STUB _aulldiv
GENERATE_ARM_STUB _aulldvrm
GENERATE_ARM_STUB _aullrem
GENERATE_ARM_STUB _aullshr
GENERATE_ARM_STUB _except_handler2
GENERATE_ARM_STUB _except_handler3
GENERATE_ARM_STUB _global_unwind2
GENERATE_ARM_STUB _local_unwind2
GENERATE_ARM_STUB KiSaveProcessorControlState
GENERATE_ARM_STUB KiInitializeUserApc
GENERATE_ARM_STUB KeDisableInterrupts
GENERATE_ARM_STUB KeContextToTrapFrame
GENERATE_ARM_STUB KiDispatchException
GENERATE_ARM_STUB KiSystemStartup
GENERATE_ARM_STUB NtSetLdtEntries
GENERATE_ARM_STUB NtRaiseException
GENERATE_ARM_STUB NtCallbackReturn
GENERATE_ARM_STUB NtContinue
GENERATE_ARM_STUB KiSwapProcess
GENERATE_ARM_STUB MmUpdatePageDir
GENERATE_ARM_STUB KeArmInitThreadWithContext
GENERATE_ARM_STUB MmGetPfnForProcess
GENERATE_ARM_STUB MmCreateVirtualMapping
GENERATE_ARM_STUB CmpInitializeMachineDependentConfiguration
GENERATE_ARM_STUB KeI386VdmInitialize
GENERATE_ARM_STUB KdDebuggerInitialize1
GENERATE_ARM_STUB MmSetDirtyPage
GENERATE_ARM_STUB MmSetCleanPage
GENERATE_ARM_STUB MmIsDirtyPage
GENERATE_ARM_STUB MmEnableVirtualMapping
GENERATE_ARM_STUB MmCreatePageFileMapping
GENERATE_ARM_STUB MmDeleteVirtualMapping
GENERATE_ARM_STUB MmDisableVirtualMapping
GENERATE_ARM_STUB MmIsPageSwapEntry
GENERATE_ARM_STUB MmSetPageProtect
GENERATE_ARM_STUB MmIsPagePresent
GENERATE_ARM_STUB MmCreateHyperspaceMapping
GENERATE_ARM_STUB MmDeleteHyperspaceMapping
GENERATE_ARM_STUB MmDeletePageFileMapping
GENERATE_ARM_STUB MmRawDeleteVirtualMapping
GENERATE_ARM_STUB MmCreateVirtualMappingUnsafe
GENERATE_ARM_STUB MmInitializeHandBuiltProcess
GENERATE_ARM_STUB MmCreateProcessAddressSpace
GENERATE_ARM_STUB Mmi386ReleaseMmInfo
GENERATE_ARM_STUB RtlCreateUserThread
GENERATE_ARM_STUB RtlInitializeContext
GENERATE_ARM_STUB RtlpGetExceptionAddress
GENERATE_ARM_STUB RtlDispatchException
GENERATE_ARM_STUB DebugService2
GENERATE_ARM_STUB DebugService
GENERATE_ARM_STUB KdPortPutByteEx
GENERATE_ARM_STUB KdPortInitializeEx
GENERATE_ARM_STUB KdpGdbStubInit
GENERATE_ARM_STUB KeSwitchKernelStack
GENERATE_ARM_STUB MiInitPageDirectoryMap
GENERATE_ARM_STUB MmGetPageDirectory
GENERATE_ARM_STUB MmInitGlobalKernelPageDirectory
GENERATE_ARM_STUB MmDeletePageTable
GENERATE_ARM_STUB MmGetPageProtect
GENERATE_ARM_STUB MmCreateVirtualMappingForKernel
GENERATE_ARM_STUB MiGetUserPageDirectoryCount
GENERATE_ARM_STUB RtlpGetStackLimits
GENERATE_ARM_STUB KiInitMachineDependent
GENERATE_ARM_STUB KiComputeTimerTableIndex
GENERATE_ARM_STUB _SEHCurrentRegistration
GENERATE_ARM_STUB _SEHUnregisterFrame
GENERATE_ARM_STUB _SEHRegisterFrame
GENERATE_ARM_STUB _SEHCleanHandlerEnvironment
GENERATE_ARM_STUB _SEHGlobalUnwind

View file

@ -2,7 +2,7 @@
<!DOCTYPE module SYSTEM "../tools/rbuild/project.dtd">
<module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe">
<bootstrap installbase="$(CDOUTPUT)" />
<importlibrary definition="ntoskrnl.def" />
<importlibrary definition="ntoskrnl_$(ARCH).def" />
<define name="_DISABLE_TIDENTS" />
<define name="__NTOSKRNL__" />
<define name="_NTOSKRNL_" />
@ -57,6 +57,12 @@
<file>v86m_sup.S</file>
</directory>
</if>
<if property="ARCH" value="arm">
<directory name="arm">
<file>stubs_asm.s</file>
<file>stubs.c</file>
</directory>
</if>
<if property="ARCH" value="powerpc">
<directory name="powerpc">
<file first="true">main_asm.S</file>

File diff suppressed because it is too large Load diff

View file

View file

@ -104,7 +104,7 @@
#define KernelModeStub_mips " j KiSystemService\n" \
" nop\n"
#define KernelModeStub_arm " ldr r12, =x%x\n" \
#define KernelModeStub_arm " ldr r12, =0x%x\n" \
" swi #0x2E\n" \
" bx lr\n\n"