and TSS_BASE_SEGMENT in i386_set_tss_and_kstack() (thanks Daniel for pointing this
out)).
Added a arch_thread_init_tls() function which fills the reserved slots - the find_thread()
inline asm in OS.h is finally working.
Added some more comments, resolved the ToDo items from last time :-)
arch_thread_context_switch() now calls set_tls_context() at the correct location.
arch_thread_enter_uspace() now calls set_tls_context() as there is no context
switch in this case for the current thread after TLS has been set up, and it
now gets a pointer to the thread structure directly, and calculates the user
stack top itself, rather than the callee.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2380 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed i386_set_kstack() to i386_set_tss_and_kstack(), because that's what
it does.
Added a new function arch_thread_init_tls() which must be called after
having allocated the TLS area.
Renamed arch_thread_initialize_kthread_stack() to arch_thread_init_kthread_stack()
to be more consistent.
Changed the parameters for arch_thread_enter_uspace() - it now gets a pointer
to the thread structure and takes the user stack pointer from there (which
might also be architectural different).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2379 a95241bf-73f2-0310-859d-f6bbb57e9c96
BeOS values commented beneath it.
For now MAIN_THREAD_STACK_SIZE is the same as STACK_SIZE.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2377 a95241bf-73f2-0310-859d-f6bbb57e9c96
We now have a separate errnop() for the kernel, which just references
a field in the thread structure.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2376 a95241bf-73f2-0310-859d-f6bbb57e9c96
in a header if it was included from assembler or not (if anybody knows a better
way how to solve this, feel free to speak, I haven't found anything :).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2367 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
I was too lazy to revert that little change back, so that I would be able
to write this short paragraph explaining what I've done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2364 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved the tss_descriptor structure to descriptor.h, updated it to be a
segment_descriptor structure, and provided inlines for set_tss_descriptor(),
set_segment_descriptor(), set_segment_descriptor_base(), and
clear_segment_descriptor().
Also added defines for the different privilege levels and descriptor types.
Removed the unusused and incorrect TSS definition, introduced new
TSS_BASE_SEGMENT and TLS_BASE_SEGMENT macros.
Removed include of arch/cpu.h in arch_cpu.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2360 a95241bf-73f2-0310-859d-f6bbb57e9c96
returned a (void *) instead of a (void **)).
Added TLS_MAX_KEYS macro, and a comment.
Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2359 a95241bf-73f2-0310-859d-f6bbb57e9c96
kernel header directory - they are by no means public includes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2349 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added foundation for font classes.
Still not in build (on purpose)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2342 a95241bf-73f2-0310-859d-f6bbb57e9c96
Configuration Manager, once this is implemented.
Needed for the "listdev" command and the Devices preferences application.
Not tested!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2339 a95241bf-73f2-0310-859d-f6bbb57e9c96