19321ae5a8
at all, and assumes a fixed and wrong number of preallocated GDT entries. Implemented TLS: there is one GDT entry per CPU. If a context switch happens, the FS register of the new thread is set to the matching GDT, and the GDT is changed so that it points to the current thread's TLS storage area. This area currently resides unsafely at the bottom of the user stack - for some reason I could not figure out, it doesn't even work correctly most of the time (it segfaults when accessing a slot via FS). I've added a ToDo item explaining the situation - hopefully I have more ideas when I slept a bit more... The GDT is now no longer static in arch_cpu.c and has been renamed from gdt to gGDT. It's now also referenced in arch_thread.c, and it would make sense for arch_selector.c to use it as well (instead of another local copy). arch_cpu_init2() now uses the set_tss_descriptor() inline function and the TSS_BASE_SEGMENT macro to set up the TSS section. It now also sets up the TLS segment descriptors (as TSS, one entry per CPU). Since I removed desc_table from the headers (the GDT is now a (segment_descriptor *)), I added it locally to arch_int.c. i386_enter_uspace() now don't set the FS register to 0x23 anymore, since it's now already set correctly at the end of arch_thread_context_switch(). Some clean-ups. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2366 a95241bf-73f2-0310-859d-f6bbb57e9c96 |
||
---|---|---|
.. | ||
apps | ||
boot | ||
core | ||
drivers | ||
glue | ||
ldscripts | ||
libroot | ||
vm2 | ||
Jamfile | ||
TODO |