mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOSKRNL] Fix compilation of some ARM assembler files
[NTDLL] Add missing ASM stubs for ARM svn path=/trunk/; revision=67715
This commit is contained in:
parent
845ec2108d
commit
6212c824eb
4 changed files with 164 additions and 142 deletions
|
@ -1,16 +1,31 @@
|
|||
#include "../../../../ntoskrnl/include/internal/arm/asmmacro.S"
|
||||
|
||||
//
|
||||
// Exceptions
|
||||
//
|
||||
GENERATE_ARM_STUB LdrInitializeThunk
|
||||
GENERATE_ARM_STUB RtlGetCallersAddress
|
||||
GENERATE_ARM_STUB RtlUnwind
|
||||
GENERATE_ARM_STUB RtlDispatchException
|
||||
GENERATE_ARM_STUB RtlpGetStackLimits
|
||||
GENERATE_ARM_STUB DbgUserBreakPoint
|
||||
GENERATE_ARM_STUB KiFastSystemCall
|
||||
GENERATE_ARM_STUB KiFastSystemCallRet
|
||||
GENERATE_ARM_STUB KiIntSystemCall
|
||||
GENERATE_ARM_STUB KiUserApcDispatcher
|
||||
GENERATE_ARM_STUB RtlInitializeContext
|
||||
#include <ksarm.h>
|
||||
|
||||
TEXTAREA
|
||||
|
||||
LEAF_ENTRY LdrInitializeThunk
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END LdrInitializeThunk
|
||||
|
||||
LEAF_ENTRY KiRaiseUserExceptionDispatcher
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KiRaiseUserExceptionDispatcher
|
||||
|
||||
LEAF_ENTRY KiUserApcDispatcher
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KiUserApcDispatcher
|
||||
|
||||
LEAF_ENTRY KiUserCallbackDispatcher
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KiUserCallbackDispatcher
|
||||
|
||||
LEAF_ENTRY KiUserExceptionDispatcher
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KiUserExceptionDispatcher
|
||||
|
||||
END
|
||||
|
|
|
@ -6,40 +6,47 @@
|
|||
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||
*/
|
||||
|
||||
.title "ARM Kernel Entry Point"
|
||||
.include "ntoskrnl/include/internal/arm/kxarm.h"
|
||||
.include "ntoskrnl/include/internal/arm/ksarm.h"
|
||||
#include <ksarm.h>
|
||||
|
||||
TEXTAREA
|
||||
|
||||
IMPORT KiInitializeSystem
|
||||
|
||||
NESTED_ENTRY KiSystemStartup
|
||||
PROLOG_END KiSystemStartup
|
||||
|
||||
|
||||
/* Put us in FIQ mode, set IRQ stack */
|
||||
b .
|
||||
mrs r3, cpsr
|
||||
orr r3, r1, #CPSR_FIQ_MODE
|
||||
msr cpsr, r3
|
||||
ldr sp, [a1, #LpbInterruptStack]
|
||||
|
||||
orr r3, r1, #CPSRM_FIQ
|
||||
//msr cpsr, r3
|
||||
msr cpsr_fc, r3
|
||||
ldr sp, [a1, #LpbKernelStack]
|
||||
|
||||
/* Repeat for IRQ mode */
|
||||
msr cpsr_c, #CPSR_IRQ_MODE
|
||||
ldr sp, [a1, #LpbInterruptStack]
|
||||
mov r3, #CPSRM_INT
|
||||
msr cpsr_c, r3
|
||||
ldr sp, [a1, #LpbKernelStack]
|
||||
|
||||
/* Put us in ABORT mode and set the panic stack */
|
||||
msr cpsr_c, #CPSR_ABORT_MODE
|
||||
ldr sp, [a1, #LpbPanicStack]
|
||||
|
||||
/* Repeat for UND (Undefined) mode */
|
||||
msr cpsr_c, #CPSR_UND_MODE
|
||||
ldr sp, [a1, #LpbPanicStack]
|
||||
|
||||
/* Put us into SVC (Supervisor) mode and set the kernel stack */
|
||||
msr cpsr_c, #CPSR_SVC_MODE
|
||||
mov r3, #CPSRM_ABT
|
||||
msr cpsr_c, r3
|
||||
ldr sp, [a1, #LpbKernelStack]
|
||||
|
||||
|
||||
/* Repeat for UDF (Undefined) mode */
|
||||
mov r3, #CPSRM_UDF
|
||||
msr cpsr_c, r3
|
||||
ldr sp, [a1, #LpbKernelStack]
|
||||
|
||||
/* Put us into SVC (Supervisor) mode and set the kernel stack */
|
||||
mov r3, #CPSRM_SVC
|
||||
msr cpsr_c, r3
|
||||
ldr sp, [a1, #LpbKernelStack]
|
||||
|
||||
/* Go to C code */
|
||||
b KiInitializeSystem
|
||||
|
||||
ENTRY_END KiSystemStartup
|
||||
|
||||
NESTED_END KiSystemStartup
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
|
|
@ -1,38 +1,18 @@
|
|||
#include <internal/arm/asmmacro.S>
|
||||
|
||||
//
|
||||
// Exceptions
|
||||
//
|
||||
GENERATE_ARM_STUB _abnormal_termination
|
||||
GENERATE_ARM_STUB _except_handler2
|
||||
GENERATE_ARM_STUB _except_handler3
|
||||
GENERATE_ARM_STUB _global_unwind2
|
||||
GENERATE_ARM_STUB _local_unwind2
|
||||
GENERATE_ARM_STUB RtlGetCallersAddress
|
||||
GENERATE_ARM_STUB RtlUnwind
|
||||
GENERATE_ARM_STUB RtlDispatchException
|
||||
GENERATE_ARM_STUB RtlpGetStackLimits
|
||||
GENERATE_ARM_STUB DbgBreakPointWithStatus
|
||||
GENERATE_ARM_STUB KeRaiseUserException
|
||||
GENERATE_ARM_STUB KdpGdbStubInit
|
||||
#include <ksarm.h>
|
||||
|
||||
//
|
||||
// Driver ISRs
|
||||
//
|
||||
GENERATE_ARM_STUB KeConnectInterrupt
|
||||
GENERATE_ARM_STUB KeDisconnectInterrupt
|
||||
GENERATE_ARM_STUB KiPassiveRelease
|
||||
GENERATE_ARM_STUB KiInterruptTemplate
|
||||
GENERATE_ARM_STUB KiUnexpectedInterrupt
|
||||
GENERATE_ARM_STUB KeInitializeInterrupt
|
||||
GENERATE_ARM_STUB KeSynchronizeExecution
|
||||
|
||||
//
|
||||
// User Mode Support
|
||||
//
|
||||
GENERATE_ARM_STUB KeSwitchKernelStack
|
||||
GENERATE_ARM_STUB RtlCreateUserThread
|
||||
GENERATE_ARM_STUB RtlInitializeContext
|
||||
GENERATE_ARM_STUB KeUserModeCallback
|
||||
GENERATE_ARM_STUB KiCallUserMode
|
||||
GENERATE_ARM_STUB NtCallbackReturn
|
||||
TEXTAREA
|
||||
|
||||
LEAF_ENTRY KeSwitchKernelStack
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KeSwitchKernelStack
|
||||
|
||||
LEAF_ENTRY KiPassiveRelease
|
||||
__assertfail
|
||||
bx lr
|
||||
LEAF_END KiPassiveRelease
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
|
|
@ -6,12 +6,18 @@
|
|||
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||
*/
|
||||
|
||||
.title "ARM Trap Dispatching and Handling"
|
||||
#include "ntoskrnl/include/internal/arm/kxarm.h"
|
||||
.include "ntoskrnl/include/internal/arm/ksarm.h"
|
||||
#include <ksarm.h>
|
||||
|
||||
.global KiArmVectorTable
|
||||
KiArmVectorTable:
|
||||
IMPORT KiUndefinedExceptionHandler
|
||||
IMPORT KiSoftwareInterruptHandler
|
||||
IMPORT KiPrefetchAbortHandler
|
||||
IMPORT KiDataAbortHandler
|
||||
IMPORT KiInterruptHandler
|
||||
|
||||
TEXTAREA
|
||||
|
||||
EXPORT KiArmVectorTable
|
||||
KiArmVectorTable
|
||||
b . // Reset
|
||||
ldr pc, _KiUndefinedInstructionJump // Undefined Instruction
|
||||
ldr pc, _KiSoftwareInterruptJump // Software Interrupt
|
||||
|
@ -20,117 +26,131 @@
|
|||
b . // Reserved
|
||||
ldr pc, _KiInterruptJump // Interrupt
|
||||
ldr pc, _KiFastInterruptJump // Fast Interrupt
|
||||
|
||||
_KiUndefinedInstructionJump: .word KiUndefinedInstructionException
|
||||
_KiSoftwareInterruptJump: .word KiSoftwareInterruptException
|
||||
_KiPrefetchAbortJump: .word KiPrefetchAbortException
|
||||
_KiDataAbortJump: .word KiDataAbortException
|
||||
_KiInterruptJump: .word KiInterruptException
|
||||
_KiFastInterruptJump: .word KiFastInterruptException
|
||||
|
||||
TEXTAREA
|
||||
|
||||
_KiUndefinedInstructionJump DCD KiUndefinedInstructionException
|
||||
_KiSoftwareInterruptJump DCD KiSoftwareInterruptException
|
||||
_KiPrefetchAbortJump DCD KiPrefetchAbortException
|
||||
_KiDataAbortJump DCD KiDataAbortException
|
||||
_KiInterruptJump DCD KiInterruptException
|
||||
_KiFastInterruptJump DCD KiFastInterruptException
|
||||
|
||||
// Might need to move these to a custom header, when used by HAL as well
|
||||
|
||||
MACRO
|
||||
TRAP_PROLOG $Abort
|
||||
__debugbreak
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
SYSCALL_PROLOG $Abort
|
||||
__debugbreak
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
TRAP_EPILOG $SystemCall
|
||||
__debugbreak
|
||||
MEND
|
||||
|
||||
NESTED_ENTRY KiUndefinedInstructionException
|
||||
PROLOG_END KiUndefinedInstructionException
|
||||
//
|
||||
// Handle trap entry
|
||||
//
|
||||
|
||||
/* Handle trap entry */
|
||||
TRAP_PROLOG 0 // NotFromAbort
|
||||
|
||||
//
|
||||
// Call the C handler
|
||||
//
|
||||
|
||||
/* Call the C handler */
|
||||
ldr lr, =KiExceptionExit
|
||||
mov r0, sp
|
||||
ldr pc, =KiUndefinedExceptionHandler
|
||||
ENTRY_END KiUndefinedInstructionException
|
||||
|
||||
|
||||
|
||||
NESTED_END KiUndefinedInstructionException
|
||||
|
||||
|
||||
NESTED_ENTRY KiSoftwareInterruptException
|
||||
PROLOG_END KiSoftwareInterruptException
|
||||
//
|
||||
// Handle trap entry
|
||||
//
|
||||
|
||||
/* Handle trap entry */
|
||||
SYSCALL_PROLOG
|
||||
|
||||
//
|
||||
// Call the C handler
|
||||
//
|
||||
|
||||
/* Call the C handler */
|
||||
ldr lr, =KiServiceExit
|
||||
mov r0, sp
|
||||
ldr pc, =KiSoftwareInterruptHandler
|
||||
ENTRY_END KiSoftwareInterruptException
|
||||
|
||||
NESTED_END KiSoftwareInterruptException
|
||||
|
||||
|
||||
NESTED_ENTRY KiPrefetchAbortException
|
||||
PROLOG_END KiPrefetchAbortException
|
||||
//
|
||||
// Handle trap entry
|
||||
//
|
||||
|
||||
/* Handle trap entry */
|
||||
TRAP_PROLOG 0 // NotFromAbort
|
||||
|
||||
//
|
||||
// Call the C handler
|
||||
//
|
||||
|
||||
/* Call the C handler */
|
||||
ldr lr, =KiExceptionExit
|
||||
mov r0, sp
|
||||
ldr pc, =KiPrefetchAbortHandler
|
||||
ENTRY_END KiPrefetchAbortException
|
||||
|
||||
NESTED_END KiPrefetchAbortException
|
||||
|
||||
|
||||
NESTED_ENTRY KiDataAbortException
|
||||
PROLOG_END KiDataAbortException
|
||||
//
|
||||
// Handle trap entry
|
||||
//
|
||||
|
||||
/* Handle trap entry */
|
||||
TRAP_PROLOG 1 // FromAbort
|
||||
|
||||
//
|
||||
// Call the C handler
|
||||
//
|
||||
|
||||
/* Call the C handler */
|
||||
ldr lr, =KiExceptionExit
|
||||
mov r0, sp
|
||||
ldr pc, =KiDataAbortHandler
|
||||
ENTRY_END KiDataAbortException
|
||||
|
||||
NESTED_END KiDataAbortException
|
||||
|
||||
|
||||
NESTED_ENTRY KiInterruptException
|
||||
PROLOG_END KiInterruptException
|
||||
//
|
||||
// Handle trap entry
|
||||
//
|
||||
|
||||
/* Handle trap entry */
|
||||
TRAP_PROLOG 0 // NotFromAbort
|
||||
|
||||
//
|
||||
// Call the C handler
|
||||
//
|
||||
|
||||
/* Call the C handler */
|
||||
ldr lr, =KiExceptionExit
|
||||
mov r0, sp
|
||||
mov r1, #0
|
||||
ldr pc, =KiInterruptHandler
|
||||
ENTRY_END KiInterruptException
|
||||
|
||||
NESTED_END KiInterruptException
|
||||
|
||||
|
||||
NESTED_ENTRY KiFastInterruptException
|
||||
PROLOG_END KiFastInterruptException
|
||||
//
|
||||
|
||||
// FIXME-PERF: Implement FIQ exception
|
||||
//
|
||||
b .
|
||||
ENTRY_END KiFastInterruptException
|
||||
|
||||
|
||||
__debugbreak
|
||||
|
||||
NESTED_END KiFastInterruptException
|
||||
|
||||
|
||||
NESTED_ENTRY KiExceptionExit
|
||||
PROLOG_END KiExceptionExit
|
||||
//
|
||||
// Handle trap exit
|
||||
//
|
||||
|
||||
/* Handle trap exit */
|
||||
TRAP_EPILOG 0 // NotFromSystemCall
|
||||
ENTRY_END KiExceptionExit
|
||||
|
||||
NESTED_END KiExceptionExit
|
||||
|
||||
NESTED_ENTRY KiServiceExit
|
||||
PROLOG_END KiServiceExit
|
||||
//
|
||||
// Handle trap exit
|
||||
//
|
||||
|
||||
/* Handle trap exit */
|
||||
TRAP_EPILOG 1 // FromSystemCall
|
||||
ENTRY_END KiServiceExit
|
||||
|
||||
NESTED_END KiServiceExit
|
||||
|
||||
|
||||
LEAF_ENTRY KiInterruptTemplate
|
||||
DCD 0
|
||||
LEAF_END KiInterruptTemplate
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue