mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 10:45:24 +00:00
[AMD64]
Switch from underscore prefixed symbols to unprefixed symbols. (MSVC compatibility) svn path=/branches/ros-amd64-bringup/; revision=45410
This commit is contained in:
parent
cb076d0fef
commit
28c8b7fbec
|
@ -34,6 +34,7 @@
|
|||
<!-- compilerflag compiler="as">-gstabs+</compilerflag -->
|
||||
<compilerflag>-U_X86_</compilerflag>
|
||||
<compilerflag>-Wno-format</compilerflag>
|
||||
<compilerflag>-fno-leading-underscore</compilerflag>
|
||||
</group>
|
||||
|
||||
<group linkerset="ld">
|
||||
|
@ -42,6 +43,8 @@
|
|||
<linkerflag>-section-alignment=0x1000</linkerflag>
|
||||
<linkerflag>--unique=.eh_frame</linkerflag>
|
||||
<linkerflag>-static</linkerflag>
|
||||
<linkerflag>-fno-leading-underscore</linkerflag>
|
||||
<linkerflag>--exclude-all-symbols</linkerflag>
|
||||
</group>
|
||||
|
||||
<if property="USERMODE" value="1">
|
||||
|
|
|
@ -21,22 +21,22 @@ RealEntryPoint:
|
|||
mov ss, ax
|
||||
|
||||
/* checkPoint Charlie - where it all began... */
|
||||
mov si, offset _CheckPoint0
|
||||
mov si, offset CheckPoint0
|
||||
call writestr
|
||||
|
||||
|
||||
/* Setup a real mode stack */
|
||||
mov sp, stack16
|
||||
|
||||
/* Zero BootDrive and BootPartition */
|
||||
xor eax, eax
|
||||
mov _BootDrive, eax
|
||||
mov _BootPartition, eax
|
||||
mov BootDrive, eax
|
||||
mov BootPartition, eax
|
||||
|
||||
/* Store the boot drive */
|
||||
mov _BootDrive, dl
|
||||
mov BootDrive, dl
|
||||
|
||||
/* Store the boot partition */
|
||||
mov _BootPartition, dh
|
||||
mov BootPartition, dh
|
||||
|
||||
/* Load the GDT */
|
||||
lgdt gdtptr
|
||||
|
@ -46,13 +46,13 @@ RealEntryPoint:
|
|||
call x86_16_EnableA20
|
||||
|
||||
/* checkPoint Charlie - where it all began... */
|
||||
mov si, offset _CheckPoint1
|
||||
mov si, offset CheckPoint1
|
||||
call writestr
|
||||
|
||||
call x86_16_BuildPageTables
|
||||
|
||||
/* checkPoint Charlie - where it all began... */
|
||||
mov si, offset _CheckPoint2
|
||||
mov si, offset CheckPoint2
|
||||
call writestr
|
||||
|
||||
/* Check if CPU supports CPUID */
|
||||
|
@ -89,26 +89,26 @@ RealEntryPoint:
|
|||
/* X64 Processor */
|
||||
|
||||
/* checkPoint Charlie - where it all began... */
|
||||
mov si, offset _CheckPoint3
|
||||
mov si, offset CheckPoint3
|
||||
call writestr
|
||||
|
||||
jmp _switch64
|
||||
jmp switch64
|
||||
|
||||
NO_X64_SUPPORT_DETECTED:
|
||||
mov si, offset _NotAnX64Processor // Loading message
|
||||
mov si, offset NotAnX64Processor // Loading message
|
||||
call writestr
|
||||
jmp _fail
|
||||
jmp fail
|
||||
|
||||
NO_CPUID_SUPPORT_DETECTED:
|
||||
mov si, offset _NoCPUIDSupport // Loading message
|
||||
call writestr
|
||||
mov si, offset NoCPUIDSupport // Loading message
|
||||
call writestr
|
||||
|
||||
_fail:
|
||||
jmp _fail
|
||||
fail:
|
||||
jmp fail
|
||||
nop
|
||||
nop
|
||||
|
||||
_switch64:
|
||||
switch64:
|
||||
call x86_16_SwitchToLong
|
||||
|
||||
.code64
|
||||
|
@ -119,7 +119,7 @@ _switch64:
|
|||
|
||||
/* GO! */
|
||||
xor rcx, rcx
|
||||
call _BootMain
|
||||
call BootMain
|
||||
|
||||
/* Checkpoint */
|
||||
// mov ax, LMODE_DS
|
||||
|
@ -174,14 +174,14 @@ x86_16_BuildPageTables:
|
|||
push es
|
||||
|
||||
/* Get segment of pml4 */
|
||||
mov eax, offset _pml4_startup
|
||||
mov eax, offset pml4_startup
|
||||
shr eax, 4
|
||||
mov es, ax
|
||||
cld
|
||||
xor di, di
|
||||
|
||||
/* One entry in the PML4 pointing to PDP */
|
||||
mov eax, offset _pdp_startup
|
||||
mov eax, offset pdp_startup
|
||||
or eax, 0x00f
|
||||
stosd
|
||||
/* clear rest */
|
||||
|
@ -190,7 +190,7 @@ x86_16_BuildPageTables:
|
|||
rep stosd
|
||||
|
||||
/* One entry in the PDP pointing to PD */
|
||||
mov eax, offset _pd_startup
|
||||
mov eax, offset pd_startup
|
||||
or eax, 0x00f
|
||||
stosd
|
||||
/* clear rest */
|
||||
|
@ -268,7 +268,7 @@ x86_16_SwitchToLong:
|
|||
mov eax, 0x00a0 // Set PAE and PGE: 10100000b
|
||||
mov cr4, eax
|
||||
|
||||
mov edx, offset _pml4_startup // Point cr3 at PML4
|
||||
mov edx, offset pml4_startup // Point cr3 at PML4
|
||||
mov cr3, edx
|
||||
|
||||
mov ecx, 0xC0000080 // Specify EFER MSR
|
||||
|
@ -405,42 +405,42 @@ gdtptr:
|
|||
.long gdt /* Base Address */
|
||||
|
||||
|
||||
.global _BootDrive
|
||||
_BootDrive:
|
||||
.global BootDrive
|
||||
BootDrive:
|
||||
.long 0
|
||||
|
||||
.global _BootPartition
|
||||
_BootPartition:
|
||||
.global BootPartition
|
||||
BootPartition:
|
||||
.long 0
|
||||
|
||||
.global _NotAnX64Processor
|
||||
_NotAnX64Processor:
|
||||
.global NotAnX64Processor
|
||||
NotAnX64Processor:
|
||||
.ascii "FreeLoader: No x64-compatible CPU detected! Exiting..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
.global _NoCPUIDSupport
|
||||
_NoCPUIDSupport:
|
||||
.global NoCPUIDSupport
|
||||
NoCPUIDSupport:
|
||||
.ascii "FreeLoader: No CPUID instruction support detected! Exiting..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
/////////////////////////// Checkpoint messages ///////////////////////////////
|
||||
.global _CheckPoint0
|
||||
_CheckPoint0:
|
||||
.global CheckPoint0
|
||||
CheckPoint0:
|
||||
.ascii "Starting FreeLoader..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
.global _CheckPoint1
|
||||
_CheckPoint1:
|
||||
.global CheckPoint1
|
||||
CheckPoint1:
|
||||
.ascii "FreeLoader[16-bit]: building page tables..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
.global _CheckPoint2
|
||||
_CheckPoint2:
|
||||
.global CheckPoint2
|
||||
CheckPoint2:
|
||||
.ascii "FreeLoader[16-bit]: checking CPU for x64 long mode..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
.global _CheckPoint3
|
||||
_CheckPoint3:
|
||||
.global CheckPoint3
|
||||
CheckPoint3:
|
||||
.ascii "FreeLoader: Switching to x64 long mode..."
|
||||
.byte 0x0d, 0x0a, 0
|
||||
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
#include <arch.h>
|
||||
|
||||
|
||||
EXTERN(_ChainLoadBiosBootSectorCode)
|
||||
EXTERN(ChainLoadBiosBootSectorCode)
|
||||
.code64
|
||||
|
||||
call x86_64_SwitchToReal
|
||||
.code16
|
||||
|
||||
/* Set the boot drive */
|
||||
mov dl, _BootDrive
|
||||
mov dl, BootDrive
|
||||
|
||||
/* Load segment registers */
|
||||
cli
|
||||
|
@ -46,7 +46,7 @@ EXTERN(_ChainLoadBiosBootSectorCode)
|
|||
// ljmpl $0x0000,$0x7C00
|
||||
jmp 0x7c00:0x0000
|
||||
|
||||
EXTERN(_SoftReboot)
|
||||
EXTERN(SoftReboot)
|
||||
.code64
|
||||
|
||||
call x86_64_SwitchToReal
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <arch.h>
|
||||
|
||||
|
||||
EXTERN(_DriveMapInt13HandlerStart)
|
||||
EXTERN(DriveMapInt13HandlerStart)
|
||||
Int13Handler:
|
||||
|
||||
pushw %bp
|
||||
|
@ -82,7 +82,7 @@ CallOldInt13Handler:
|
|||
|
||||
/* Call old int 13h handler with new drive number */
|
||||
.byte 0x9a /* lcall */
|
||||
EXTERN(_DriveMapOldInt13HandlerAddress)
|
||||
EXTERN(DriveMapOldInt13HandlerAddress)
|
||||
.word 0
|
||||
.word 0
|
||||
|
||||
|
@ -105,7 +105,7 @@ CallersFlags:
|
|||
PassedInDriveNumber:
|
||||
.byte 0
|
||||
|
||||
EXTERN(_DriveMapInt13HandlerMapList)
|
||||
EXTERN(DriveMapInt13HandlerMapList)
|
||||
Int13HandlerMapCount:
|
||||
.byte 0
|
||||
|
||||
|
@ -129,4 +129,4 @@ Int13HandlerDrive4:
|
|||
Int13HandlerDriveNew4:
|
||||
.byte 0
|
||||
|
||||
EXTERN(_DriveMapInt13HandlerEnd)
|
||||
EXTERN(DriveMapInt13HandlerEnd)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* 0x00000400: Found 80486 CPU without CPUID support
|
||||
*/
|
||||
|
||||
EXTERN(_CpuidSupported)
|
||||
EXTERN(CpuidSupported)
|
||||
.code32
|
||||
|
||||
pushl %ecx /* save ECX */
|
||||
|
@ -80,7 +80,7 @@ NoCpuid:
|
|||
* VOID GetCpuid(U32 Level, U32 *eax, U32 *ebx, U32 *ecx, U32 *edx);
|
||||
*/
|
||||
|
||||
EXTERN(_GetCpuid)
|
||||
EXTERN(GetCpuid)
|
||||
.code32
|
||||
|
||||
pushl %ebp
|
||||
|
@ -123,7 +123,7 @@ EXTERN(_GetCpuid)
|
|||
* U64 RDTSC(VOID);
|
||||
*/
|
||||
|
||||
EXTERN(_RDTSC)
|
||||
EXTERN(RDTSC)
|
||||
.code32
|
||||
rdtsc
|
||||
ret
|
||||
|
|
|
@ -35,7 +35,7 @@ _pnp_bios_entry_point:
|
|||
_pnp_bios_data_segment:
|
||||
.word 0
|
||||
|
||||
EXTERN(_PnpBiosSupported)
|
||||
EXTERN(PnpBiosSupported)
|
||||
.code64
|
||||
|
||||
push rdi
|
||||
|
@ -113,7 +113,7 @@ _pnp_node_size:
|
|||
_pnp_node_count:
|
||||
.word 0
|
||||
|
||||
EXTERN(_PnpBiosGetDeviceNodeCount)
|
||||
EXTERN(PnpBiosGetDeviceNodeCount)
|
||||
.code64
|
||||
|
||||
push rbp
|
||||
|
@ -182,7 +182,7 @@ _pnp_buffer_offset:
|
|||
_pnp_node_number:
|
||||
.byte 0
|
||||
|
||||
EXTERN(_PnpBiosGetDeviceNode)
|
||||
EXTERN(PnpBiosGetDeviceNode)
|
||||
.code64
|
||||
|
||||
push rbp
|
||||
|
|
|
@ -273,7 +273,7 @@ i386CommonExceptionHandler:
|
|||
SAVE_CPU_REGS
|
||||
|
||||
pushl $SCREEN_ATTR
|
||||
call _MachVideoClearScreen
|
||||
call MachVideoClearScreen
|
||||
add $4,%esp
|
||||
|
||||
movl $i386ExceptionHandlerText,%esi
|
||||
|
@ -485,7 +485,7 @@ i386PrintChar:
|
|||
pushl $SCREEN_ATTR
|
||||
andl $0xff,%eax
|
||||
pushl %eax
|
||||
call _MachVideoPutChar
|
||||
call MachVideoPutChar
|
||||
addl $16,%esp
|
||||
|
||||
ret
|
||||
|
|
|
@ -63,7 +63,7 @@ Int386_regsout:
|
|||
/*
|
||||
* int Int386(int ivec, REGS* in, REGS* out);
|
||||
*/
|
||||
EXTERN(_Int386)
|
||||
EXTERN(Int386)
|
||||
.code64
|
||||
|
||||
/* Get the function parameters */
|
||||
|
|
|
@ -29,35 +29,35 @@
|
|||
* This boots the kernel
|
||||
*/
|
||||
.code64
|
||||
.globl _PageDirectoryStart
|
||||
.globl PageDirectoryStart
|
||||
|
||||
.globl _pml4_startup
|
||||
.globl _pdp_startup
|
||||
.globl _pd_startup
|
||||
.globl pml4_startup
|
||||
.globl pdp_startup
|
||||
.globl pd_startup
|
||||
|
||||
.globl _PageDirectoryEnd
|
||||
.globl PageDirectoryEnd
|
||||
|
||||
//
|
||||
// Boot information structure
|
||||
//
|
||||
|
||||
EXTERN(_reactos_memory_map_descriptor_size)
|
||||
EXTERN(reactos_memory_map_descriptor_size)
|
||||
.long 0
|
||||
|
||||
EXTERN(_reactos_memory_map)
|
||||
EXTERN(reactos_memory_map)
|
||||
.rept (32 * /*sizeof(memory_map_t)*/24)
|
||||
.byte 0
|
||||
.endr
|
||||
|
||||
.bss
|
||||
_PageDirectoryStart:
|
||||
_pml4_startup:
|
||||
PageDirectoryStart:
|
||||
pml4_startup:
|
||||
.fill 4096, 1, 0
|
||||
|
||||
_pdp_startup:
|
||||
pdp_startup:
|
||||
.fill 4096, 1, 0
|
||||
|
||||
_pd_startup:
|
||||
pd_startup:
|
||||
.fill 4096, 1, 0
|
||||
|
||||
_PageDirectoryEnd:
|
||||
PageDirectoryEnd:
|
||||
|
|
|
@ -7,65 +7,40 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <asm.h>
|
||||
#include <internal/i386/asmmacro.S>
|
||||
.intel_syntax noprefix
|
||||
|
||||
.macro UNIMPLEMENTED func
|
||||
jmp 2f
|
||||
1:
|
||||
.ascii "Sorry, asm function "
|
||||
.ascii func
|
||||
.ascii " is unimplemented!\n\0"
|
||||
2:
|
||||
movabs rcx, offset 1b
|
||||
call _DbgPrint
|
||||
ret
|
||||
.endm
|
||||
|
||||
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
.global _HalEnableInterrupt
|
||||
.func _HalEnableInterrupt
|
||||
_HalEnableInterrupt:
|
||||
UNIMPLEMENTED "HalEnableInterrupt"
|
||||
.endfunc
|
||||
PUBLIC HalEnableInterrupt
|
||||
HalEnableInterrupt:
|
||||
UNIMPLEMENTED HalEnableInterrupt
|
||||
ret
|
||||
|
||||
.global _HalDisableInterrupt
|
||||
.func _HalDisableInterrupt
|
||||
_HalDisableInterrupt:
|
||||
UNIMPLEMENTED "HalDisableInterrupt"
|
||||
.endfunc
|
||||
PUBLIC HalDisableInterrupt
|
||||
HalDisableInterrupt:
|
||||
UNIMPLEMENTED HalDisableInterrupt
|
||||
ret
|
||||
|
||||
.global _HalRequestSoftwareInterrupt
|
||||
.func _HalRequestSoftwareInterrupt
|
||||
_HalRequestSoftwareInterrupt:
|
||||
UNIMPLEMENTED "HalRequestSoftwareInterrupt"
|
||||
.endfunc
|
||||
PUBLIC HalRequestSoftwareInterrupt
|
||||
HalRequestSoftwareInterrupt:
|
||||
UNIMPLEMENTED HalRequestSoftwareInterrupt
|
||||
ret
|
||||
|
||||
.global _HalSendSoftwareInterrupt
|
||||
.func _HalSendSoftwareInterrupt
|
||||
_HalSendSoftwareInterrupt:
|
||||
UNIMPLEMENTED "HalSendSoftwareInterrupt"
|
||||
.endfunc
|
||||
PUBLIC HalSendSoftwareInterrupt
|
||||
HalSendSoftwareInterrupt:
|
||||
UNIMPLEMENTED HalSendSoftwareInterrupt
|
||||
ret
|
||||
|
||||
.global _HalEndSystemInterrupt
|
||||
.func _HalEndSystemInterrupt
|
||||
_HalEndSystemInterrupt:
|
||||
UNIMPLEMENTED "HalEndSystemInterrupt"
|
||||
.endfunc
|
||||
PUBLIC HalEndSystemInterrupt
|
||||
HalEndSystemInterrupt:
|
||||
UNIMPLEMENTED HalEndSystemInterrupt
|
||||
ret
|
||||
|
||||
|
||||
.globl _HalClearSoftwareInterrupt
|
||||
.func _HalClearSoftwareInterrupt
|
||||
_HalClearSoftwareInterrupt:
|
||||
UNIMPLEMENTED "HalClearSoftwareInterrupt"
|
||||
PUBLIC HalClearSoftwareInterrupt
|
||||
HalClearSoftwareInterrupt:
|
||||
UNIMPLEMENTED HalClearSoftwareInterrupt
|
||||
|
||||
/* Get IRR mask */
|
||||
mov eax, 1
|
||||
|
@ -75,11 +50,8 @@ _HalClearSoftwareInterrupt:
|
|||
/* Set IRR */
|
||||
// and gs:[KPCR_IRR], eax
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
.globl _HalBeginSystemInterrupt
|
||||
.func _HalBeginSystemInterrupt
|
||||
_HalBeginSystemInterrupt:
|
||||
UNIMPLEMENTED "HalBeginSystemInterrupt"
|
||||
.endfunc
|
||||
|
||||
PUBLIC HalBeginSystemInterrupt
|
||||
HalBeginSystemInterrupt:
|
||||
UNIMPLEMENTED HalBeginSystemInterrupt
|
||||
ret
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
|
@ -24,22 +24,16 @@ _MsgUnimplemented:
|
|||
.text
|
||||
.code64
|
||||
|
||||
.global _HalpCalibrateStallExecution@0
|
||||
.func HalpCalibrateStallExecution@0
|
||||
_HalpCalibrateStallExecution@0:
|
||||
|
||||
.endfunc
|
||||
|
||||
.globl _HalpProfileInterrupt
|
||||
.func HalpProfileInterrupt
|
||||
_HalpProfileInterrupt:
|
||||
|
||||
.endfunc
|
||||
PUBLIC HalpCalibrateStallExecution@0
|
||||
HalpCalibrateStallExecution@0:
|
||||
|
||||
|
||||
.globl _KeStallExecutionProcessor
|
||||
.func KeStallExecutionProcessor
|
||||
_KeStallExecutionProcessor:
|
||||
PUBLIC HalpProfileInterrupt
|
||||
HalpProfileInterrupt:
|
||||
|
||||
|
||||
PUBLIC KeStallExecutionProcessor
|
||||
KeStallExecutionProcessor:
|
||||
|
||||
/* Get the number of microseconds required */
|
||||
jecxz Done
|
||||
|
@ -65,12 +59,10 @@ SubtractLoop:
|
|||
Done:
|
||||
/* Return */
|
||||
ret 4
|
||||
.endfunc
|
||||
|
||||
|
||||
.globl _HalpQuery8254Counter
|
||||
.func HalpQuery8254Counter
|
||||
_HalpQuery8254Counter:
|
||||
PUBLIC HalpQuery8254Counter
|
||||
HalpQuery8254Counter:
|
||||
|
||||
/* Save EFLAGS and disable interrupts */
|
||||
pushfq
|
||||
|
@ -92,12 +84,9 @@ _HalpQuery8254Counter:
|
|||
mov eax, ecx
|
||||
popfq
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
.globl _HalpClockInterrupt
|
||||
.func HalpClockInterrupt
|
||||
_HalpClockInterrupt:
|
||||
PUBLIC HalpClockInterrupt
|
||||
HalpClockInterrupt:
|
||||
UNIMPLEMENTED _HalpClockInterrupt
|
||||
iret
|
||||
.endfunc
|
||||
|
||||
|
|
|
@ -8,84 +8,85 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ndk/asm.h>
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
#define BEFORE \
|
||||
cld; \
|
||||
pushq %rax; \
|
||||
pushq %rbx; \
|
||||
pushq %rcx; \
|
||||
pushq %rdx; \
|
||||
pushq %rsi; \
|
||||
pushq %rdi; \
|
||||
pushq %fs; \
|
||||
pushq %gs; \
|
||||
push rax; \
|
||||
push rbx; \
|
||||
push rcx; \
|
||||
push rdx; \
|
||||
push rsi; \
|
||||
push rdi; \
|
||||
push fs; \
|
||||
push gs; \
|
||||
|
||||
#define AFTER \
|
||||
popq %gs; \
|
||||
popq %fs; \
|
||||
popq %rdi; \
|
||||
popq %rsi; \
|
||||
popq %rdx; \
|
||||
popq %rcx; \
|
||||
popq %rbx; \
|
||||
popq %rax; \
|
||||
pop gs; \
|
||||
pop fs; \
|
||||
pop rdi; \
|
||||
pop rsi; \
|
||||
pop rdx; \
|
||||
pop rcx; \
|
||||
pop rbx; \
|
||||
pop rax; \
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
.global _MpsIpiInterrupt
|
||||
_MpsIpiInterrupt:
|
||||
PUBLIC MpsIpiInterrupt
|
||||
MpsIpiInterrupt:
|
||||
/* Save registers */
|
||||
BEFORE
|
||||
|
||||
/* Call the C handler */
|
||||
call _MpsIpiHandler
|
||||
call MpsIpiHandler
|
||||
|
||||
/* Return to the caller */
|
||||
AFTER
|
||||
iret
|
||||
#endif
|
||||
|
||||
.globl _MpsErrorInterrupt
|
||||
_MpsErrorInterrupt:
|
||||
PUBLIC MpsErrorInterrupt
|
||||
MpsErrorInterrupt:
|
||||
/* Save registers */
|
||||
BEFORE
|
||||
|
||||
/* Call the C handler */
|
||||
call _MpsErrorHandler
|
||||
call MpsErrorHandler
|
||||
|
||||
/* Return to the caller */
|
||||
AFTER
|
||||
iret
|
||||
|
||||
|
||||
.globl _MpsSpuriousInterrupt
|
||||
_MpsSpuriousInterrupt:
|
||||
PUBLIC MpsSpuriousInterrupt
|
||||
MpsSpuriousInterrupt:
|
||||
/* Save registers */
|
||||
BEFORE
|
||||
|
||||
/* Call the C handler */
|
||||
call _MpsSpuriousHandler
|
||||
call MpsSpuriousHandler
|
||||
|
||||
/* Return to the caller */
|
||||
AFTER
|
||||
iret
|
||||
|
||||
.global _MpsTimerInterrupt
|
||||
_MpsTimerInterrupt:
|
||||
PUBLIC MpsTimerInterrupt
|
||||
MpsTimerInterrupt:
|
||||
/* Save registers */
|
||||
BEFORE
|
||||
|
||||
movl $0xef,%ebx
|
||||
movl $0xceafbeef,%eax
|
||||
pushq %rax
|
||||
pushq %rsp
|
||||
pushq %rbx
|
||||
call _MpsTimerHandler
|
||||
popq %rax
|
||||
popq %rax
|
||||
popq %rax
|
||||
mov ebx, 0xef
|
||||
mov eax, 0xceafbeef
|
||||
push rax
|
||||
push rsp
|
||||
push rbx
|
||||
call MpsTimerHandler
|
||||
pop rax
|
||||
pop rax
|
||||
pop rax
|
||||
|
||||
/* Return to the caller */
|
||||
AFTER
|
||||
|
|
|
@ -24,8 +24,9 @@ rip = 0
|
|||
#define MACRO(name, ...) name MACRO __VA_ARGS__
|
||||
|
||||
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
|
||||
.PROC MACRO namex
|
||||
namex PROC FRAME
|
||||
.PROC MACRO name
|
||||
name PROC FRAME
|
||||
_name:
|
||||
ENDM
|
||||
|
||||
/* ... and .ENDP, replacing ENDP */
|
||||
|
@ -43,6 +44,16 @@ ENDM
|
|||
DB text, 0
|
||||
ENDM
|
||||
|
||||
.text MACRO
|
||||
ENDM
|
||||
|
||||
.code64 MACRO
|
||||
.code
|
||||
ENDM
|
||||
|
||||
UNIMPLEMENTED MACRO name
|
||||
ENDM
|
||||
|
||||
/* We need this to distinguish repeat from macros */
|
||||
#define ENDR ENDM
|
||||
|
||||
|
@ -79,7 +90,9 @@ ENDM
|
|||
.endm
|
||||
|
||||
/* MASM compatible PUBLIC */
|
||||
#define PUBLIC .global
|
||||
.macro PUBLIC symbol
|
||||
.global \symbol
|
||||
.endm
|
||||
|
||||
/* MASM compatible ALIGN */
|
||||
#define ALIGN .align
|
||||
|
@ -148,7 +161,7 @@ code = 1
|
|||
lea rdx, 1b[rip]
|
||||
lea r8, 2b[rip]
|
||||
mov r9, \line
|
||||
call _DbgPrint
|
||||
call DbgPrint
|
||||
add rsp, 0x20
|
||||
.endm
|
||||
#define UNIMPLEMENTED UNIMPLEMENTED2 __FILE__, __LINE__,
|
||||
|
|
|
@ -83,9 +83,14 @@ extern long timedelta;
|
|||
#ifdef _MSC_VER
|
||||
#define MAKE_SET(set, sym, type)
|
||||
#else
|
||||
#if defined(_M_AMD64)
|
||||
#define MAKE_SET(set, sym, type) \
|
||||
asm(".stabs \"" #set "\", " #type ", 0, 0, " #sym)
|
||||
#else
|
||||
#define MAKE_SET(set, sym, type) \
|
||||
asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
|
||||
#endif
|
||||
#endif
|
||||
#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
|
||||
#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
|
||||
#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
|
||||
|
|
|
@ -3,54 +3,47 @@
|
|||
* PROJECT: ReactOS Run-Time Library
|
||||
* PURPOSE: Debug Routines
|
||||
* FILE: lib/rtl/i386/debug.S
|
||||
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
|
||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||
*/
|
||||
|
||||
.intel_syntax noprefix
|
||||
#include <reactos/asm.h>
|
||||
|
||||
/* GLOBALS ****************************************************************/
|
||||
|
||||
.globl _DbgBreakPoint
|
||||
.globl _DbgBreakPointWithStatus
|
||||
.globl _DbgUserBreakPoint
|
||||
.globl _DebugService
|
||||
.globl _DebugService2
|
||||
.globl _DbgBreakPointNoBugCheck
|
||||
.globl _RtlpBreakWithStatusInstruction
|
||||
PUBLIC DbgBreakPoint
|
||||
PUBLIC DbgBreakPointWithStatus
|
||||
PUBLIC DbgUserBreakPoint
|
||||
PUBLIC DebugService
|
||||
PUBLIC DebugService2
|
||||
PUBLIC DbgBreakPointNoBugCheck
|
||||
PUBLIC RtlpBreakWithStatusInstruction
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
.func DbgBreakPointNoBugCheck
|
||||
_DbgBreakPointNoBugCheck:
|
||||
.code64
|
||||
|
||||
DbgBreakPointNoBugCheck:
|
||||
int 3
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
.func DbgBreakPoint
|
||||
_DbgBreakPoint:
|
||||
_DbgUserBreakPoint:
|
||||
DbgBreakPoint:
|
||||
DbgUserBreakPoint:
|
||||
int 3
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
.func DbgBreakPointWithStatus
|
||||
_DbgBreakPointWithStatus:
|
||||
DbgBreakPointWithStatus:
|
||||
mov eax, ecx
|
||||
|
||||
_RtlpBreakWithStatusInstruction:
|
||||
RtlpBreakWithStatusInstruction:
|
||||
int 3
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
.func DebugService2
|
||||
_DebugService2:
|
||||
DebugService2:
|
||||
ret
|
||||
/* Call the interrupt */
|
||||
// mov eax, [rbp+8]
|
||||
// int 0x2D
|
||||
// int 3
|
||||
|
||||
.endfunc
|
||||
|
||||
/******************************************************************************
|
||||
* NTSTATUS NTAPI DebugService(
|
||||
|
@ -60,8 +53,7 @@ _DebugService2:
|
|||
* IN PVOID Argument1, // <r9> = [rsp + 32]
|
||||
* IN PVOID Argument2); // [rsp + 40]
|
||||
*/
|
||||
.func DebugService
|
||||
_DebugService:
|
||||
DebugService:
|
||||
|
||||
/* Prepare registers for interrupt */
|
||||
mov eax, ecx // Service
|
||||
|
@ -71,9 +63,10 @@ _DebugService:
|
|||
mov r9, [rsp + 40] // Argument2
|
||||
|
||||
/* Call the Interrupt */
|
||||
int 0x2D
|
||||
int HEX(2D)
|
||||
int 3
|
||||
|
||||
/* Return */
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
END
|
||||
|
|
|
@ -8,24 +8,25 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ndk/asm.h>
|
||||
.intel_syntax noprefix
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
/*
|
||||
* VOID NTAPI
|
||||
* RtlCaptureContext(
|
||||
* PCONTEXT ContextRecord); <rcx>
|
||||
*/
|
||||
.func RtlCaptureContext
|
||||
.global _RtlCaptureContext
|
||||
_RtlCaptureContext:
|
||||
.cfi_startproc
|
||||
PUBLIC RtlCaptureContext
|
||||
.PROC RtlCaptureContext
|
||||
|
||||
/* Push rflags */
|
||||
pushfq
|
||||
.cfi_adjust_cfa_offset 8
|
||||
.ALLOCSTACK 8
|
||||
.ENDPROLOG
|
||||
|
||||
/* Save the basic register context */
|
||||
mov [rcx + CONTEXT_Rax], rax
|
||||
|
@ -47,7 +48,7 @@ _RtlCaptureContext:
|
|||
mov [rcx + CONTEXT_R9], r9
|
||||
|
||||
/* Load former stack pointer in rax */
|
||||
lea rax, [rsp + 0x10]
|
||||
lea rax, [rsp + 16]
|
||||
|
||||
mov [rcx + CONTEXT_R10], r10
|
||||
mov [rcx + CONTEXT_R11], r11
|
||||
|
@ -95,6 +96,8 @@ _RtlCaptureContext:
|
|||
/* Cleanup stack and return */
|
||||
add rsp, 8
|
||||
ret
|
||||
.cfi_endproc
|
||||
.endfunc
|
||||
.ENDP RtlCaptureContext
|
||||
|
||||
END
|
||||
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
.intel_syntax noprefix
|
||||
|
||||
.code64
|
||||
|
||||
/* SIZE_T
|
||||
* RtlCompareMemory(
|
||||
|
@ -27,6 +29,7 @@
|
|||
.pushreg rsi
|
||||
push rdi
|
||||
.pushreg rdi
|
||||
.ENDPROLOG
|
||||
|
||||
/* Setup registers for compare */
|
||||
mov rsi, rcx
|
||||
|
@ -38,41 +41,48 @@
|
|||
/* Get number of qwords */
|
||||
mov rcx, r8
|
||||
shr rcx, 3
|
||||
jz 2f
|
||||
jz RtlCompareMemory2
|
||||
|
||||
/* Compare qwords */
|
||||
repe cmpsq
|
||||
jnz 4f
|
||||
jnz RtlCompareMemory4
|
||||
|
||||
2: /* Compare rest */
|
||||
RtlCompareMemory2:
|
||||
/* Compare rest */
|
||||
mov rcx, r8
|
||||
and rcx, 7
|
||||
jz 3f
|
||||
jz RtlCompareMemory3
|
||||
|
||||
repe cmpsb
|
||||
jnz 5f
|
||||
jnz RtlCompareMemory5
|
||||
|
||||
3: /* All equal */
|
||||
RtlCompareMemory3:
|
||||
/* All equal */
|
||||
/* Return the full count */
|
||||
mov rax, rcx
|
||||
jmp 6f
|
||||
jmp RtlCompareMemory6
|
||||
|
||||
4: /* Not equal after comparing qwords */
|
||||
RtlCompareMemory4:
|
||||
/* Not equal after comparing qwords */
|
||||
/* Compare the last qword */
|
||||
sub rsi, 8
|
||||
sub rdi, 8
|
||||
mov rcx, 8
|
||||
repe cmpsb
|
||||
|
||||
5: /* Not equal after comparing bytes */
|
||||
RtlCompareMemory5:
|
||||
/* Not equal after comparing bytes */
|
||||
/* Return difference */
|
||||
sub rdi, rdx
|
||||
dec rdi
|
||||
mov rax, rdi
|
||||
|
||||
6: /* Cleanup and return */
|
||||
RtlCompareMemory6:
|
||||
/* Cleanup and return */
|
||||
pop rdi
|
||||
pop rsi
|
||||
ret
|
||||
.endproc
|
||||
.endp RtlCompareMemory
|
||||
|
||||
END
|
||||
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
* PROGRAMMERS: Timo Kreuzer
|
||||
*/
|
||||
|
||||
#include <ndk/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
.intel_syntax noprefix
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
#define SLIST8A_DEPTH_MASK 0x000000000000FFFF
|
||||
#define SLIST8A_DEPTH_INC 0x0000000000000001
|
||||
|
@ -32,15 +31,15 @@
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.global _ExpInterlockedPopEntrySList
|
||||
.global _ExpInterlockedPopEntrySListResume
|
||||
.global _ExpInterlockedPopEntrySListFault
|
||||
.global _ExpInterlockedPopEntrySListEnd
|
||||
.global _ExpInterlockedPopEntrySListResume16
|
||||
.global _ExpInterlockedPopEntrySListFault16
|
||||
.global _ExpInterlockedPopEntrySListEnd16
|
||||
.global _ExpInterlockedPushEntrySList
|
||||
.global _ExpInterlockedFlushSList
|
||||
.global ExpInterlockedPopEntrySList
|
||||
.global ExpInterlockedPopEntrySListResume
|
||||
.global ExpInterlockedPopEntrySListFault
|
||||
.global ExpInterlockedPopEntrySListEnd
|
||||
.global ExpInterlockedPopEntrySListResume16
|
||||
.global ExpInterlockedPopEntrySListFault16
|
||||
.global ExpInterlockedPopEntrySListEnd16
|
||||
.global ExpInterlockedPushEntrySList
|
||||
.global ExpInterlockedFlushSList
|
||||
|
||||
/* PSLIST_ENTRY
|
||||
* NTAPI
|
||||
|
@ -48,7 +47,7 @@
|
|||
* IN PSLIST_HEADER ListHead);
|
||||
*/
|
||||
.proc RtlInterlockedPopEntrySList
|
||||
_ExpInterlockedPopEntrySList:
|
||||
ExpInterlockedPopEntrySList:
|
||||
|
||||
/* Load ListHead->Region into rdx */
|
||||
mov rdx, [rcx + 8]
|
||||
|
@ -58,16 +57,16 @@ _ExpInterlockedPopEntrySList:
|
|||
|
||||
/* Check what kind of header this is */
|
||||
test rdx, SLIST8B_HEADERTYPE_MASK
|
||||
jnz _RtlInterlockedPopEntrySList16
|
||||
jnz RtlInterlockedPopEntrySList16
|
||||
|
||||
/* We have an 8 byte header */
|
||||
|
||||
_ExpInterlockedPopEntrySListResume:
|
||||
ExpInterlockedPopEntrySListResume:
|
||||
|
||||
/* Check if ListHead->NextEntry is NULL */
|
||||
mov r9, rax
|
||||
and r9, SLIST8A_NEXTENTRY_MASK
|
||||
jz _RtlInterlockedPopEntrySListEmpty
|
||||
jz RtlInterlockedPopEntrySListEmpty
|
||||
|
||||
/* Copy Depth and Sequence number and adjust Depth */
|
||||
lea r8, [rax - SLIST8A_DEPTH_INC]
|
||||
|
@ -83,7 +82,7 @@ _ExpInterlockedPopEntrySListResume:
|
|||
/* Combine to new pointer in rdx */
|
||||
or rdx, r9
|
||||
|
||||
_ExpInterlockedPopEntrySListFault:
|
||||
ExpInterlockedPopEntrySListFault:
|
||||
|
||||
/* Load the next NextEntry pointer to r9 */
|
||||
mov r9, [rdx]
|
||||
|
@ -94,13 +93,13 @@ _ExpInterlockedPopEntrySListFault:
|
|||
/* Combine into r8 */
|
||||
or r8, r9
|
||||
|
||||
_ExpInterlockedPopEntrySListEnd:
|
||||
ExpInterlockedPopEntrySListEnd:
|
||||
|
||||
/* If [rcx] equals rax, exchange it with r8 */
|
||||
lock cmpxchg [rcx], r8
|
||||
|
||||
/* If not equal, retry with rax, being the content of [rcx] now */
|
||||
jnz _ExpInterlockedPopEntrySListResume
|
||||
jnz ExpInterlockedPopEntrySListResume
|
||||
|
||||
/* Shift the pointer bits in place */
|
||||
and rax, SLIST8A_NEXTENTRY_MASK
|
||||
|
@ -114,11 +113,11 @@ _ExpInterlockedPopEntrySListEnd:
|
|||
or rax, rdx
|
||||
ret
|
||||
|
||||
_RtlInterlockedPopEntrySListEmpty:
|
||||
RtlInterlockedPopEntrySListEmpty:
|
||||
xor rax, rax
|
||||
ret
|
||||
|
||||
_RtlInterlockedPopEntrySList16:
|
||||
RtlInterlockedPopEntrySList16:
|
||||
/* This is a 16 byte header */
|
||||
|
||||
/* Save rbx */
|
||||
|
@ -127,14 +126,14 @@ _RtlInterlockedPopEntrySList16:
|
|||
/* Copy rcx to r8, as we need rcx for the exchange */
|
||||
mov r8, rcx
|
||||
|
||||
_ExpInterlockedPopEntrySListResume16:
|
||||
ExpInterlockedPopEntrySListResume16:
|
||||
|
||||
/* Check if ListHead->NextEntry is NULL */
|
||||
mov r9, rdx
|
||||
and r9, SLIST16B_NEXTENTY_MASK
|
||||
jz _RtlInterlockedPopEntrySListEmpty16
|
||||
jz RtlInterlockedPopEntrySListEmpty16
|
||||
|
||||
_ExpInterlockedPopEntrySListFault16:
|
||||
ExpInterlockedPopEntrySListFault16:
|
||||
|
||||
/* Get next pointer */
|
||||
mov rcx, [r9]
|
||||
|
@ -145,13 +144,13 @@ _ExpInterlockedPopEntrySListFault16:
|
|||
/* Copy Depth and Sequence number and adjust Depth */
|
||||
lea rbx, [rax - SLIST16A_DEPTH_INC]
|
||||
|
||||
_ExpInterlockedPopEntrySListEnd16:
|
||||
ExpInterlockedPopEntrySListEnd16:
|
||||
|
||||
/* If [r8] equals rdx:rax, exchange it with rcx:rbx */
|
||||
lock cmpxchg16b [r8]
|
||||
|
||||
/* If not equal, retry with rdx:rax, being the content of [r8] now */
|
||||
jnz _ExpInterlockedPopEntrySListResume16
|
||||
jnz ExpInterlockedPopEntrySListResume16
|
||||
|
||||
/* Copy the old NextEntry pointer to rax */
|
||||
mov rax, rdx
|
||||
|
@ -161,12 +160,12 @@ _ExpInterlockedPopEntrySListEnd16:
|
|||
pop rbx
|
||||
ret
|
||||
|
||||
_RtlInterlockedPopEntrySListEmpty16:
|
||||
RtlInterlockedPopEntrySListEmpty16:
|
||||
xor rax, rax
|
||||
pop rbx
|
||||
ret
|
||||
|
||||
.endproc
|
||||
.endp RtlInterlockedPopEntrySList
|
||||
|
||||
|
||||
/* PSLIST_ENTRY
|
||||
|
@ -176,7 +175,7 @@ _RtlInterlockedPopEntrySListEmpty16:
|
|||
* IN PSLIST_ENTRY ListEntry);
|
||||
*/
|
||||
.proc RtlInterlockedPushEntrySList
|
||||
_ExpInterlockedPushEntrySList:
|
||||
ExpInterlockedPushEntrySList:
|
||||
|
||||
/* Load ListHead->Alignment into rax */
|
||||
mov rax, [rcx]
|
||||
|
@ -186,16 +185,16 @@ _ExpInterlockedPushEntrySList:
|
|||
|
||||
/* Check what kind of header this is */
|
||||
test r9, SLIST8B_HEADERTYPE_MASK
|
||||
jnz _RtlInterlockedPushEntrySList16
|
||||
jnz RtlInterlockedPushEntrySList16
|
||||
|
||||
/* We have an 8 byte header */
|
||||
|
||||
_RtlInterlockedPushEntrySListLoop:
|
||||
RtlInterlockedPushEntrySListLoop:
|
||||
|
||||
/* Get ListHead->NextEntry */
|
||||
mov r8, rax
|
||||
and r8, SLIST8A_NEXTENTRY_MASK
|
||||
jz _RtlInterlockedPushEntrySListEmpty
|
||||
jz RtlInterlockedPushEntrySListEmpty
|
||||
|
||||
/* Shift the NextEntry pointer */
|
||||
shr r8, SLIST8A_NEXTENTRY_SHIFT
|
||||
|
@ -207,7 +206,7 @@ _RtlInterlockedPushEntrySListLoop:
|
|||
/* Combine to new pointer and save as ListEntry->NextEntry */
|
||||
or r8, r9
|
||||
|
||||
_RtlInterlockedPushEntrySListEmpty:
|
||||
RtlInterlockedPushEntrySListEmpty:
|
||||
/* Store the NextEntry pointer in the new ListEntry */
|
||||
mov [rdx], r8
|
||||
|
||||
|
@ -230,13 +229,13 @@ _RtlInterlockedPushEntrySListEmpty:
|
|||
lock cmpxchg [rcx], r8
|
||||
|
||||
/* If not equal, retry with rax, being the content of [rcx] now */
|
||||
jnz _RtlInterlockedPushEntrySListLoop
|
||||
jnz RtlInterlockedPushEntrySListLoop
|
||||
|
||||
/* Return the old NextEntry pointer */
|
||||
mov rax, r9
|
||||
ret
|
||||
|
||||
_RtlInterlockedPushEntrySList16:
|
||||
RtlInterlockedPushEntrySList16:
|
||||
/* This is a 16 byte header */
|
||||
|
||||
/* Save rbx */
|
||||
|
@ -252,7 +251,7 @@ _RtlInterlockedPushEntrySList16:
|
|||
|
||||
mov rdx, [r8 + 8]
|
||||
|
||||
_RtlInterlockedPushEntrySListLoop16:
|
||||
RtlInterlockedPushEntrySListLoop16:
|
||||
|
||||
/* Move ListHead->NextEntry to rbx */
|
||||
mov rbx, rdx
|
||||
|
@ -268,7 +267,7 @@ _RtlInterlockedPushEntrySListLoop16:
|
|||
lock cmpxchg16b [r8]
|
||||
|
||||
/* If not equal, retry with rdx:rax, being the content of [r8] now */
|
||||
jnz _RtlInterlockedPushEntrySListLoop16
|
||||
jnz RtlInterlockedPushEntrySListLoop16
|
||||
|
||||
/* Copy the old NextEntry pointer to rax */
|
||||
mov rax, rdx
|
||||
|
@ -278,7 +277,7 @@ _RtlInterlockedPushEntrySListLoop16:
|
|||
pop rbx
|
||||
ret
|
||||
|
||||
.endproc
|
||||
.endp RtlInterlockedPushEntrySList
|
||||
|
||||
/* PSLIST_ENTRY
|
||||
* NTAPI
|
||||
|
@ -286,18 +285,18 @@ _RtlInterlockedPushEntrySListLoop16:
|
|||
* IN PSINGLE_LIST_ENTRY ListHead);
|
||||
*/
|
||||
.proc RtlInterlockedFlushSList
|
||||
_ExpInterlockedFlushSList:
|
||||
ExpInterlockedFlushSList:
|
||||
|
||||
/* Load ListHead->Region into rdx */
|
||||
mov rax, [rcx + 8]
|
||||
|
||||
/* Check what kind of header this is */
|
||||
test rax, SLIST8B_HEADERTYPE_MASK
|
||||
jnz _RtlInterlockedFlushSList16
|
||||
jnz RtlInterlockedFlushSList16
|
||||
|
||||
/* We have an 8 byte header */
|
||||
|
||||
_RtlInterlockedFlushSListLoop:
|
||||
RtlInterlockedFlushSListLoop:
|
||||
|
||||
/* Zero ListHead->Alignment */
|
||||
xor r8, r8
|
||||
|
@ -306,7 +305,7 @@ _RtlInterlockedFlushSListLoop:
|
|||
lock cmpxchg [rcx], r8
|
||||
|
||||
/* If not equal, retry with rax, being the content of [rcx] now */
|
||||
jnz _RtlInterlockedFlushSListLoop
|
||||
jnz RtlInterlockedFlushSListLoop
|
||||
|
||||
/* Use rcx as pointer template */
|
||||
mov rdx, ~SLIST8_POINTER_MASK
|
||||
|
@ -316,7 +315,7 @@ _RtlInterlockedFlushSListLoop:
|
|||
or rax, rdx
|
||||
ret
|
||||
|
||||
_RtlInterlockedFlushSList16:
|
||||
RtlInterlockedFlushSList16:
|
||||
/* We have a 16 byte header */
|
||||
push rbx
|
||||
|
||||
|
@ -324,13 +323,13 @@ _RtlInterlockedFlushSList16:
|
|||
xor rbx, rbx
|
||||
mov rcx, 0x3
|
||||
|
||||
_RtlInterlockedFlushSListLoop16:
|
||||
RtlInterlockedFlushSListLoop16:
|
||||
|
||||
/* If [r8] equals rdx:rax, exchange it with rcx:rbx */
|
||||
lock cmpxchg16b [r8]
|
||||
|
||||
/* If not equal, retry with rdx:rax, being the content of [r8] now */
|
||||
jnz _RtlInterlockedFlushSListLoop16
|
||||
jnz RtlInterlockedFlushSListLoop16
|
||||
|
||||
/* Copy the old NextEntry pointer to rax */
|
||||
mov rax, rdx
|
||||
|
@ -340,4 +339,4 @@ _RtlInterlockedFlushSListLoop16:
|
|||
pop rbx
|
||||
ret
|
||||
|
||||
.endproc
|
||||
.endp RtlInterlockedFlushSList
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
#include <reactos/asm.h>
|
||||
|
||||
.intel_syntax noprefix
|
||||
|
||||
|
@ -21,11 +20,11 @@ _MsgUnimplemented:
|
|||
.proc _chkstk
|
||||
UNIMPLEMENTED chkstk
|
||||
ret
|
||||
.endproc
|
||||
.endp
|
||||
|
||||
.proc _alloca_probe
|
||||
UNIMPLEMENTED alloca_probe
|
||||
ret
|
||||
.endproc
|
||||
.endp
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -8,21 +8,21 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
.globl __fltused
|
||||
__fltused:
|
||||
PUBLIC _fltused
|
||||
_fltused:
|
||||
.long 0x9875
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc alldiv
|
||||
UNIMPLEMENTED alldiv
|
||||
ret
|
||||
|
||||
.endproc
|
||||
.endp alldiv
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc atan
|
||||
PUBLIC atan
|
||||
atan:
|
||||
UNIMPLEMENTED atan
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc atan2
|
||||
PUBLIC atan2
|
||||
atan2:
|
||||
UNIMPLEMENTED atan2
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc ceil
|
||||
PUBLIC ceil
|
||||
ceil:
|
||||
UNIMPLEMENTED ceil
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc ceilf
|
||||
PUBLIC ceilf
|
||||
ceilf:
|
||||
/* Put parameter on the stack */
|
||||
movss [rsp - 0x10], xmm0
|
||||
fld dword ptr [rsp]
|
||||
|
@ -36,5 +38,3 @@
|
|||
fstp dword ptr [rsp - 0x10]
|
||||
movss xmm0, [rsp - 0x10]
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc exp
|
||||
PUBLIC exp
|
||||
exp:
|
||||
UNIMPLEMENTED exp
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc fabs
|
||||
PUBLIC fabs
|
||||
fabs:
|
||||
UNIMPLEMENTED fabs
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc floor
|
||||
PUBLIC floor
|
||||
floor:
|
||||
UNIMPLEMENTED floor
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
.code64
|
||||
|
||||
.proc floorf
|
||||
PUBLIC floorf
|
||||
floorf:
|
||||
/* Put parameter on the stack */
|
||||
movss [rsp - 0x10], xmm0
|
||||
fld dword ptr [rsp]
|
||||
|
@ -36,5 +38,3 @@
|
|||
fstp dword ptr [rsp - 0x10]
|
||||
movss xmm0, [rsp - 0x10]
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc fmod
|
||||
PUBLIC fmod
|
||||
fmod:
|
||||
UNIMPLEMENTED fmod
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc fmodf
|
||||
PUBLIC fmodf
|
||||
fmodf:
|
||||
UNIMPLEMENTED fmodf
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc ldexp
|
||||
PUBLIC ldexp
|
||||
ldexp:
|
||||
UNIMPLEMENTED ldexp
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc log
|
||||
PUBLIC log
|
||||
log:
|
||||
UNIMPLEMENTED log
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,13 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc log10
|
||||
PUBLIC log10
|
||||
log10:
|
||||
UNIMPLEMENTED log10
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,13 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc pow
|
||||
PUBLIC pow
|
||||
pow:
|
||||
UNIMPLEMENTED pow
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc sqrt
|
||||
PUBLIC sqrt
|
||||
sqrt:
|
||||
UNIMPLEMENTED sqrt
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,13 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc sqrtf
|
||||
PUBLIC sqrtf
|
||||
sqrtf:
|
||||
sqrtss xmm0, xmm0
|
||||
ret
|
||||
.endproc
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
#include <ndk/amd64/asmmacro.S>
|
||||
|
||||
.intel_syntax noprefix
|
||||
/* DATA *********************************************************************/
|
||||
|
||||
|
||||
.proc tan
|
||||
PUBLIC tan
|
||||
tan:
|
||||
UNIMPLEMENTED tan
|
||||
ret
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
* Returns: 0
|
||||
* Notes: Sets up the jmp_buf
|
||||
*/
|
||||
PUBLIC __setjmp
|
||||
.proc __setjmp
|
||||
PUBLIC _setjmp
|
||||
.proc _setjmp
|
||||
/* Load rsp as it was before the call into rax */
|
||||
lea rax, [rsp + 8]
|
||||
/* Load return address into r8 */
|
||||
|
@ -73,7 +73,7 @@ PUBLIC __setjmp
|
|||
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
||||
xor rax, rax
|
||||
ret
|
||||
.endp
|
||||
.endp _setjmp
|
||||
|
||||
/*
|
||||
* int _setjmpex(jmp_buf _Buf,void *_Ctx);
|
||||
|
@ -83,8 +83,8 @@ PUBLIC __setjmp
|
|||
* Returns: 0
|
||||
* Notes: Sets up the jmp_buf
|
||||
*/
|
||||
PUBLIC __setjmpex
|
||||
.proc __setjmpex
|
||||
PUBLIC _setjmpex
|
||||
.proc _setjmpex
|
||||
/* Load rsp as it was before the call into rax */
|
||||
lea rax, [rsp + 8]
|
||||
/* Load return address into r8 */
|
||||
|
@ -112,7 +112,7 @@ PUBLIC __setjmpex
|
|||
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
||||
xor rax, rax
|
||||
ret
|
||||
.endp
|
||||
.endp _setjmpex
|
||||
|
||||
|
||||
/*
|
||||
|
@ -123,8 +123,8 @@ PUBLIC __setjmpex
|
|||
* Returns: Doesn't return
|
||||
* Notes: Non-local goto
|
||||
*/
|
||||
PUBLIC _longjmp
|
||||
.proc _longjmp
|
||||
PUBLIC longjmp
|
||||
.proc longjmp
|
||||
|
||||
// FIXME: handle frame
|
||||
|
||||
|
@ -155,4 +155,4 @@ PUBLIC _longjmp
|
|||
jnz 2f
|
||||
inc rax
|
||||
2: jmp r8
|
||||
.endp
|
||||
.endp longjmp
|
||||
|
|
|
@ -8,15 +8,16 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <asm.h>
|
||||
.intel_syntax noprefix
|
||||
.code64
|
||||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
.code64
|
||||
.text
|
||||
|
||||
/**
|
||||
|
@ -29,9 +30,8 @@
|
|||
* IN CCHAR Number, <rsp + 0x28>
|
||||
* IN PLOADER_PARAMETER_BLOCK LoaderBlock) <rsp + 0x30>
|
||||
*/
|
||||
.globl _KiSetupStackAndInitializeKernel
|
||||
.func KiSetupStackAndInitializeKernel
|
||||
_KiSetupStackAndInitializeKernel:
|
||||
PUBLIC KiSetupStackAndInitializeKernel
|
||||
.PROC KiSetupStackAndInitializeKernel
|
||||
|
||||
/* Save current stack */
|
||||
mov rsi, rsp
|
||||
|
@ -53,6 +53,9 @@ _KiSetupStackAndInitializeKernel:
|
|||
movsq
|
||||
movsq
|
||||
|
||||
jmp _KiInitializeKernelAndGotoIdleLoop
|
||||
jmp KiInitializeKernelAndGotoIdleLoop
|
||||
|
||||
.ENDP KiSetupStackAndInitializeKernel
|
||||
|
||||
END
|
||||
|
||||
.endfunc
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
*
|
||||
*--*/
|
||||
.func KiThreadStartup
|
||||
.globl _KiThreadStartup
|
||||
_KiThreadStartup:
|
||||
.globl KiThreadStartup
|
||||
KiThreadStartup:
|
||||
|
||||
/*
|
||||
* Clear all the non-volatile registers, so the thread won't be tempted to
|
||||
|
@ -85,7 +85,7 @@ _KiThreadStartup:
|
|||
|
||||
/* Exit back to user-mode */
|
||||
// jmp _KiServiceExit2
|
||||
UNIMPLEMENTED "KiThreadStartup->KiServiceExit2"
|
||||
UNIMPLEMENTED KiThreadStartup->KiServiceExit2
|
||||
|
||||
BadThread:
|
||||
|
||||
|
@ -112,10 +112,10 @@ BadThread:
|
|||
* Absolutely all registers except ESP can be trampled here for maximum code flexibility.
|
||||
*
|
||||
*--*/
|
||||
.globl _KiSwapContextInternal
|
||||
.func _KiSwapContextInternal, _KiSwapContextInternal
|
||||
_KiSwapContextInternal:
|
||||
UNIMPLEMENTED "KiSwapContextInternal"
|
||||
.globl KiSwapContextInternal
|
||||
.func KiSwapContextInternal
|
||||
KiSwapContextInternal:
|
||||
UNIMPLEMENTED KiSwapContextInternal
|
||||
ret
|
||||
|
||||
.endfunc
|
||||
|
@ -147,9 +147,9 @@ _KiSwapContextInternal:
|
|||
* another thread switches to IT.
|
||||
*
|
||||
*--*/
|
||||
.globl _KiSwapContext
|
||||
.func _KiSwapContext, _KiSwapContext
|
||||
_KiSwapContext:
|
||||
.globl KiSwapContext
|
||||
.func KiSwapContext
|
||||
KiSwapContext:
|
||||
|
||||
/* Save 10 registers */
|
||||
sub rsp, 10 * 8
|
||||
|
@ -180,7 +180,7 @@ _KiSwapContext:
|
|||
movzx ecx, byte ptr [edi+KTHREAD_WAIT_IRQL]
|
||||
|
||||
/* Do the swap with the registers correctly setup */
|
||||
call _KiSwapContextInternal
|
||||
call KiSwapContextInternal
|
||||
|
||||
/* Restore the registers */
|
||||
mov rbp, [rsp+0]
|
||||
|
|
|
@ -10,20 +10,20 @@
|
|||
#include <reactos/asm.h>
|
||||
#include <ndk/amd64/asm.h>
|
||||
|
||||
EXTERN _KiDispatchException:PROC
|
||||
EXTERN _FrLdrDbgPrint:DWORD
|
||||
EXTERN _KeBugCheckWithTf:PROC
|
||||
EXTERN _MmAccessFault:PROC
|
||||
EXTERN _KiSystemFatalException:PROC
|
||||
EXTERN _KiNpxNotAvailableFaultHandler:PROC
|
||||
EXTERN _KiGeneralProtectionFaultHandler:PROC
|
||||
EXTERN _KiXmmExceptionHandler:PROC
|
||||
EXTERN KiDispatchException:PROC
|
||||
EXTERN FrLdrDbgPrint:DWORD
|
||||
EXTERN KeBugCheckWithTf:PROC
|
||||
EXTERN MmAccessFault:PROC
|
||||
EXTERN KiSystemFatalException:PROC
|
||||
EXTERN KiNpxNotAvailableFaultHandler:PROC
|
||||
EXTERN KiGeneralProtectionFaultHandler:PROC
|
||||
EXTERN KiXmmExceptionHandler:PROC
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
.data
|
||||
|
||||
PUBLIC _MsgUnimplemented
|
||||
PUBLIC MsgUnimplemented
|
||||
_MsgUnimplemented:
|
||||
.ascii "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
|
||||
|
||||
|
@ -58,7 +58,7 @@ label2:
|
|||
lea rcx, _MsgTrapInfo[rip]
|
||||
lea rdx, 1b[rip]
|
||||
mov r8, [rbp + KTRAP_FRAME_Rip]
|
||||
call qword ptr _FrLdrDbgPrint[rip]
|
||||
call qword ptr FrLdrDbgPrint[rip]
|
||||
add rsp, 32
|
||||
#endif
|
||||
ENDM
|
||||
|
@ -263,18 +263,18 @@ ENDM
|
|||
|
||||
ALIGN 8
|
||||
|
||||
PUBLIC _InterruptDispatchTable
|
||||
_InterruptDispatchTable:
|
||||
PUBLIC InterruptDispatchTable
|
||||
InterruptDispatchTable:
|
||||
Vector = 0
|
||||
REPEAT 256
|
||||
push Vector
|
||||
jmp _KiUnexpectedInterrupt
|
||||
jmp KiUnexpectedInterrupt
|
||||
ALIGN 8
|
||||
Vector = Vector+1
|
||||
ENDR
|
||||
|
||||
// rbp = TrapFrame, eax = ExceptionCode, edx = NumParams, r9,r10,r11 = params
|
||||
.PROC _InternalDispatchException
|
||||
.PROC InternalDispatchException
|
||||
|
||||
/* Allocate stack space for EXCEPTION_RECORD and KEXCEPTION_FRAME */
|
||||
sub rsp, SIZE_EXCEPTION_RECORD + SIZE_KEXCEPTION_FRAME
|
||||
|
@ -322,7 +322,7 @@ ENDR
|
|||
mov r8, rbp // TrapFrame
|
||||
mov r9b, [r8 + KTRAP_FRAME_PreviousMode] // PreviousMode
|
||||
mov byte ptr [rsp + KEXCEPTION_FRAME_P5], 1 // FirstChance
|
||||
call _KiDispatchException
|
||||
call KiDispatchException
|
||||
|
||||
/* Restore registers */
|
||||
mov r12, [rsp + KEXCEPTION_FRAME_R12]
|
||||
|
@ -342,13 +342,13 @@ ENDR
|
|||
|
||||
add rsp, SIZE_EXCEPTION_RECORD + SIZE_KEXCEPTION_FRAME
|
||||
ret
|
||||
.ENDP _InternalDispatchException
|
||||
.ENDP InternalDispatchException
|
||||
|
||||
|
||||
/* SOFTWARE INTERRUPT SERVICES ***********************************************/
|
||||
|
||||
PUBLIC _KiDivideErrorFault
|
||||
.PROC _KiDivideErrorFault
|
||||
PUBLIC KiDivideErrorFault
|
||||
.PROC KiDivideErrorFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -361,16 +361,16 @@ PUBLIC _KiDivideErrorFault
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiDivideErrorFault
|
||||
.ENDP KiDivideErrorFault
|
||||
|
||||
|
||||
PUBLIC _KiDebugTrapOrFault
|
||||
.PROC _KiDebugTrapOrFault
|
||||
PUBLIC KiDebugTrapOrFault
|
||||
.PROC KiDebugTrapOrFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -391,16 +391,16 @@ KiDebugTrapOrFaultKMode:
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiDebugTrapOrFault
|
||||
.ENDP KiDebugTrapOrFault
|
||||
|
||||
|
||||
PUBLIC _KiNmiInterrupt
|
||||
.PROC _KiNmiInterrupt
|
||||
PUBLIC KiNmiInterrupt
|
||||
.PROC KiNmiInterrupt
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -411,11 +411,11 @@ PUBLIC _KiNmiInterrupt
|
|||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiNmiInterrupt
|
||||
.ENDP KiNmiInterrupt
|
||||
|
||||
|
||||
PUBLIC _KiBreakpointTrap
|
||||
.PROC _KiBreakpointTrap
|
||||
PUBLIC KiBreakpointTrap
|
||||
.PROC KiBreakpointTrap
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -423,7 +423,7 @@ PUBLIC _KiBreakpointTrap
|
|||
|
||||
// lea rcx, _MsgBreakpointTrap[rip]
|
||||
// mov rdx, rsp
|
||||
// call qword ptr _FrLdrDbgPrint[rip]
|
||||
// call qword ptr FrLdrDbgPrint[rip]
|
||||
|
||||
/* Dispatch the exception */
|
||||
mov eax, STATUS_BREAKPOINT
|
||||
|
@ -431,16 +431,16 @@ PUBLIC _KiBreakpointTrap
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiBreakpointTrap
|
||||
.ENDP KiBreakpointTrap
|
||||
|
||||
|
||||
PUBLIC _KiOverflowTrap
|
||||
.PROC _KiOverflowTrap
|
||||
PUBLIC KiOverflowTrap
|
||||
.PROC KiOverflowTrap
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -453,16 +453,16 @@ PUBLIC _KiOverflowTrap
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiOverflowTrap
|
||||
.ENDP KiOverflowTrap
|
||||
|
||||
|
||||
PUBLIC _KiBoundFault
|
||||
.PROC _KiBoundFault
|
||||
PUBLIC KiBoundFault
|
||||
.PROC KiBoundFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -473,7 +473,7 @@ PUBLIC _KiBoundFault
|
|||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_BOUND_CHECK
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
KiBoundFaltUserMode:
|
||||
/* Enable interrupts for user-mode */
|
||||
|
@ -485,16 +485,16 @@ KiBoundFaltUserMode:
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiBoundFault
|
||||
.ENDP KiBoundFault
|
||||
|
||||
|
||||
PUBLIC _KiInvalidOpcodeFault
|
||||
.PROC _KiInvalidOpcodeFault
|
||||
PUBLIC KiInvalidOpcodeFault
|
||||
.PROC KiInvalidOpcodeFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -502,7 +502,7 @@ PUBLIC _KiInvalidOpcodeFault
|
|||
|
||||
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
||||
lea rcx, _MsgInvalidOpcodeFault[rip]
|
||||
call qword ptr _FrLdrDbgPrint[rip]
|
||||
call qword ptr FrLdrDbgPrint[rip]
|
||||
|
||||
/* Enable interrupts */
|
||||
sti
|
||||
|
@ -522,22 +522,22 @@ KiInvalidOpcodeKernel:
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiInvalidOpcodeFault
|
||||
.ENDP KiInvalidOpcodeFault
|
||||
|
||||
|
||||
PUBLIC _KiNpxNotAvailableFault
|
||||
.PROC _KiNpxNotAvailableFault
|
||||
PUBLIC KiNpxNotAvailableFault
|
||||
.PROC KiNpxNotAvailableFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
/* Call the C handler */
|
||||
mov rcx, rbp
|
||||
call _KiNpxNotAvailableFaultHandler
|
||||
call KiNpxNotAvailableFaultHandler
|
||||
|
||||
/* Check the return status code */
|
||||
test eax, eax
|
||||
|
@ -548,102 +548,102 @@ PUBLIC _KiNpxNotAvailableFault
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
KiNpxNotAvailableFaultExit:
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiNpxNotAvailableFault
|
||||
.ENDP KiNpxNotAvailableFault
|
||||
|
||||
|
||||
PUBLIC _KiDoubleFaultAbort
|
||||
.PROC _KiDoubleFaultAbort
|
||||
PUBLIC KiDoubleFaultAbort
|
||||
.PROC KiDoubleFaultAbort
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
lea rcx, _MsgDoubleFault[rip]
|
||||
mov rdx, [rbp + KTRAP_FRAME_FaultAddress]
|
||||
mov r8, rbp
|
||||
call qword ptr _FrLdrDbgPrint[rip]
|
||||
call qword ptr FrLdrDbgPrint[rip]
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, 8 // EXCEPTION_DOUBLE_FAULT
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiDoubleFaultAbort
|
||||
.ENDP KiDoubleFaultAbort
|
||||
|
||||
|
||||
PUBLIC _KiNpxSegmentOverrunAbort
|
||||
.PROC _KiNpxSegmentOverrunAbort
|
||||
PUBLIC KiNpxSegmentOverrunAbort
|
||||
.PROC KiNpxSegmentOverrunAbort
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_NPX_OVERRUN
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiNpxSegmentOverrunAbort
|
||||
.ENDP KiNpxSegmentOverrunAbort
|
||||
|
||||
|
||||
PUBLIC _KiInvalidTssFault
|
||||
.PROC _KiInvalidTssFault
|
||||
PUBLIC KiInvalidTssFault
|
||||
.PROC KiInvalidTssFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_INVALID_TSS
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiInvalidTssFault
|
||||
.ENDP KiInvalidTssFault
|
||||
|
||||
|
||||
PUBLIC _KiSegmentNotPresentFault
|
||||
.PROC _KiSegmentNotPresentFault
|
||||
PUBLIC KiSegmentNotPresentFault
|
||||
.PROC KiSegmentNotPresentFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_SEGMENT_NOT_PRESENT
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiSegmentNotPresentFault
|
||||
.ENDP KiSegmentNotPresentFault
|
||||
|
||||
|
||||
PUBLIC _KiStackFault
|
||||
.PROC _KiStackFault
|
||||
PUBLIC KiStackFault
|
||||
.PROC KiStackFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_STACK_FAULT
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiStackFault
|
||||
.ENDP KiStackFault
|
||||
|
||||
|
||||
PUBLIC _KiGeneralProtectionFault
|
||||
.PROC _KiGeneralProtectionFault
|
||||
PUBLIC KiGeneralProtectionFault
|
||||
.PROC KiGeneralProtectionFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
TRAPINFO KiGeneralProtectionFault
|
||||
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
||||
lea rcx, _MsgGeneralProtFault[rip]
|
||||
call qword ptr _FrLdrDbgPrint[rip]
|
||||
call qword ptr FrLdrDbgPrint[rip]
|
||||
|
||||
/* Call the C handler */
|
||||
call _KiGeneralProtectionFaultHandler
|
||||
call KiGeneralProtectionFaultHandler
|
||||
|
||||
/* Check for success */
|
||||
test eax, eax
|
||||
|
@ -654,7 +654,7 @@ PUBLIC _KiGeneralProtectionFault
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
KiGpfFatal:
|
||||
|
||||
|
@ -665,17 +665,17 @@ KiGpfFatal:
|
|||
mov r9, [rbp + KTRAP_FRAME_ErrorCode] // error code
|
||||
sub rsp, 8
|
||||
mov [rsp + KTRAP_FRAME_P5+8], rbp // trap frame
|
||||
call _KeBugCheckWithTf
|
||||
call KeBugCheckWithTf
|
||||
|
||||
KiGpfExit:
|
||||
/* Return */
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiGeneralProtectionFault
|
||||
.ENDP KiGeneralProtectionFault
|
||||
|
||||
|
||||
PUBLIC _KiPageFault
|
||||
.PROC _KiPageFault
|
||||
PUBLIC KiPageFault
|
||||
.PROC KiPageFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
|
@ -686,7 +686,7 @@ PUBLIC _KiPageFault
|
|||
mov rdx, [rbp + KTRAP_FRAME_ErrorCode]
|
||||
mov r8, [rbp + KTRAP_FRAME_Rip]
|
||||
mov r9, [rbp + KTRAP_FRAME_FaultAddress]
|
||||
call qword ptr _FrLdrDbgPrint[rip]
|
||||
call qword ptr FrLdrDbgPrint[rip]
|
||||
#endif
|
||||
|
||||
/* Save page fault address */
|
||||
|
@ -700,7 +700,7 @@ PUBLIC _KiPageFault
|
|||
mov r8b, [rbp + KTRAP_FRAME_SegCs] // Mode
|
||||
and r8b, 1
|
||||
mov r9, rbp // TrapInformation
|
||||
call _MmAccessFault
|
||||
call MmAccessFault
|
||||
|
||||
/* Check for success */
|
||||
test eax, eax
|
||||
|
@ -724,7 +724,7 @@ InPageException:
|
|||
mov r11d, eax // Param3 = Status
|
||||
mov eax, STATUS_IN_PAGE_ERROR // ExceptionCode
|
||||
mov edx, 3 // ParamCount
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
jmp PageFaultReturn
|
||||
|
||||
AccessViolation:
|
||||
|
@ -734,27 +734,27 @@ AccessViolation:
|
|||
SpecialCode:
|
||||
/* Setup a normal page fault exception */
|
||||
mov edx, 2 // ParamCount
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
PageFaultReturn:
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiPageFault
|
||||
.ENDP KiPageFault
|
||||
|
||||
|
||||
PUBLIC _KiFloatingErrorFault
|
||||
.PROC _KiFloatingErrorFault
|
||||
PUBLIC KiFloatingErrorFault
|
||||
.PROC KiFloatingErrorFault
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
UNIMPLEMENTED KiFloatingErrorFault
|
||||
|
||||
jmp $
|
||||
.ENDP _KiFloatingErrorFault
|
||||
.ENDP KiFloatingErrorFault
|
||||
|
||||
|
||||
PUBLIC _KiAlignmentFault
|
||||
.PROC _KiAlignmentFault
|
||||
PUBLIC KiAlignmentFault
|
||||
.PROC KiAlignmentFault
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
|
@ -764,34 +764,34 @@ PUBLIC _KiAlignmentFault
|
|||
/* Bugcheck */
|
||||
mov ecx, EXCEPTION_ALIGNMENT_CHECK
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiAlignmentFault
|
||||
.ENDP KiAlignmentFault
|
||||
|
||||
|
||||
PUBLIC _KiMcheckAbort
|
||||
.PROC _KiMcheckAbort
|
||||
PUBLIC KiMcheckAbort
|
||||
.PROC KiMcheckAbort
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
/* Bugcheck */
|
||||
mov ecx, HEX(12)
|
||||
mov rdx, rbp
|
||||
call _KiSystemFatalException
|
||||
call KiSystemFatalException
|
||||
|
||||
jmp $
|
||||
.ENDP _KiMcheckAbort
|
||||
.ENDP KiMcheckAbort
|
||||
|
||||
|
||||
PUBLIC _KiXmmException
|
||||
.PROC _KiXmmException
|
||||
PUBLIC KiXmmException
|
||||
.PROC KiXmmException
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
/* Call the C handler */
|
||||
mov rcx, rbp
|
||||
call _KiXmmExceptionHandler
|
||||
call KiXmmExceptionHandler
|
||||
|
||||
/* Check for success */
|
||||
test eax, eax
|
||||
|
@ -802,27 +802,27 @@ PUBLIC _KiXmmException
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
KiXmmExit:
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiXmmException
|
||||
.ENDP KiXmmException
|
||||
|
||||
|
||||
PUBLIC _KiApcInterrupt
|
||||
.PROC _KiApcInterrupt
|
||||
PUBLIC KiApcInterrupt
|
||||
.PROC KiApcInterrupt
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
UNIMPLEMENTED KiApcInterrupt
|
||||
|
||||
jmp $
|
||||
.ENDP _KiApcInterrupt
|
||||
.ENDP KiApcInterrupt
|
||||
|
||||
|
||||
PUBLIC _KiRaiseAssertion
|
||||
.PROC _KiRaiseAssertion
|
||||
PUBLIC KiRaiseAssertion
|
||||
.PROC KiRaiseAssertion
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
|
@ -835,15 +835,15 @@ PUBLIC _KiRaiseAssertion
|
|||
mov r9, 0
|
||||
mov r10, 0
|
||||
mov r11, 0
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
LEAVE_TRAP_FRAME
|
||||
iretq
|
||||
.ENDP _KiRaiseAssertion
|
||||
.ENDP KiRaiseAssertion
|
||||
|
||||
|
||||
PUBLIC _KiDebugServiceTrap
|
||||
.PROC _KiDebugServiceTrap
|
||||
PUBLIC KiDebugServiceTrap
|
||||
.PROC KiDebugServiceTrap
|
||||
/* Push pseudo error code */
|
||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||
|
||||
|
@ -858,37 +858,37 @@ PUBLIC _KiDebugServiceTrap
|
|||
mov r9, [rbp+KTRAP_FRAME_Rax] // Service
|
||||
mov r10, [rbp+KTRAP_FRAME_Rcx] // Buffer
|
||||
mov r11, [rbp+KTRAP_FRAME_Rdx] // Length
|
||||
call _InternalDispatchException
|
||||
call InternalDispatchException
|
||||
|
||||
LEAVE_TRAP_FRAME;
|
||||
iretq
|
||||
.ENDP _KiDebugServiceTrap
|
||||
.ENDP KiDebugServiceTrap
|
||||
|
||||
|
||||
PUBLIC _KiDpcInterrupt
|
||||
.PROC _KiDpcInterrupt
|
||||
PUBLIC KiDpcInterrupt
|
||||
.PROC KiDpcInterrupt
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
UNIMPLEMENTED KiDpcInterrupt
|
||||
|
||||
jmp $
|
||||
.ENDP _KiDpcInterrupt
|
||||
.ENDP KiDpcInterrupt
|
||||
|
||||
|
||||
PUBLIC _KiIpiInterrupt
|
||||
.PROC _KiIpiInterrupt
|
||||
PUBLIC KiIpiInterrupt
|
||||
.PROC KiIpiInterrupt
|
||||
/* We have an error code */
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
||||
UNIMPLEMENTED KiIpiInterrupt
|
||||
|
||||
jmp $
|
||||
.ENDP _KiIpiInterrupt
|
||||
.ENDP KiIpiInterrupt
|
||||
|
||||
|
||||
PUBLIC _KiUnexpectedInterrupt
|
||||
.PROC _KiUnexpectedInterrupt
|
||||
PUBLIC KiUnexpectedInterrupt
|
||||
.PROC KiUnexpectedInterrupt
|
||||
/* The error code is the vector */
|
||||
cli
|
||||
ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
|
||||
|
@ -900,10 +900,10 @@ PUBLIC _KiUnexpectedInterrupt
|
|||
mov r9, 0 // The enabled and asserted status bits
|
||||
sub rsp, 8
|
||||
mov [rbp + KTRAP_FRAME_P5 + 8], rbp // trap frame
|
||||
call _KeBugCheckWithTf
|
||||
call KeBugCheckWithTf
|
||||
|
||||
jmp $
|
||||
.ENDP _KiUnexpectedInterrupt
|
||||
.ENDP KiUnexpectedInterrupt
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#if defined (ALLOC_PRAGMA)
|
||||
#pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory)
|
||||
#pragma alloc_text(INIT, MiInitPageDirectoryMap)
|
||||
#endif
|
||||
|
||||
#undef InterlockedExchangePte
|
||||
#define InterlockedExchangePte(pte1, pte2) \
|
||||
InterlockedExchange64(&pte1->u.Long, pte2.u.Long)
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
" ret $0x%x\n\n"
|
||||
|
||||
#define KernelModeStub_amd64 " movl $0x%x, %%eax\n" \
|
||||
" call _KiSystemService\n" \
|
||||
" call KiSystemService\n" \
|
||||
" ret $0x%x\n\n"
|
||||
|
||||
/* For now, use the usermode stub. We'll optimize later */
|
||||
|
@ -143,7 +143,7 @@ struct ncitool_data_t ncitool_data[] = {
|
|||
{ "i386", 4, KernelModeStub_x86, UserModeStub_x86,
|
||||
".global _%s@%d\n", "_%s@%d:\n" },
|
||||
{ "amd64", 4, KernelModeStub_amd64, UserModeStub_amd64,
|
||||
".global _%s\n", "_%s:\n" },
|
||||
".global %s\n", "%s:\n" },
|
||||
{ "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc,
|
||||
"\t.globl %s\n", "%s:\n" },
|
||||
{ "mips", 4, KernelModeStub_mips, UserModeStub_mips,
|
||||
|
|
|
@ -6,6 +6,10 @@ LDFLAG_WINDOWS:=--subsystem=windows
|
|||
LDFLAG_NATIVE:=--subsystem=native
|
||||
|
||||
LDFLAG_EXCLUDE_ALL_SYMBOLS=-exclude-all-symbols
|
||||
DLLTOOL_FLAGS=--kill-at
|
||||
ifeq ($(ARCH),amd64)
|
||||
DLLTOOL_FLAGS= --no-leading-underscore
|
||||
endif
|
||||
|
||||
#~ #(module, objs, deps, ldflags, output, def, libs, entry, base)
|
||||
#(module, objs, deps, ldflags, output, def, libs, entry, base, extralibs)
|
||||
|
@ -14,15 +18,15 @@ define RBUILD_LINK
|
|||
ifneq ($(6),)
|
||||
${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib${call RBUILD_name,$(5)}.a: $(6) | ${call RBUILD_intermediate_path,$(5)}
|
||||
$$(ECHO_IMPLIB)
|
||||
$${dlltool} --def $(6) --kill-at --output-lib=$$@
|
||||
$${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-lib=$$@
|
||||
|
||||
${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib${call RBUILD_name,$(5)}.delayimp.a: $(6) | ${call RBUILD_intermediate_path,$(5)}
|
||||
$$(ECHO_IMPLIB)
|
||||
$${dlltool} --def $(6) --kill-at --output-delaylib=$$@
|
||||
$${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-delaylib=$$@
|
||||
|
||||
${call RBUILD_intermediate_path_noext,$(5)}.exp: $(6) | ${call RBUILD_intermediate_path,$(5)}
|
||||
$$(ECHO_IMPLIB)
|
||||
$${dlltool} --def $(6) --kill-at --output-exp=$$@
|
||||
$${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-exp=$$@
|
||||
|
||||
$(1)_CLEANFILES+=\
|
||||
${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib$(notdir $(5)).a \
|
||||
|
|
|
@ -1364,7 +1364,7 @@ Module::GetEntryPoint() const
|
|||
if (entrypoint == "0" || entrypoint == "0x0")
|
||||
return "0";
|
||||
|
||||
if (Environment::GetArch() != "arm")
|
||||
if (Environment::GetArch() != "arm" && Environment::GetArch() != "amd64")
|
||||
result = "_";
|
||||
|
||||
result += entrypoint;
|
||||
|
|
Loading…
Reference in a new issue