haiku/src/kernel
Axel Dörfler 19321ae5a8 Temporarily removed arch_selector.c from the build - it's currently not used
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
2003-01-06 08:25:01 +00:00
..
apps Added a simple TLS test app. 2003-01-06 08:04:21 +00:00
boot might work better 2002-10-30 02:10:06 +00:00
core Temporarily removed arch_selector.c from the build - it's currently not used 2003-01-06 08:25:01 +00:00
drivers Add missing headers/os/drivers/KernelExport.h functions here and there. 2002-12-07 00:25:50 +00:00
glue adding environmental variables support 2002-07-18 14:07:56 +00:00
ldscripts It is accomplished ... 2002-07-09 12:24:59 +00:00
libroot Userland part of the TLS implementation for x86. 2003-01-06 08:05:09 +00:00
vm2 Changes to mmap to make COPY and SHARED work correctly (I hope) 2003-01-06 04:49:58 +00:00
Jamfile libroot/posix/signal is back in the build 2002-11-18 00:42:48 +00:00
TODO It is accomplished ... 2002-07-09 12:24:59 +00:00