https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7a2aca423e7a8093bc113…
commit 7a2aca423e7a8093bc1132ae3a6efb4c7d131ac2
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Mar 9 17:26:38 2023 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Mar 18 22:40:08 2023 +0100
[FREELDR] Move common x64 runtime-specific ASM helpers to a misc file.
Co-authored-by: Justin Miller <justinmiller100(a)gmail.com>
---
boot/freeldr/freeldr/CMakeLists.txt | 1 +
boot/freeldr/freeldr/arch/amd64/entry.S | 34 -----------------------------
boot/freeldr/freeldr/arch/amd64/misc.S | 38 +++++++++++++++++++++++++++++++++
3 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt
index a295c481202..ad37aa7d200 100644
--- a/boot/freeldr/freeldr/CMakeLists.txt
+++ b/boot/freeldr/freeldr/CMakeLists.txt
@@ -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)
diff --git a/boot/freeldr/freeldr/arch/amd64/entry.S
b/boot/freeldr/freeldr/arch/amd64/entry.S
index 758eae4b677..588307984c5 100644
--- a/boot/freeldr/freeldr/arch/amd64/entry.S
+++ b/boot/freeldr/freeldr/arch/amd64/entry.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
diff --git a/boot/freeldr/freeldr/arch/amd64/misc.S
b/boot/freeldr/freeldr/arch/amd64/misc.S
new file mode 100644
index 00000000000..877d5fd75cb
--- /dev/null
+++ b/boot/freeldr/freeldr/arch/amd64/misc.S
@@ -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