History log of /haiku/src/system/kernel/syscalls.cpp
Revision Date Author Comments
# f66d2b46 26-Jul-2023 Augustin Cavalier <waddlesplash@gmail.com>

kernel: Add event queue implementation to wait for objects efficiently.

Based on hamishm's original patch from 2015, but heavily modified,
refactored, and reworked.

From the original commit message:

> When an object is deleted, a B_EVENT_INVALID event is delivered,
> and the object is unregistered from the queue.
>
> The special event flag B_EVENT_ONE_SHOT can be passed in when adding
> an object so that the object is automatically unregistered when an
> event is delivered.

Modifications to the original change include:

* Removed the public interface (syscalls remain private for the moment)

* Event list queueing/dequeueing almost entirely rewritten, including:
- Clear events field when dequeueing.

- Have B_EVENT_QUEUED actually indicate whether the event has been
appended to the linked list (or not), based around lock state.
The previous logic was prone to races and double-insertions.

- "Modify" is now just "Deselect + Select" performed at once;
previously it could cause use-after-frees.

- Unlock for deselect only once at the end of dequeue.

- Handle INVALID events still in the queue upon destruction,
fixing memory leaks.

* Deduplified code with wait_for_objects.

* Use of C++ virtual dispatch instead of C-style enum + function calls,
and BReferenceable plus destructors for teardown.

* Removed select/modify/delete flags. Select/Modify are now the same
operation on the syscall interface, and "Delete" is done when 0
is passed for "events". Additionally, the events selected can be fetched
by passing -1 for "events".

* Implemented level-triggered mode.

* Use of BStackOrHeapArray and other convenience routines in syscalls.

Change-Id: I1d2f094fd981c95215a59adbc087523c7bbbe40b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6745
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 33dc8de5 04-May-2018 Jérôme Duval <jerome.duval@gmail.com>

kernel: remove incorrect inline and static keywords for syscalls.


# dac7b7c9 06-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix various 64 bit related warnings

Mostly printf() format strings and signed-unsigned comparisons.
Fixes the x86_64 build.


# 24df6592 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fe24651 01-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Building with syscall tracing obviously needs this header now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 813d4cbe 11-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved created subdirectory src/system/kernel/lock.cpp to new subdirectory
locks.
* Added syscalls for a new kind of mutex. A mutex consists only of an int32 and
doesn't require any kernel resources. So it's initialization cannot fail
(it consists only of setting the mutex value to 0). An uncontended lock or
unlock operation can basically consist of an atomic_*() in userland. The
syscalls (when the mutex is contended) are a bit more expensive than semaphore
operations, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e50cf876 02-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the VM headers into subdirectory vm/.
* Renamed vm_cache.h/vm_address_space.h to VMCache.h/VMAddressSpace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34449 a95241bf-73f2-0310-859d-f6bbb57e9c96


# be62abaf 30-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Use a condition variable when waiting for a syscall to be done calling.
* Use C++ DoublyLinkedList class instead of the struct list.
* Note, this code is untested yet, but I will test it now (Qemu doesn't work
on Haiku anymore for some reason) :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34382 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fddd06 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Introduced a flag to decide whether it's still okay to call a certain
syscall.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23f179da 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34237 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 24ce75c3 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a use counter for the syscalls, so that they are no longer removed
while a hook is called.
* This closes ticket #5027.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34233 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e2ae69da 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

The kernel side of a new system-wide sampling-based profiling mechanism.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30127 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca7cb625 17-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40dae370 11-Sep-2008 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Adding msg{rcv,snd,get,ctl} syscalls to the system
* Add message queue init function call to main.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 47ca7595 28-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

First patch by Salvatore to implement XSI semaphores with a few changes
by myself:
* renamed xsi_do_undo() to xsi_sem_undo() (there is more to XSI than sems).
* Fixed coding style issues in sys/sem.h and xsi_sem.cpp.
* Added _kern_*() syscall prototypes to syscalls.h.
* Added a TODO in xsi_sem.cpp and xsi_semaphore.h about moving union semun to
a shared header.
* Made the team::xsi_sem_undo_requests int32 - due to padding, it would have
needed 4 bytes anyway; please always use specific types over int/short/long.
* xsi_sem_undo() now checks if it needs to do anything - the calls in team.cpp
no longer needs to do this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5b3a6a7 05-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

* Initialize all static mutexes in the kernel through a MUTEX_INITIALIZER()
and remove the then unneeded mutex_init() for them.
* Remove the workaround for allowing uninitialized mutexes on kernel startup.
As they are all initialized statically through the MUTEX_INITIALIZER() now
this is not needed anymore.
* An uninitialized mutex will now cause a panic when used to find possibly
remaining cases.
* Remove now unnecessary driver_settings_init_post_sem() function.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25812 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98e67131 06-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved realtime_sem.{cpp,h} into new posix subdirectory.
* Renamed the old kernel_posix[_arch...].o to kernel_lib_posix...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25336 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5142c2ac 05-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for POSIX semaphores (the ones from the XSI extension
Realtime option group). The implementation should be complete, but is
totally untested yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c615a01 01-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed old mutex implementation and renamed cutex to mutex.
* Trivial adjustments of code using mutexes. Mostly removing the
mutex_init() return value check.
* Added mutex_lock_threads_locked(), which is called with the threads
spinlock being held. The spinlock is released while waiting, of
course. This function is useful in cases where the existence of the
mutex object is ensured by holding the threads spinlock.
* Changed the two instances in the VFS code where an IO context of
another team needs to be locked to use mutex_lock_threads_locked().
Before it required a semaphore-based mutex implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bf15ffc 27-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed macros that enable tracing for individual components from
defined/undefined to numeric values (0 for undefined). This allows for
trace levels.
* Set SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT default to 1, since this is
what one usually wants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25213 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93027f44 22-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added "straced" debugger command which basically works like "traced",
but also prints post syscall entries not matching the filter, if the
respective pre syscall entry matched. This way one also sees the syscall
return values. Works only in forward direction ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25095 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 446d50a6 10-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unused _kern_socket() dummy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24907 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6044b22d 14-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added new macro SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT to disable tracing
for the _kern_ktrace_output() syscall.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24392 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4eb35609 11-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added real, effective and saved set- user and group IDs to the team
structure. They are properly inherited and updated on
fork(), load_image(), and exec().
* Implemented the get[e]{u,g}id(), set[[r]e]{u,g}id() family for real.
* getgroups() also calls the kernel now, but only returns the effective
group ID. Supplementary groups support is still missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c221f53 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also check the syscall number to avoid problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23920 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 38562791 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Debug code. From time to time I still see 64 bit return values when they
should be 32 bit only.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23917 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34aae00f 31-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Syscall tracing no longer fetches the string parameter of the
_kern_ktrace_output() syscall, since it will be stored in a separate
entry anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b4f58d87 21-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab23dfa7 19-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved tracing macro definitions into separate tracing_config.h header.
So now there's a central place to enable tracing in general and for
individual components.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23645 a95241bf-73f2-0310-859d-f6bbb57e9c96


# adf78fda 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

TraceBuffer simplifies things a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8d3d1be1 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Kernel tracing of syscalls uses more information about the syscall
parameters, now. We print 64 bit values correctly, and also fetch
strings from userland and print them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23620 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 548dcc60 17-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* syscalls.c -> syscalls.cpp
* With post syscall debugging enabled, the x86 syscall handling didn't
remove all parameters from the stack after calling the respective user
debugger hook. Should have been harmless though, since the following
code didn't rely on the stack being in order.
* Added syscall pre/post (kernel) tracing functions
trace_{pre,post}_syscall(). They are generic, but need to be invoked
by the architecture specific syscall code. Currently only done for
x86.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23600 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dac7b7c9805cb3c1291a98ceacb4dea94b0cfd65 06-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix various 64 bit related warnings

Mostly printf() format strings and signed-unsigned comparisons.
Fixes the x86_64 build.


# 24df65921befcd0ad0c5c7866118f922da61cb96 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fe246510a809e8227573666fd0a9e6aee828e09 01-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Building with syscall tracing obviously needs this header now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 813d4cbe94b99e33ac2b921ae76df4d1b2b39b40 11-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved created subdirectory src/system/kernel/lock.cpp to new subdirectory
locks.
* Added syscalls for a new kind of mutex. A mutex consists only of an int32 and
doesn't require any kernel resources. So it's initialization cannot fail
(it consists only of setting the mutex value to 0). An uncontended lock or
unlock operation can basically consist of an atomic_*() in userland. The
syscalls (when the mutex is contended) are a bit more expensive than semaphore
operations, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e50cf8765be50a7454c9488db38b638cf90805af 02-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the VM headers into subdirectory vm/.
* Renamed vm_cache.h/vm_address_space.h to VMCache.h/VMAddressSpace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34449 a95241bf-73f2-0310-859d-f6bbb57e9c96


# be62abafab1c7e8da620db37f63eb67a44c704f2 30-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Use a condition variable when waiting for a syscall to be done calling.
* Use C++ DoublyLinkedList class instead of the struct list.
* Note, this code is untested yet, but I will test it now (Qemu doesn't work
on Haiku anymore for some reason) :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34382 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fddd06d61711b567419ca3e55fb393fddfd582 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Introduced a flag to decide whether it's still okay to call a certain
syscall.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23f179da55b1bd1ba84fbf3d3c56947e2c8d0aca 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34237 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 24ce75c3d8856d9b51b08fcbc848d3b205046a50 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a use counter for the syscalls, so that they are no longer removed
while a hook is called.
* This closes ticket #5027.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34233 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e2ae69da521f652fa907f3119179ea5674f6a1a0 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

The kernel side of a new system-wide sampling-based profiling mechanism.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30127 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca7cb625b9769be2657365e2137197bdc3a9692d 17-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40dae3708fbc0d84a0a2a4bd2cf024992c03db0d 11-Sep-2008 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Adding msg{rcv,snd,get,ctl} syscalls to the system
* Add message queue init function call to main.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 47ca7595ca54e08dac7482950a35b045e6ad8801 28-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

First patch by Salvatore to implement XSI semaphores with a few changes
by myself:
* renamed xsi_do_undo() to xsi_sem_undo() (there is more to XSI than sems).
* Fixed coding style issues in sys/sem.h and xsi_sem.cpp.
* Added _kern_*() syscall prototypes to syscalls.h.
* Added a TODO in xsi_sem.cpp and xsi_semaphore.h about moving union semun to
a shared header.
* Made the team::xsi_sem_undo_requests int32 - due to padding, it would have
needed 4 bytes anyway; please always use specific types over int/short/long.
* xsi_sem_undo() now checks if it needs to do anything - the calls in team.cpp
no longer needs to do this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5b3a6a7968b849c8cb3d06ffe6d19acccf910a8 05-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

* Initialize all static mutexes in the kernel through a MUTEX_INITIALIZER()
and remove the then unneeded mutex_init() for them.
* Remove the workaround for allowing uninitialized mutexes on kernel startup.
As they are all initialized statically through the MUTEX_INITIALIZER() now
this is not needed anymore.
* An uninitialized mutex will now cause a panic when used to find possibly
remaining cases.
* Remove now unnecessary driver_settings_init_post_sem() function.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25812 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98e67131727de15752bc87a530612040c6955d17 06-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved realtime_sem.{cpp,h} into new posix subdirectory.
* Renamed the old kernel_posix[_arch...].o to kernel_lib_posix...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25336 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5142c2ac86c0f020ffa3fc31cea9f1f2f1b6ef91 05-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for POSIX semaphores (the ones from the XSI extension
Realtime option group). The implementation should be complete, but is
totally untested yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c615a01ae49634aaf59fbe35b3d55b3bb8890df 01-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed old mutex implementation and renamed cutex to mutex.
* Trivial adjustments of code using mutexes. Mostly removing the
mutex_init() return value check.
* Added mutex_lock_threads_locked(), which is called with the threads
spinlock being held. The spinlock is released while waiting, of
course. This function is useful in cases where the existence of the
mutex object is ensured by holding the threads spinlock.
* Changed the two instances in the VFS code where an IO context of
another team needs to be locked to use mutex_lock_threads_locked().
Before it required a semaphore-based mutex implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bf15ffcdcfc62c39948e0e9449064e65b7f13bd 27-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed macros that enable tracing for individual components from
defined/undefined to numeric values (0 for undefined). This allows for
trace levels.
* Set SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT default to 1, since this is
what one usually wants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25213 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93027f442fa660b51233076697fc71aa3c2a2f7a 22-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added "straced" debugger command which basically works like "traced",
but also prints post syscall entries not matching the filter, if the
respective pre syscall entry matched. This way one also sees the syscall
return values. Works only in forward direction ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25095 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 446d50a652873fa983ad2560e67899e661272863 10-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unused _kern_socket() dummy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24907 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6044b22ddbbd0c9fa164050e5519f0d0c0e9f277 14-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added new macro SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT to disable tracing
for the _kern_ktrace_output() syscall.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24392 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4eb3560949b15e7492c8055eb512e5dd68b2da32 11-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added real, effective and saved set- user and group IDs to the team
structure. They are properly inherited and updated on
fork(), load_image(), and exec().
* Implemented the get[e]{u,g}id(), set[[r]e]{u,g}id() family for real.
* getgroups() also calls the kernel now, but only returns the effective
group ID. Supplementary groups support is still missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c221f53a32c44c2a59601cbd5df9106eaa4a2d5 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also check the syscall number to avoid problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23920 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 385627911cb6a34b4b8b9db171ad0d9a4bf9e5dd 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Debug code. From time to time I still see 64 bit return values when they
should be 32 bit only.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23917 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34aae00fe9cea8b7e2b6d55c59cdd90cf1f31e97 31-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Syscall tracing no longer fetches the string parameter of the
_kern_ktrace_output() syscall, since it will be stored in a separate
entry anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b4f58d8758380bc4ef224a1d2a05348fc1535e33 21-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab23dfa7f7621e7ca1e1bc8d99f0a1a55bc299ad 19-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved tracing macro definitions into separate tracing_config.h header.
So now there's a central place to enable tracing in general and for
individual components.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23645 a95241bf-73f2-0310-859d-f6bbb57e9c96


# adf78fdae2ed65f14678114c22eed483832a3e97 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

TraceBuffer simplifies things a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8d3d1be1ca5440df46747c45cae9330fc1089e6c 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Kernel tracing of syscalls uses more information about the syscall
parameters, now. We print 64 bit values correctly, and also fetch
strings from userland and print them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23620 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 548dcc600e2c1823ae0318215197db9725c52b21 17-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* syscalls.c -> syscalls.cpp
* With post syscall debugging enabled, the x86 syscall handling didn't
remove all parameters from the stack after calling the respective user
debugger hook. Should have been harmless though, since the following
code didn't rely on the stack being in order.
* Added syscall pre/post (kernel) tracing functions
trace_{pre,post}_syscall(). They are generic, but need to be invoked
by the architecture specific syscall code. Currently only done for
x86.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23600 a95241bf-73f2-0310-859d-f6bbb57e9c96