thread code now properly traces time spent in user vs kernel mode. The code was
just plain broken before
http://www.newos.org/cgi-bin/perfbrowse.perl?@describe+1704
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2599 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added a SIGNAL_TO_MASK() macro.
Removed the useless disable_interrupts() call in set_alarm().
More cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2584 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now directly exports (as is, most of) the kernel thread API.
Now has user_*() functions where needed.
Moved thread_set_priority() from scheduler.c to set_thread_priority().
Renamed thread_wait_on_thread() to wait_for_thread().
user_get_thread_info() now uses user_strlcpy() instead of user_strncpy().
Fixed the snooze() implementation - it now returns B_OK where appropriate. Now all snooze()
calls will call snooze_etc().
New private call spawn_kernel_thread_etc() to replace thread_create_kernel_thread_etc().
Moved some functions around.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2578 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in sigaction(): it would have crashed with act/oact == NULL (which
is perfectly legal).
Now directly exports the kernel API.
Now has user_*() calls where needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2577 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed team_wait_on_team() to wait_for_team() (more BeOS-alike).
Adapted to other changes (new thread functions).
Cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2576 a95241bf-73f2-0310-859d-f6bbb57e9c96
and don't have any functionality at this place.
Added new syscall for set_thread_priority().
Some other changes due to cleanup.
Fixed userland snooze() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2575 a95241bf-73f2-0310-859d-f6bbb57e9c96
have the scheduler_ prefix instead of thread_.
Moved thread_set_priority() back to thread.c where it belongs to.
Added new function to remove a thread from the run queue.
Renamed run_q to gRunQueue.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2572 a95241bf-73f2-0310-859d-f6bbb57e9c96
Actually never unlocked the daemon's lock (always called mutex_lock() instead
of mutex_unlock()...).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2568 a95241bf-73f2-0310-859d-f6bbb57e9c96
the vnodes of a mount structure).
Removed stubs for send_notification() and notify_listener() (they are now located
in message.c and node_monitor.c).
Added support for the node monitoring service.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2482 a95241bf-73f2-0310-859d-f6bbb57e9c96
unmounts is not yet implemented.
Added an empty implementation for send_notification() - the function that is
(or will be) able to send out BMessages from within the kernel; currently
just prints out what should be done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2481 a95241bf-73f2-0310-859d-f6bbb57e9c96
Adapted because of changing structure names (struct uspace_program_args).
Added comments, fill_team_info() now sets the team_info.image_count correctly.
Some cleanups and style changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2426 a95241bf-73f2-0310-859d-f6bbb57e9c96
arch_cpu: could have used the TLS_SIZE macro in one place, removed
a now unused variable, assignments to tss_loaded are now booleans.
thread.c: added the new fields to _dump_thread_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2393 a95241bf-73f2-0310-859d-f6bbb57e9c96
from the USER_STACK_REGION (until B_BASE_ADDRESS is available), made it much better
readable. It now grows from the lower USER_STACK_REGION up to the start of the main
thread's stack location.
Calls arch_thread_tls_init() and accounts for the TLS area in the stack region.
Added some comments, some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2382 a95241bf-73f2-0310-859d-f6bbb57e9c96
area. It now also calls arch_thread_init_tls(). Cleaned it up to make it more
readable, added some comments.
Some other cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2381 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
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
some structure definitions (to outline some basic ideas), and the symbols
exported to userland.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2214 a95241bf-73f2-0310-859d-f6bbb57e9c96
Some int -> cpu_state cleanup on the way, and implement the
B_KDEBUG_CONT and B_KDEBUG_QUIT features in our kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2173 a95241bf-73f2-0310-859d-f6bbb57e9c96
code and made it much simpler (it now just uses a stack of path names
instead of this complex doubly-linked module_iterator_dir list).
Now works together with the rest of the code without making any problems.
Added a module_test() function which iterates over all existing modules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2149 a95241bf-73f2-0310-859d-f6bbb57e9c96