mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[ARM]: Fix the ARM build, hopefully without breaking the x86 build in the process. Sorry buds!
svn path=/trunk/; revision=45368
This commit is contained in:
parent
6aa9cce4bb
commit
02c2d27111
15 changed files with 80 additions and 54 deletions
|
@ -111,17 +111,7 @@
|
||||||
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
|
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="hal">
|
<directory name="hal">
|
||||||
<directory name="halarm">
|
<xi:include href="hal/hal.rbuild" />
|
||||||
<directory name="generic">
|
|
||||||
<xi:include href="hal/halarm/generic/generic.rbuild" />
|
|
||||||
</directory>
|
|
||||||
<directory name="up">
|
|
||||||
<xi:include href="hal/halarm/up/halup.rbuild" />
|
|
||||||
</directory>
|
|
||||||
</directory>
|
|
||||||
<directory name="hal">
|
|
||||||
<xi:include href="hal/hal/hal.rbuild" />
|
|
||||||
</directory>
|
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="boot">
|
<directory name="boot">
|
||||||
<xi:include href="boot/boot.rbuild" />
|
<xi:include href="boot/boot.rbuild" />
|
||||||
|
|
|
@ -1016,7 +1016,7 @@ ArmSetupPagingAndJump(IN ULONG Magic)
|
||||||
//
|
//
|
||||||
// Jump to Kernel
|
// Jump to Kernel
|
||||||
//
|
//
|
||||||
(*KernelEntryPoint)(Magic, (PVOID)((ULONG_PTR)ArmLoaderBlock | KSEG0_BASE));
|
(*KernelEntryPoint)((PVOID)((ULONG_PTR)ArmLoaderBlock | KSEG0_BASE));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -24,6 +24,14 @@
|
||||||
#define READ_REGISTER_ULONG(r) (*((volatile ULONG * const)(r)))
|
#define READ_REGISTER_ULONG(r) (*((volatile ULONG * const)(r)))
|
||||||
#define WRITE_REGISTER_ULONG(r, v) (*((volatile ULONG *)(r)) = (v))
|
#define WRITE_REGISTER_ULONG(r, v) (*((volatile ULONG *)(r)) = (v))
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KeUpdateSystemTime(
|
||||||
|
IN PKTRAP_FRAME TrapFrame,
|
||||||
|
IN ULONG Increment,
|
||||||
|
IN KIRQL OldIrql
|
||||||
|
);
|
||||||
|
|
||||||
/* DATA **********************************************************************/
|
/* DATA **********************************************************************/
|
||||||
|
|
||||||
ULONG HalpCurrentTimeIncrement, HalpNextTimeIncrement, HalpNextIntervalCount;
|
ULONG HalpCurrentTimeIncrement, HalpNextTimeIncrement, HalpNextIntervalCount;
|
||||||
|
@ -256,9 +264,9 @@ HalAssignSlotResources(
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
HalBeginSystemInterrupt (KIRQL Irql,
|
HalBeginSystemInterrupt(IN KIRQL Irql,
|
||||||
ULONG Vector,
|
IN UCHAR Vector,
|
||||||
PKIRQL OldIrql)
|
OUT PKIRQL OldIrql)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
@ -278,8 +286,8 @@ HalCalibratePerformanceCounter(
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
HalDisableSystemInterrupt(ULONG Vector,
|
HalDisableSystemInterrupt(IN UCHAR Vector,
|
||||||
KIRQL Irql)
|
IN KIRQL Irql)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
@ -330,10 +338,9 @@ HalSetDisplayParameters(IN ULONG CursorPosX,
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
HalEnableSystemInterrupt(
|
HalEnableSystemInterrupt(IN UCHAR Vector,
|
||||||
ULONG Vector,
|
IN KIRQL Irql,
|
||||||
KIRQL Irql,
|
IN KINTERRUPT_MODE InterruptMode)
|
||||||
KINTERRUPT_MODE InterruptMode)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
@ -343,9 +350,8 @@ HalEnableSystemInterrupt(
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
HalEndSystemInterrupt(
|
HalEndSystemInterrupt(IN KIRQL OldIrql,
|
||||||
KIRQL Irql,
|
IN PKTRAP_FRAME TrapFrame)
|
||||||
ULONG Unknown2)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,6 +343,7 @@ typedef struct _KPRCB
|
||||||
ULONG KeDcacheFlushCount;
|
ULONG KeDcacheFlushCount;
|
||||||
ULONG KeExceptionDispatchCount;
|
ULONG KeExceptionDispatchCount;
|
||||||
ULONG KeFirstLevelTbFills;
|
ULONG KeFirstLevelTbFills;
|
||||||
|
ULONG KeFloatingEmulationCount;
|
||||||
ULONG KeIcacheFlushCount;
|
ULONG KeIcacheFlushCount;
|
||||||
ULONG KeSecondLevelTbFills;
|
ULONG KeSecondLevelTbFills;
|
||||||
ULONG KeSystemCalls;
|
ULONG KeSystemCalls;
|
||||||
|
|
|
@ -891,12 +891,7 @@ NtInitializeRegistry(IN USHORT Flag)
|
||||||
if (KeGetPreviousMode() == UserMode) return ZwInitializeRegistry(Flag);
|
if (KeGetPreviousMode() == UserMode) return ZwInitializeRegistry(Flag);
|
||||||
|
|
||||||
/* Enough of the system has booted by now */
|
/* Enough of the system has booted by now */
|
||||||
BootCyclesEnd = __rdtsc();
|
Ki386PerfEnd();
|
||||||
DPRINT1("Boot took %I64d cycles!\n", BootCyclesEnd - BootCycles);
|
|
||||||
DPRINT1("Interrupts: %d System Calls: %d Context Switches: %d\n",
|
|
||||||
KeGetCurrentPrcb()->InterruptCount,
|
|
||||||
KeGetCurrentPrcb()->KeSystemCalls,
|
|
||||||
KeGetContextSwitches(KeGetCurrentPrcb()));
|
|
||||||
|
|
||||||
/* Validate flag */
|
/* Validate flag */
|
||||||
if (Flag > CM_BOOT_FLAG_MAX) return STATUS_INVALID_PARAMETER;
|
if (Flag > CM_BOOT_FLAG_MAX) return STATUS_INVALID_PARAMETER;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "intrin_i.h"
|
#include "intrin_i.h"
|
||||||
|
|
||||||
|
#define KiServiceExit2 KiExceptionExit
|
||||||
|
|
||||||
//
|
//
|
||||||
//Lockdown TLB entries
|
//Lockdown TLB entries
|
||||||
//
|
//
|
||||||
|
@ -91,9 +93,13 @@ KiRundownThread(IN PKTHREAD Thread)
|
||||||
VOID
|
VOID
|
||||||
KiPassiveRelease(
|
KiPassiveRelease(
|
||||||
VOID
|
VOID
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KiSystemService(IN PKTHREAD Thread,
|
||||||
|
IN PKTRAP_FRAME TrapFrame,
|
||||||
|
IN ULONG Instruction);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
KiApcInterrupt(
|
KiApcInterrupt(
|
||||||
VOID
|
VOID
|
||||||
|
@ -113,7 +119,11 @@ KeFlushTb(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#define KiSystemStartupReal KiSystemStartup
|
#define Ki386PerfEnd()
|
||||||
|
#define KiEndInterrupt(x,y)
|
||||||
|
|
||||||
|
#define KiGetLinkedTrapFrame(x) \
|
||||||
|
(PKTRAP_FRAME)((x)->PreviousTrapFrame)
|
||||||
|
|
||||||
#define KiGetPreviousMode(tf) \
|
#define KiGetPreviousMode(tf) \
|
||||||
((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode
|
((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
#define KeGetTrapFramePc(TrapFrame) \
|
#define KeGetTrapFramePc(TrapFrame) \
|
||||||
((TrapFrame)->Eip)
|
((TrapFrame)->Eip)
|
||||||
|
|
||||||
|
#define KiGetLinkedTrapFrame(x) \
|
||||||
|
(PKTRAP_FRAME)((x)->Edx)
|
||||||
|
|
||||||
#define KeGetContextReturnRegister(Context) \
|
#define KeGetContextReturnRegister(Context) \
|
||||||
((Context)->Eax)
|
((Context)->Eax)
|
||||||
|
|
||||||
|
@ -451,7 +454,6 @@ extern UCHAR KiDebugRegisterContextOffsets[9];
|
||||||
extern VOID __cdecl KiTrap02(VOID);
|
extern VOID __cdecl KiTrap02(VOID);
|
||||||
extern VOID __cdecl KiTrap08(VOID);
|
extern VOID __cdecl KiTrap08(VOID);
|
||||||
extern VOID __cdecl KiTrap13(VOID);
|
extern VOID __cdecl KiTrap13(VOID);
|
||||||
extern VOID __cdecl KiInterruptTemplate(VOID);
|
|
||||||
extern VOID __cdecl KiFastCallEntry(VOID);
|
extern VOID __cdecl KiFastCallEntry(VOID);
|
||||||
extern VOID NTAPI ExpInterlockedPopEntrySListFault(VOID);
|
extern VOID NTAPI ExpInterlockedPopEntrySListFault(VOID);
|
||||||
extern VOID __cdecl CopyParams(VOID);
|
extern VOID __cdecl CopyParams(VOID);
|
||||||
|
@ -740,5 +742,38 @@ KiSwitchToBootStack(IN ULONG_PTR InitialStack)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normally this is done by the HAL, but on x86 as an optimization, the kernel
|
||||||
|
// initiates the end by calling back into the HAL and exiting the trap here.
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
FORCEINLINE
|
||||||
|
KiEndInterrupt(IN KIRQL Irql,
|
||||||
|
IN PKTRAP_FRAME TrapFrame)
|
||||||
|
{
|
||||||
|
/* Disable interrupts and end the interrupt */
|
||||||
|
_disable();
|
||||||
|
HalEndSystemInterrupt(Irql, TrapFrame);
|
||||||
|
|
||||||
|
/* Exit the interrupt */
|
||||||
|
KiEoiHelper(TrapFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// PERF Code
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
FORCEINLINE
|
||||||
|
Ki386PerfEnd(VOID)
|
||||||
|
{
|
||||||
|
extern ULONGLONG BootCyclesEnd, BootCycles;
|
||||||
|
BootCyclesEnd = __rdtsc();
|
||||||
|
DbgPrint("Boot took %I64d cycles!\n", BootCyclesEnd - BootCycles);
|
||||||
|
DbgPrint("Interrupts: %d System Calls: %d Context Switches: %d\n",
|
||||||
|
KeGetCurrentPrcb()->InterruptCount,
|
||||||
|
KeGetCurrentPrcb()->KeSystemCalls,
|
||||||
|
KeGetContextSwitches(KeGetCurrentPrcb()));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */
|
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */
|
||||||
|
|
|
@ -140,6 +140,7 @@ extern ULONG KiDPCTimeout;
|
||||||
extern PGDI_BATCHFLUSH_ROUTINE KeGdiFlushUserBatch;
|
extern PGDI_BATCHFLUSH_ROUTINE KeGdiFlushUserBatch;
|
||||||
extern ULONGLONG BootCycles, BootCyclesEnd;
|
extern ULONGLONG BootCycles, BootCyclesEnd;
|
||||||
extern ULONG ProcessCount;
|
extern ULONG ProcessCount;
|
||||||
|
extern VOID __cdecl KiInterruptTemplate(VOID);
|
||||||
|
|
||||||
/* MACROS *************************************************************************/
|
/* MACROS *************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ KINTERRUPT KxUnexpectedInterrupt;
|
||||||
BOOLEAN KeIsArmV6;
|
BOOLEAN KeIsArmV6;
|
||||||
ULONG KeNumberProcessIds;
|
ULONG KeNumberProcessIds;
|
||||||
ULONG KeNumberTbEntries;
|
ULONG KeNumberTbEntries;
|
||||||
|
ULONG ProcessCount; // PERF
|
||||||
extern PVOID KiArmVectorTable;
|
extern PVOID KiArmVectorTable;
|
||||||
#define __ARMV6__ KeIsArmV6
|
#define __ARMV6__ KeIsArmV6
|
||||||
|
|
||||||
|
@ -114,7 +115,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
|
||||||
//
|
//
|
||||||
// Copy the template code
|
// Copy the template code
|
||||||
//
|
//
|
||||||
KxUnexpectedInterrupt.DispatchCode[i] = KiInterruptTemplate[i];
|
KxUnexpectedInterrupt.DispatchCode[i] = ((PULONG)KiInterruptTemplate)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -15,7 +15,6 @@ GENERATE_ARM_STUB RtlpGetStackLimits
|
||||||
GENERATE_ARM_STUB DbgBreakPointWithStatus
|
GENERATE_ARM_STUB DbgBreakPointWithStatus
|
||||||
GENERATE_ARM_STUB KeRaiseUserException
|
GENERATE_ARM_STUB KeRaiseUserException
|
||||||
GENERATE_ARM_STUB KdpGdbStubInit
|
GENERATE_ARM_STUB KdpGdbStubInit
|
||||||
GENERATE_ARM_STUB NtRaiseException
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver ISRs
|
// Driver ISRs
|
||||||
|
@ -37,4 +36,3 @@ GENERATE_ARM_STUB RtlInitializeContext
|
||||||
GENERATE_ARM_STUB KeUserModeCallback
|
GENERATE_ARM_STUB KeUserModeCallback
|
||||||
GENERATE_ARM_STUB KiCallUserMode
|
GENERATE_ARM_STUB KiCallUserMode
|
||||||
GENERATE_ARM_STUB NtCallbackReturn
|
GENERATE_ARM_STUB NtCallbackReturn
|
||||||
GENERATE_ARM_STUB NtContinue
|
|
||||||
|
|
|
@ -127,7 +127,6 @@
|
||||||
TRAP_EPILOG 0 // NotFromSystemCall
|
TRAP_EPILOG 0 // NotFromSystemCall
|
||||||
ENTRY_END KiExceptionExit
|
ENTRY_END KiExceptionExit
|
||||||
|
|
||||||
|
|
||||||
NESTED_ENTRY KiServiceExit
|
NESTED_ENTRY KiServiceExit
|
||||||
PROLOG_END KiServiceExit
|
PROLOG_END KiServiceExit
|
||||||
//
|
//
|
||||||
|
|
|
@ -180,10 +180,12 @@ NtRaiseException(IN PEXCEPTION_RECORD ExceptionRecord,
|
||||||
/* Get trap frame and link previous one*/
|
/* Get trap frame and link previous one*/
|
||||||
Thread = KeGetCurrentThread();
|
Thread = KeGetCurrentThread();
|
||||||
TrapFrame = Thread->TrapFrame;
|
TrapFrame = Thread->TrapFrame;
|
||||||
Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
|
Thread->TrapFrame = KiGetLinkedTrapFrame(TrapFrame);
|
||||||
|
|
||||||
/* Set exception list */
|
/* Set exception list */
|
||||||
|
#ifdef _M_IX86
|
||||||
KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList;
|
KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Raise the exception */
|
/* Raise the exception */
|
||||||
Status = KiRaiseException(ExceptionRecord,
|
Status = KiRaiseException(ExceptionRecord,
|
||||||
|
@ -218,7 +220,7 @@ NtContinue(IN PCONTEXT Context,
|
||||||
/* Get trap frame and link previous one*/
|
/* Get trap frame and link previous one*/
|
||||||
Thread = KeGetCurrentThread();
|
Thread = KeGetCurrentThread();
|
||||||
TrapFrame = Thread->TrapFrame;
|
TrapFrame = Thread->TrapFrame;
|
||||||
Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
|
Thread->TrapFrame = KiGetLinkedTrapFrame(TrapFrame);
|
||||||
|
|
||||||
/* Continue from this point on */
|
/* Continue from this point on */
|
||||||
Status = KiContinue(Context, NULL, TrapFrame);
|
Status = KiContinue(Context, NULL, TrapFrame);
|
||||||
|
|
|
@ -113,11 +113,7 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable interrupts and end the interrupt */
|
/* Disable interrupts and end the interrupt */
|
||||||
_disable();
|
KiEndInterrupt(Irql, TrapFrame);
|
||||||
HalEndSystemInterrupt(Irql, TrapFrame);
|
|
||||||
|
|
||||||
/* Exit the interrupt */
|
|
||||||
KiEoiHelper(TrapFrame);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -57,6 +57,7 @@ PVOID MmSystemRangeStart;
|
||||||
PVOID MmSystemCacheStart;
|
PVOID MmSystemCacheStart;
|
||||||
PVOID MmSystemCacheEnd;
|
PVOID MmSystemCacheEnd;
|
||||||
MMSUPPORT MmSystemCacheWs;
|
MMSUPPORT MmSystemCacheWs;
|
||||||
|
PVOID MmHyperSpaceEnd;
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS **********************************************************/
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
|
|
|
@ -845,16 +845,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
||||||
PspRunCreateProcessNotifyRoutines(Process, TRUE);
|
PspRunCreateProcessNotifyRoutines(Process, TRUE);
|
||||||
|
|
||||||
/* If 12 processes have been created, enough of user-mode is ready */
|
/* If 12 processes have been created, enough of user-mode is ready */
|
||||||
if (++ProcessCount == 12)
|
if (++ProcessCount == 12) Ki386PerfEnd();
|
||||||
{
|
|
||||||
/* Enough of the system has booted by now */
|
|
||||||
BootCyclesEnd = __rdtsc();
|
|
||||||
DPRINT1("User Boot took %I64d cycles!\n", BootCyclesEnd - BootCycles);
|
|
||||||
DPRINT1("Interrupts: %d System Calls: %d Context Switches: %d\n",
|
|
||||||
KeGetCurrentPrcb()->InterruptCount,
|
|
||||||
KeGetCurrentPrcb()->KeSystemCalls,
|
|
||||||
KeGetContextSwitches(KeGetCurrentPrcb()));
|
|
||||||
}
|
|
||||||
|
|
||||||
CleanupWithRef:
|
CleanupWithRef:
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue