summaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-07-29 19:47:53 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-04 23:47:34 +0200
commitaaa33bd1ef300380279d9e2875b61a7abaf2c88d (patch)
tree328ea0f1f94f06908893d1fd935e8447b97539cc /x86_64
parent55c6c03da81908fdf7de113e1b3c6efa758e82e7 (diff)
x86_64: remove unneeded segment selectors handling on full 64 bit
* i386/i386/db_interface.c: don't set unused segment selectors on full 64-bit * i386/i386/db_trace.c: likewise. * i386/i386/i386asm.sym: likewise. * i386/i386/pcb.c:: likewise. * i386/i386/thread.h: remove ES/DS/FS/GS from thread state on !USER32, as they are unused in this configuration. Only SS and CS are kept. * x86_64/locore.S: convert segment handling macros to no-op on full 64-bit Message-Id: <20230729174753.1145878-5-luca@orpolo.org>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/locore.S16
1 files changed, 5 insertions, 11 deletions
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 66a9436a..271a9071 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -94,8 +94,7 @@
pushq %fs ;\
pushq %gs
#else
-#define PUSH_SEGMENTS(reg) \
- subq $32,%rsp
+#define PUSH_SEGMENTS(reg)
#endif
#ifdef USER32
@@ -107,8 +106,7 @@
popq reg ;\
movq reg,%ds
#else
-#define POP_SEGMENTS(reg) \
- addq $32,%rsp
+#define POP_SEGMENTS(reg)
#endif
#ifdef USER32
@@ -120,8 +118,7 @@
pushq %fs ;\
pushq %gs
#else
-#define PUSH_SEGMENTS_ISR(reg) \
- subq $32,%rsp
+#define PUSH_SEGMENTS_ISR(reg)
#endif
#ifdef USER32
@@ -133,8 +130,7 @@
popq reg ;\
movq reg,%ds
#else
-#define POP_SEGMENTS_ISR(reg) \
- addq $32,%rsp
+#define POP_SEGMENTS_ISR(reg)
#endif
#ifdef USER32
@@ -639,9 +635,7 @@ _return_to_user:
*/
_return_from_kernel:
-#ifndef USER32
- addq $32,%rsp /* skip FS/GS selector */
-#else
+#ifdef USER32
_kret_popl_gs:
popq %gs /* restore segment registers */
_kret_popl_fs: