From 28c8b7fbec5cd409882855fc97a9f78a31a4a694 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Feb 2010 04:58:09 +0000 Subject: [PATCH] [AMD64] Switch from underscore prefixed symbols to unprefixed symbols. (MSVC compatibility) svn path=/branches/ros-amd64-bringup/; revision=45410 --- reactos/ReactOS-amd64.rbuild | 3 + .../boot/freeldr/freeldr/arch/amd64/arch.S | 76 +++--- .../boot/freeldr/freeldr/arch/amd64/boot.S | 6 +- .../boot/freeldr/freeldr/arch/amd64/drvmap.S | 8 +- .../boot/freeldr/freeldr/arch/amd64/i386cpu.S | 6 +- .../boot/freeldr/freeldr/arch/amd64/i386pnp.S | 6 +- .../freeldr/freeldr/arch/amd64/i386trap.S | 4 +- .../boot/freeldr/freeldr/arch/amd64/int386.S | 2 +- reactos/boot/freeldr/freeldr/arch/amd64/mb.S | 24 +- reactos/hal/halx86/generic/amd64/irq.S | 86 +++--- reactos/hal/halx86/generic/amd64/systimer.S | 39 +-- reactos/hal/halx86/mp/amd64/mps.S | 75 +++--- reactos/include/reactos/asm.h | 21 +- .../include/freebsd/src/sys/sys/kernel.h | 5 + reactos/lib/rtl/amd64/debug_asm.S | 49 ++-- reactos/lib/rtl/amd64/except_asm.S | 23 +- reactos/lib/rtl/amd64/rtlmem.S | 36 ++- reactos/lib/rtl/amd64/slist.S | 91 ++++--- reactos/lib/sdk/crt/except/amd64/chkstk_asm.s | 7 +- reactos/lib/sdk/crt/math/amd64/alldiv.S | 12 +- reactos/lib/sdk/crt/math/amd64/atan.S | 10 +- reactos/lib/sdk/crt/math/amd64/atan2.S | 10 +- reactos/lib/sdk/crt/math/amd64/ceil.S | 9 +- reactos/lib/sdk/crt/math/amd64/ceilf.S | 10 +- reactos/lib/sdk/crt/math/amd64/exp.S | 9 +- reactos/lib/sdk/crt/math/amd64/fabs.S | 9 +- reactos/lib/sdk/crt/math/amd64/floor.S | 10 +- reactos/lib/sdk/crt/math/amd64/floorf.S | 10 +- reactos/lib/sdk/crt/math/amd64/fmod.S | 10 +- reactos/lib/sdk/crt/math/amd64/fmodf.S | 10 +- reactos/lib/sdk/crt/math/amd64/ldexp.S | 10 +- reactos/lib/sdk/crt/math/amd64/log.S | 10 +- reactos/lib/sdk/crt/math/amd64/log10.S | 9 +- reactos/lib/sdk/crt/math/amd64/pow.S | 9 +- reactos/lib/sdk/crt/math/amd64/sqrt.S | 10 +- reactos/lib/sdk/crt/math/amd64/sqrtf.S | 9 +- reactos/lib/sdk/crt/math/amd64/tan.S | 10 +- reactos/lib/sdk/crt/setjmp/amd64/setjmp.s | 18 +- reactos/ntoskrnl/ke/amd64/boot.S | 19 +- reactos/ntoskrnl/ke/amd64/ctxswitch.S | 22 +- reactos/ntoskrnl/ke/amd64/trap.S | 246 +++++++++--------- reactos/ntoskrnl/mm/amd64/page.c | 5 - reactos/tools/nci/ncitool.c | 4 +- .../tools/rbuild/backend/mingw/linkers/ld.mak | 10 +- reactos/tools/rbuild/module.cpp | 2 +- 45 files changed, 523 insertions(+), 546 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index c2b0e711477..4faae306bdd 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -34,6 +34,7 @@ -U_X86_ -Wno-format + -fno-leading-underscore @@ -42,6 +43,8 @@ -section-alignment=0x1000 --unique=.eh_frame -static + -fno-leading-underscore + --exclude-all-symbols diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S index 0f6c257e34a..9def109221c 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S @@ -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 diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/boot.S b/reactos/boot/freeldr/freeldr/arch/amd64/boot.S index ce7bb355c90..eb3ba3c3c64 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/boot.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/boot.S @@ -24,14 +24,14 @@ #include -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 diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S b/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S index d6b081ca60b..6871fe0f62d 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S @@ -24,7 +24,7 @@ #include -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) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S index 6dfb91dbf4a..ee3ee6fe256 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S @@ -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 diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S index ff0ae71eb1a..19589275bac 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S @@ -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 diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S index 833fcc37104..195bf097cd0 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S @@ -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 diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/int386.S b/reactos/boot/freeldr/freeldr/arch/amd64/int386.S index 1c1f2dbdf0a..a22e409c61c 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/int386.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/int386.S @@ -63,7 +63,7 @@ Int386_regsout: /* * int Int386(int ivec, REGS* in, REGS* out); */ -EXTERN(_Int386) +EXTERN(Int386) .code64 /* Get the function parameters */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S index 368338ed33b..2d515e90053 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S @@ -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: diff --git a/reactos/hal/halx86/generic/amd64/irq.S b/reactos/hal/halx86/generic/amd64/irq.S index 15934cde4dd..55f20b93d00 100644 --- a/reactos/hal/halx86/generic/amd64/irq.S +++ b/reactos/hal/halx86/generic/amd64/irq.S @@ -7,65 +7,40 @@ /* INCLUDES ******************************************************************/ -#include -#include -.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 +#include /* 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 diff --git a/reactos/hal/halx86/generic/amd64/systimer.S b/reactos/hal/halx86/generic/amd64/systimer.S index 2a7dcff56f3..3041d734956 100644 --- a/reactos/hal/halx86/generic/amd64/systimer.S +++ b/reactos/hal/halx86/generic/amd64/systimer.S @@ -7,8 +7,8 @@ /* INCLUDES ******************************************************************/ -#include -#include +#include +#include /* 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 diff --git a/reactos/hal/halx86/mp/amd64/mps.S b/reactos/hal/halx86/mp/amd64/mps.S index 219d651498c..35436520ae6 100644 --- a/reactos/hal/halx86/mp/amd64/mps.S +++ b/reactos/hal/halx86/mp/amd64/mps.S @@ -8,84 +8,85 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include /* 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 diff --git a/reactos/include/reactos/asm.h b/reactos/include/reactos/asm.h index d0a911ec792..42b55783f66 100644 --- a/reactos/include/reactos/asm.h +++ b/reactos/include/reactos/asm.h @@ -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__, diff --git a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/kernel.h b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/kernel.h index 2d42aee9f5c..18f031a900c 100644 --- a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/kernel.h +++ b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/kernel.h @@ -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) diff --git a/reactos/lib/rtl/amd64/debug_asm.S b/reactos/lib/rtl/amd64/debug_asm.S index 82c96474b2b..c115feb12fc 100644 --- a/reactos/lib/rtl/amd64/debug_asm.S +++ b/reactos/lib/rtl/amd64/debug_asm.S @@ -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 /* 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, // = [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 diff --git a/reactos/lib/rtl/amd64/except_asm.S b/reactos/lib/rtl/amd64/except_asm.S index 2937335a45d..a4b35079fcd 100644 --- a/reactos/lib/rtl/amd64/except_asm.S +++ b/reactos/lib/rtl/amd64/except_asm.S @@ -8,24 +8,25 @@ /* INCLUDES ******************************************************************/ -#include -.intel_syntax noprefix +#include +#include /* FUNCTIONS *****************************************************************/ +.code64 + /* * VOID NTAPI * RtlCaptureContext( * PCONTEXT ContextRecord); */ -.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 + diff --git a/reactos/lib/rtl/amd64/rtlmem.S b/reactos/lib/rtl/amd64/rtlmem.S index 81154735373..d0a82068251 100644 --- a/reactos/lib/rtl/amd64/rtlmem.S +++ b/reactos/lib/rtl/amd64/rtlmem.S @@ -8,10 +8,12 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include /* 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 diff --git a/reactos/lib/rtl/amd64/slist.S b/reactos/lib/rtl/amd64/slist.S index 3488fb5a8f3..766813667d5 100644 --- a/reactos/lib/rtl/amd64/slist.S +++ b/reactos/lib/rtl/amd64/slist.S @@ -6,9 +6,8 @@ * PROGRAMMERS: Timo Kreuzer */ -#include -#include -.intel_syntax noprefix +#include +#include #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 diff --git a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s index 9501c3555ef..c0c59b88cd7 100644 --- a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s +++ b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s @@ -8,8 +8,7 @@ /* INCLUDES ******************************************************************/ -#include -#include +#include .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 */ diff --git a/reactos/lib/sdk/crt/math/amd64/alldiv.S b/reactos/lib/sdk/crt/math/amd64/alldiv.S index 7221f5cc6b0..831ef50981b 100644 --- a/reactos/lib/sdk/crt/math/amd64/alldiv.S +++ b/reactos/lib/sdk/crt/math/amd64/alldiv.S @@ -8,21 +8,21 @@ /* INCLUDES ******************************************************************/ +#include #include -#include - -.intel_syntax noprefix /* DATA *********************************************************************/ - .globl __fltused -__fltused: +PUBLIC _fltused +_fltused: .long 0x9875 /* FUNCTIONS ****************************************************************/ +.code64 + .proc alldiv UNIMPLEMENTED alldiv ret -.endproc +.endp alldiv diff --git a/reactos/lib/sdk/crt/math/amd64/atan.S b/reactos/lib/sdk/crt/math/amd64/atan.S index ef871c356fb..3ba194931f4 100644 --- a/reactos/lib/sdk/crt/math/amd64/atan.S +++ b/reactos/lib/sdk/crt/math/amd64/atan.S @@ -8,14 +8,14 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc atan +PUBLIC atan +atan: UNIMPLEMENTED atan ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/atan2.S b/reactos/lib/sdk/crt/math/amd64/atan2.S index 15ac4b8422c..7cd29b93269 100644 --- a/reactos/lib/sdk/crt/math/amd64/atan2.S +++ b/reactos/lib/sdk/crt/math/amd64/atan2.S @@ -8,14 +8,14 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc atan2 +PUBLIC atan2 +atan2: UNIMPLEMENTED atan2 ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/ceil.S b/reactos/lib/sdk/crt/math/amd64/ceil.S index 1948364686e..dbee413f491 100644 --- a/reactos/lib/sdk/crt/math/amd64/ceil.S +++ b/reactos/lib/sdk/crt/math/amd64/ceil.S @@ -8,14 +8,15 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc ceil +PUBLIC ceil +ceil: UNIMPLEMENTED ceil ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/ceilf.S b/reactos/lib/sdk/crt/math/amd64/ceilf.S index 9c887798d71..e3a948fff8a 100644 --- a/reactos/lib/sdk/crt/math/amd64/ceilf.S +++ b/reactos/lib/sdk/crt/math/amd64/ceilf.S @@ -8,13 +8,15 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.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 diff --git a/reactos/lib/sdk/crt/math/amd64/exp.S b/reactos/lib/sdk/crt/math/amd64/exp.S index bd4a8d0e69b..ca3dc993182 100644 --- a/reactos/lib/sdk/crt/math/amd64/exp.S +++ b/reactos/lib/sdk/crt/math/amd64/exp.S @@ -8,14 +8,15 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc exp +PUBLIC exp +exp: UNIMPLEMENTED exp ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/fabs.S b/reactos/lib/sdk/crt/math/amd64/fabs.S index 2282de1488d..e58b960ecab 100644 --- a/reactos/lib/sdk/crt/math/amd64/fabs.S +++ b/reactos/lib/sdk/crt/math/amd64/fabs.S @@ -8,14 +8,15 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc fabs +PUBLIC fabs +fabs: UNIMPLEMENTED fabs ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/floor.S b/reactos/lib/sdk/crt/math/amd64/floor.S index a08e4fc84ed..f1c3b9305af 100644 --- a/reactos/lib/sdk/crt/math/amd64/floor.S +++ b/reactos/lib/sdk/crt/math/amd64/floor.S @@ -8,14 +8,14 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* FUNCTIONS ****************************************************************/ +.code64 -.proc floor +PUBLIC floor +floor: UNIMPLEMENTED floor ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/floorf.S b/reactos/lib/sdk/crt/math/amd64/floorf.S index 900f8e62024..e2d02202df7 100644 --- a/reactos/lib/sdk/crt/math/amd64/floorf.S +++ b/reactos/lib/sdk/crt/math/amd64/floorf.S @@ -8,13 +8,15 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.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 diff --git a/reactos/lib/sdk/crt/math/amd64/fmod.S b/reactos/lib/sdk/crt/math/amd64/fmod.S index 1ad26d93511..4ca67f55bfb 100644 --- a/reactos/lib/sdk/crt/math/amd64/fmod.S +++ b/reactos/lib/sdk/crt/math/amd64/fmod.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc fmod +PUBLIC fmod +fmod: UNIMPLEMENTED fmod ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/fmodf.S b/reactos/lib/sdk/crt/math/amd64/fmodf.S index 966ceffec40..e109c387cc8 100644 --- a/reactos/lib/sdk/crt/math/amd64/fmodf.S +++ b/reactos/lib/sdk/crt/math/amd64/fmodf.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc fmodf +PUBLIC fmodf +fmodf: UNIMPLEMENTED fmodf ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/ldexp.S b/reactos/lib/sdk/crt/math/amd64/ldexp.S index 9d4649c66eb..d0265629bf6 100644 --- a/reactos/lib/sdk/crt/math/amd64/ldexp.S +++ b/reactos/lib/sdk/crt/math/amd64/ldexp.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc ldexp +PUBLIC ldexp +ldexp: UNIMPLEMENTED ldexp ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/log.S b/reactos/lib/sdk/crt/math/amd64/log.S index f4190d3e286..9fa02763b9e 100644 --- a/reactos/lib/sdk/crt/math/amd64/log.S +++ b/reactos/lib/sdk/crt/math/amd64/log.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc log +PUBLIC log +log: UNIMPLEMENTED log ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/log10.S b/reactos/lib/sdk/crt/math/amd64/log10.S index 1f9c77aaf5f..007f0d80e98 100644 --- a/reactos/lib/sdk/crt/math/amd64/log10.S +++ b/reactos/lib/sdk/crt/math/amd64/log10.S @@ -8,14 +8,13 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc log10 +PUBLIC log10 +log10: UNIMPLEMENTED log10 ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/pow.S b/reactos/lib/sdk/crt/math/amd64/pow.S index 05ef3f9c693..37988801b11 100644 --- a/reactos/lib/sdk/crt/math/amd64/pow.S +++ b/reactos/lib/sdk/crt/math/amd64/pow.S @@ -8,14 +8,13 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc pow +PUBLIC pow +pow: UNIMPLEMENTED pow ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/sqrt.S b/reactos/lib/sdk/crt/math/amd64/sqrt.S index 48db2fde91e..758d8768d4f 100644 --- a/reactos/lib/sdk/crt/math/amd64/sqrt.S +++ b/reactos/lib/sdk/crt/math/amd64/sqrt.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc sqrt +PUBLIC sqrt +sqrt: UNIMPLEMENTED sqrt ret - -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/sqrtf.S b/reactos/lib/sdk/crt/math/amd64/sqrtf.S index 50ea81033ac..a4ee3fa6cc5 100644 --- a/reactos/lib/sdk/crt/math/amd64/sqrtf.S +++ b/reactos/lib/sdk/crt/math/amd64/sqrtf.S @@ -8,13 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc sqrtf +PUBLIC sqrtf +sqrtf: sqrtss xmm0, xmm0 ret -.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/tan.S b/reactos/lib/sdk/crt/math/amd64/tan.S index 225c3acc66a..a7c66d0ccd7 100644 --- a/reactos/lib/sdk/crt/math/amd64/tan.S +++ b/reactos/lib/sdk/crt/math/amd64/tan.S @@ -8,14 +8,12 @@ /* INCLUDES ******************************************************************/ +#include #include -#include -.intel_syntax noprefix +/* DATA *********************************************************************/ - -.proc tan +PUBLIC tan +tan: UNIMPLEMENTED tan ret - -.endproc diff --git a/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s b/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s index 800a0b152b5..9d63eb27157 100644 --- a/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s +++ b/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s @@ -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 diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index 19b99adb4c2..d99b9d5aebf 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -8,15 +8,16 @@ /* INCLUDES ******************************************************************/ -#include -.intel_syntax noprefix -.code64 +#include +#include + /* GLOBALS *******************************************************************/ /* FUNCTIONS *****************************************************************/ +.code64 .text /** @@ -29,9 +30,8 @@ * IN CCHAR Number, * IN PLOADER_PARAMETER_BLOCK LoaderBlock) */ -.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 diff --git a/reactos/ntoskrnl/ke/amd64/ctxswitch.S b/reactos/ntoskrnl/ke/amd64/ctxswitch.S index 72b0b7d3a8b..84f549958a5 100644 --- a/reactos/ntoskrnl/ke/amd64/ctxswitch.S +++ b/reactos/ntoskrnl/ke/amd64/ctxswitch.S @@ -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] diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index 3a4296ff8e6..051daed266f 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -10,20 +10,20 @@ #include #include -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 diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index d83cace3412..a96e519140a 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -13,11 +13,6 @@ #define NDEBUG #include -#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) diff --git a/reactos/tools/nci/ncitool.c b/reactos/tools/nci/ncitool.c index d002a18c157..07838af1efa 100644 --- a/reactos/tools/nci/ncitool.c +++ b/reactos/tools/nci/ncitool.c @@ -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, diff --git a/reactos/tools/rbuild/backend/mingw/linkers/ld.mak b/reactos/tools/rbuild/backend/mingw/linkers/ld.mak index 9c2a0bd1986..d97e40bd2ec 100644 --- a/reactos/tools/rbuild/backend/mingw/linkers/ld.mak +++ b/reactos/tools/rbuild/backend/mingw/linkers/ld.mak @@ -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 \ diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index e8d8e250722..5e4071d65dd 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -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;