mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[FREELDR] Move common x64 runtime-specific ASM helpers to a misc file.
Co-authored-by: Justin Miller <justinmiller100@gmail.com>
This commit is contained in:
parent
557306f5c0
commit
7a2aca423e
3 changed files with 39 additions and 34 deletions
|
@ -163,6 +163,7 @@ elseif(ARCH STREQUAL "amd64")
|
|||
list(APPEND FREELDR_COMMON_ASM_SOURCE
|
||||
arch/amd64/entry.S
|
||||
arch/amd64/int386.S
|
||||
arch/amd64/misc.S
|
||||
arch/amd64/pnpbios.S
|
||||
arch/amd64/linux.S)
|
||||
|
||||
|
|
|
@ -212,40 +212,6 @@ CallRealMode_return:
|
|||
|
||||
/////////////////////////////////////////
|
||||
|
||||
|
||||
// void __fastfail(unsigned int Code<rcx>);
|
||||
PUBLIC __fastfail
|
||||
__fastfail:
|
||||
// mov ecx, [rsp + 4]
|
||||
int HEX(29)
|
||||
|
||||
// void __lgdt(void *Source<rcx>);
|
||||
PUBLIC __lgdt
|
||||
__lgdt:
|
||||
#ifdef _USE_ML
|
||||
lgdt fword ptr [rcx]
|
||||
#else
|
||||
lgdt cs:[rcx]
|
||||
#endif
|
||||
ret
|
||||
|
||||
// void __ltr(unsigned short Source<rcx>);
|
||||
PUBLIC __ltr
|
||||
__ltr:
|
||||
ltr cx
|
||||
ret
|
||||
|
||||
// void _sgdt(void *Destination<rcx>);
|
||||
PUBLIC __sgdt
|
||||
__sgdt:
|
||||
#ifdef _USE_ML
|
||||
sgdt fword ptr [rcx]
|
||||
#else
|
||||
sgdt cs:[rcx]
|
||||
#endif
|
||||
ret
|
||||
|
||||
|
||||
/* 64-bit stack pointer */
|
||||
stack64:
|
||||
.quad STACKADDR
|
||||
|
|
38
boot/freeldr/freeldr/arch/amd64/misc.S
Normal file
38
boot/freeldr/freeldr/arch/amd64/misc.S
Normal file
|
@ -0,0 +1,38 @@
|
|||
|
||||
#include <asm.inc>
|
||||
|
||||
.code64
|
||||
|
||||
// void __fastfail(unsigned int Code<rcx>);
|
||||
PUBLIC __fastfail
|
||||
__fastfail:
|
||||
// mov ecx, [rsp + 4]
|
||||
int HEX(29)
|
||||
|
||||
// void __lgdt(void *Source<rcx>);
|
||||
PUBLIC __lgdt
|
||||
__lgdt:
|
||||
#ifdef _USE_ML
|
||||
lgdt fword ptr [rcx]
|
||||
#else
|
||||
lgdt cs:[rcx]
|
||||
#endif
|
||||
ret
|
||||
|
||||
// void __ltr(unsigned short Source<rcx>);
|
||||
PUBLIC __ltr
|
||||
__ltr:
|
||||
ltr cx
|
||||
ret
|
||||
|
||||
// void _sgdt(void *Destination<rcx>);
|
||||
PUBLIC __sgdt
|
||||
__sgdt:
|
||||
#ifdef _USE_ML
|
||||
sgdt fword ptr [rcx]
|
||||
#else
|
||||
sgdt cs:[rcx]
|
||||
#endif
|
||||
ret
|
||||
|
||||
END
|
Loading…
Reference in a new issue