diff options
author | Luca Dariz <luca@orpolo.org> | 2023-04-19 21:47:03 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-05-01 03:30:18 +0200 |
commit | 31dd30a94a682955c3c9e2f42252b4a07687067a (patch) | |
tree | 66be830d547a1e9cbd1b9b7bbc0378398be089d8 /kern | |
parent | 660bc8ab3813737b3857648b7ec60d88494aeed1 (diff) | |
download | gnumach-31dd30a94a682955c3c9e2f42252b4a07687067a.tar.gz gnumach-31dd30a94a682955c3c9e2f42252b4a07687067a.tar.bz2 gnumach-31dd30a94a682955c3c9e2f42252b4a07687067a.zip |
add setting gs/fsbase
* i386/i386/i386asm.sym: add offsets for asm
* i386/i386/pcb.c: switch FSBASE/GSBASE on context switch and
implement accessors in thread setstatus/getstatus
* i386/i386/thread.h: add new state to thread saved state
* kern/thread.c: add i386_FSGS_BASE_STATE handler
* x86_64/locore.S: fix fs/gs handling, skipping the base address and
avoid resetting it by manually re-loading fs/gs
Message-Id: <20230419194703.410575-5-luca@orpolo.org>
Diffstat (limited to 'kern')
-rw-r--r-- | kern/thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c index 20c11024..a324eed7 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1472,6 +1472,9 @@ kern_return_t thread_set_state( if (flavor == i386_DEBUG_STATE && thread == current_thread()) /* This state can be set directly for the curren thread. */ return thread_setstatus(thread, flavor, new_state, new_state_count); + if (flavor == i386_FSGS_BASE_STATE && thread == current_thread()) + /* This state can be set directly for the curren thread. */ + return thread_setstatus(thread, flavor, new_state, new_state_count); #endif if (thread == THREAD_NULL || thread == current_thread()) |