#
efbeada7 |
|
21-Aug-2023 |
Jérôme Duval <jerome.duval@gmail.com> |
gnu: add sched_getcpu() on x86_64 implemented with rdtscp or rdpid, generically with a syscall. Change-Id: I8f776848bf35575abec8a8c612c4a25d8550daea Reviewed-on: https://review.haiku-os.org/c/haiku/+/6866 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
|
#
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>
|
#
f64c46e6 |
|
25-Jul-2023 |
Augustin Cavalier <waddlesplash@gmail.com> |
kernel & libroot: Implement per-team unnamed semaphores. This requires breaking syscall ABI to add the "flags" parameter to _kern_mutex_sem_release. Resolves a TODO.
|
#
93d7d1c5 |
|
12-Jun-2023 |
Augustin Cavalier <waddlesplash@gmail.com> |
user_mutex: Per-team contexts. This requires the introduction of the flag B_USER_MUTEX_SHARED, and then actually using the SHARED flags in pthread structures to determine when it should be passed through. This commit still uses wired memory even for per-team contexts. That will change in the next commit. GLTeapot FPS seems about the same. Change-Id: I749a00dcea1531e113a65299b6d6610f57511fcc Reviewed-on: https://review.haiku-os.org/c/haiku/+/6602 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
|
#
6f3f29c7 |
|
06-Jun-2023 |
Augustin Cavalier <waddlesplash@gmail.com> |
user_mutex: Refactor locking and unblocking mechanism. Suppose the following scenario: 1. Thread A holds a mutex. 2. Thread B goes to acquire the mutex, winds up in kernel waiting. 3. Thread A unlocks; first unsets the LOCKED flag. As WAITING is set, it calls the kernel; but instead of processing this immediately, the thread is suspended for any reason (locks, reschedule, etc.) 4. Thread B hits a timeout, or a signal. It then unblocks in the kernel, which causes the WAITING flag to be unset. 5. Thread C goes to acquire the lock. It sets the LOCKED flag. It sees the WAITING flag is not set, so it returns at once, having successfully acquired the lock. 6. Thread A, suspended back in step 3, resumes. Now we encounter the problem. Under the previous code, the following would occur. 7. Thread A sees that no threads are waiting. It thus unsets the LOCKED flag, and returns from the kernel. Now we have a mutex theoretically held by thread C but which (illegally) has no LOCKED flag set! 8. Some other thread tries to acquire the lock, and succeeds, for LOCKED is not set. We now have one lock owned by two separate threads. That's very bad! The solution, in this commit, is to (1) switch from using "atomic_or" to lock mutexes, to using "atomic_test_and_set", and (2) mandate that _kern_unblock_mutex must be invoked with the mutex already unlocked. Trying to solve the problem with (2) but without (1) produces other complications and would overall be more complicated. For instance, all existing userland code expected that it would set LOCKED, but then check LOCKED|WAITING. If _kern_mutex_unlock does not unset LOCKED, then whichever thread sets LOCKED when it was previously unset is now the mutex's undisputed owner, and if it fails to notice this, would deadlock. That could have been solved with extra checks at all lock points, but then that would mean locks would not be acquired "fairly": it would be possible for any thread to race with an unlocking thread, and acquire the lock before the kernel had a chance to wake anyone up. Given how fast atomics can be, and how slow invoking the kernel is comparatively, that would probably make our mutexes extremely "unfair." This would not violate the POSIX specification, but it does seem like a dangerous choice to make in implementing these APIs. Linux's "futex" API, which our API bears some similarities to, requires at least one atomic test-and-set for an uncontended acquisition, and multiple atomics more for even the simplest case of contended acquisition. If it works for them, it should work for us, too. Fixes #18436. Change-Id: Ib8c28acf04ce03234fe738e41aa0969ca1917540 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6537 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Reviewed-by: waddlesplash <waddlesplash@gmail.com>
|
#
b809279c |
|
15-May-2023 |
Trung Nguyen <trungnt282910@gmail.com> |
kernel/team: Allow retrieving more attributes - Stored the additional start time of each team, expressed by milliseconds since boot. - Added more fields to the `team_info` structure. These field include those provided by the `get_extended_team_info` syscall as well as the newly introduced `start_time`. - Extended the `_kern_get_team_info` system call to receive an additional `size_t` argument. If this size is smaller than or equal to the size of the old `team_info` structure, the newly added attributes will not be retrieved. Change-Id: I22ee6b91ad2ee3b66a7f770036c79a718c5f115c Reviewed-on: https://review.haiku-os.org/c/haiku/+/6390 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
|
#
914b10c1 |
|
11-Mar-2022 |
Jessica Hamilton <jessica.l.hamilton@gmail.com> |
wait_for_thread_etc: expose as syscall/make public. * This will be needed for the following commit that implements `pthread_tryjoin_np` and `pthread_timedjoin_np`. Change-Id: Idccb1aa588d6d10825294d14925d9bd046b65f19 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5098 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Jérôme Duval <jerome.duval@gmail.com> Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
|
#
a866e2d9 |
|
16-Feb-2022 |
Jérôme Duval <jerome.duval@gmail.com> |
POSIX: introduce sem_clockwait will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf Change-Id: Iee3faf23647aa5244ad316fe1c3d825592483935 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4966 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
|
#
c6fe3673 |
|
18-Jun-2021 |
Jérôme Duval <jerome.duval@gmail.com> |
POSIX: introduce ppoll will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf Change-Id: I38014ad910881df260f0ec762831491e143328c4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4099 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
|
#
a959262c |
|
14-Dec-2019 |
Adrien Destugues <pulkomandy@pulkomandy.tk> |
implement mlock(), munlock() Change-Id: I2f04b8986d2ed32bb4d30d238d668e21a1505778 Reviewed-on: https://review.haiku-os.org/c/haiku/+/1991 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
|
#
fe357eb9 |
|
05-Nov-2020 |
Jérôme Duval <jerome.duval@gmail.com> |
POSIX: add posix_fallocate and a preallocate syscall the preallocate syscall will call the preallocate filesystem hook, if available. fix #6285 Change-Id: Ifff4595548610c8e009d4e5ffb64c37e0884e62d Reviewed-on: https://review.haiku-os.org/c/haiku/+/3382 Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
|
#
5ffbe7d7 |
|
30-Mar-2019 |
Augustin Cavalier <waddlesplash@gmail.com> |
Change all references to "__INTEL__" to "__i386__". They are functionally identical, but the former is a BeOS/Haiku-specfic macro that we include in the compiler specs, and the latter is defined by GCC.
|
#
a295d3f4 |
|
10-Oct-2017 |
Jérôme Duval <jerome.duval@gmail.com> |
wait4(): retrieve dead team entries usage information. * This adds a parameter to the wait_for_child syscall. I extended the test case to show the actual retrieved information. * fix #13546
|
#
4419d699 |
|
22-Dec-2016 |
Jessica Hamilton <jessica.l.hamilton@gmail.com> |
partitioning: pass along reference to parent when uninitializing. * Fixes problems with setting the partition name after uninitializing a partition in DriveSetup. Previously, UninitializeJob() was followed by SetStringJob(), but the kernel was updating the change counter for the parent partition when uninitializing a partition, leading to SetStringJob() having an incorrect change counter for the parent partition. Now the parent change counter will be correct when SetStringJob() runs.
|
#
8c6cb8af |
|
26-Apr-2016 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
runtime loader: Register extended image info with kernel Add structure extended_image_info which extends image_info by the fields symbol_table, symbol_hash, string_table.
|
#
75c31ae2 |
|
26-Oct-2015 |
Simon South <ssouth@simonsouth.com> |
system: Build using public elf.h header Reduce duplication of code by * Removing from elf_common.h definitions available in os/kernel/elf.h * Deleting elf32.h and elf64.h * Renaming elf_common.h to elf_private.h * Updating source to build using public and private ELF header files together Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
|
#
4bf862e3 |
|
21-Apr-2015 |
Axel Dörfler <axeld@pinc-software.de> |
syslog_daemon: Converted to BServer. * Instead of letting the kernel search for the syslog port, the daemon now registers itself with the kernel (which even solves a TODO). * A port is created for the actual log messages from the launch_daemon, and used on start. * However, the SyslogTest does not yet work, due to the BMessage <-> KMessage communication problems.
|
#
d6d439f3 |
|
11-May-2015 |
Hamish Morrison <hamishm53@gmail.com> |
Reimplement unnamed POSIX semaphores using user_mutex * Fixes sharing semantics, so non-shared semaphores in non-shared memory do not become shared after a fork. * Adds two new system calls: _user_mutex_sem_acquire/release(), which reuse the user_mutex address-hashed wait mechanism. * Named semaphores continue to use traditional sem_id semaphores.
|
#
8f9d4cad |
|
11-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Remove get_stack_trace syscall again. This reverts the other half of b959d46dbd2f9087ae860dbced40440c28596a6e.
|
#
459e651f |
|
11-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Remove lookup_symbol syscall again. This partially reverts b959d46dbd2f9087ae860dbced40440c28596a6e.
|
#
b959d46d |
|
10-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Add get_stack_trace and lookup_symbol syscalls. The get_stack_trace syscall generates a stack trace using the kernel debugging facilities and copies the resulting return address array to the preallocated buffer from userland. It is only possible to get a stack trace of the current thread. The lookup_symbol syscall can be used to look up the symbol and image name corresponding to an address. It can be used to resolve symbols from a stack trace generated by the get_stack_trace syscall. Only symbols of the current team can be looked up. Note that this uses the symbol lookup of the kernel debugger which does not support lookup of all symbols (static functions are missing for example). This is meant to be used in situations where more elaborate stack trace generation, like done in the userland debugging helpers, is not possible due to constraints.
|
#
e01de522 |
|
10-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
More whitespace cleanup all over the place.
|
#
8f4db360 |
|
15-Feb-2014 |
Ithamar R. Adema <ithamar@upgrade-android.com> |
arm/atomic: round of atomic function changes * change vint{32,64} to int{32,64} in: * kernel implementation * syscall definitions * libroot prototypes * update syscall functions with new atomic prototypes.
|
#
d02aaee1 |
|
15-Dec-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Add more memory info in system_info system_info now contains all information previously available only through __get_system_info_etc(B_MEMORY_INFO, ...).
|
#
1bc7045f |
|
15-Dec-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Introduce new API for obtaining system info
|
#
308f594e |
|
20-Nov-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Make scheduler modes interface public
|
#
8a190335 |
|
07-Aug-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Implemented user debugging support for x86_64. Reused x86 arch_user_debugger.cpp, with a few minor changes to make the code work for both 32 and 64 bit. Something isn't quite working right, if a breakpoint is hit the kernel will hang. Other than that everything appears to work correctly.
|
#
6e2f6d1a |
|
29-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Changed cookie type for get_next_area_info() to ssize_t. The cookie is used to store the base address of the area that was just visited. On 64-bit systems, int32 is not sufficient. Therefore, changed to ssize_t which retains compatibility on x86 while expanding to a sufficient size on x86_64.
|
#
195a0f35 |
|
21-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Changed argument type of fcntl syscall from uint32 to size_t. Since this argument may be used to pass pointers, uint32 is not correct for 64-bit. Effectively no change on 32-bit targets, both size_t and uint32 are unsigned long there.
|
#
659bacac |
|
11-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Compile arch_real_time_clock.cpp and arch_system_info.cpp for x86_64.
|
#
d5e36fb5 |
|
10-Aug-2011 |
Axel Dörfler <axeld@pinc-software.de> |
* Introduced new fs_lopen_attr_dir() function that opens the attribute directory of a file without traversing leaf links (just like lstat()). * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42620 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
36dc99a3 |
|
12-Jun-2011 |
Rene Gollent <anevilyak@gmail.com> |
Add private get_memory_properties() syscall which allows one to retrieve the address protection bits as well as the wiring flags for an arbitrary address in a team's address space. Will be used in the debugger for the purposes of the memory inspector/editor, in order to determine whether it can in fact allow editing for the currently inspected address range. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42129 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
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
|
#
db033113 |
|
02-Jan-2011 |
Oliver Tappe <zooey@hirschkaefer.de> |
Closing #7056: * inherit umask of calling process to images loaded via exec...() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40071 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
d23cadce |
|
16-Dec-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
[_{kern,user}_]{start,stop}_system_watching() -> [_{kern,user}_]{start,stop}_watching_system() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39872 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
d2bf328d |
|
15-Dec-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Implemented a generic system watching mechanism with a userland API. Currently only a few events can be watched (team creation/deletion/exec, thread creation/ deletion/name changes). The functions start_system_watching()/ stop_system_watching start/stop watching events. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39862 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
56d734a1 |
|
16-Nov-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added new private API to get more information on a team: * Userland interface: get_extended_team_info(). * Syscall: _kern_get_extended_team_info. Only partially implemented yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39453 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
dbe1e23a |
|
16-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
Optimised passing around of timezone a bit * _kern_[sg]et_timezone() now accepts/passes out the timezone name, too * adjust Time preflet and clockconfig to pass the timezone name into the kernel when calling _kern_set_timezone() * ajust implementation of tzset() to fetch the timezone name from the kernel via _kern_get_timezone() instead of reading 'libroot_timezone_info' * the Time preflet no longer writes 'libroot_timezone_info' git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38164 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
7e965f50 |
|
03-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
More consolidation of timezone code: * dropped DaylightSavingTime from real_time_clock code in kernel, it was never really being used for what it meant (and just being referred to by gettimeofday(), which put a different meaning to it * adjusted the syscalls get_timezone() & set_timezone() as well as their callers accordingly * got rid of get_rtc_info() and rtc_info struct in kernel, as it was only being referred to by the FAT add-on and that one (like gettimeofday()) put a different meaning to tz_minuteswest. Added a comment to FAT's util.c showing a possible solution, should the hardcoded GMT timezone pose a problem. * fixed declaration of gettimeofday() to match POSIX base specs, issue 7 * changed implementation of gettimeofday() to not bother trying to fill struct timezone - it was using wrong values before, anyway. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37888 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
96ac47e3 |
|
03-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
Made some progress with consolidation of timezone-related code: * renamed syscalls _kern_[gs]et_tzfilename to _kern_[gs]et_real_time_clock_is_gmt, as the filename part is no longer relevant (and the two corresponding parameters were removed) * C++-ified and reworked clockconfig to use the info from 'Time settings' to setup the timezone info during boot * removed invocation of _kern_get_tzfilename() from tzset(), as the syscall no longer exists and tzset() is currently broken anyway * adjusted the Time preflet to use the renamed syscall when getting/setting the RTC info git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37881 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
9d570af7 |
|
24-May-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Changed the type of the "op" parameter of the fs_vnode_ops::ioctl() hook and the _kern_ioctl() syscall from ulong to uint32. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36927 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
90788614 |
|
01-May-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed some parameters of VM syscalls from int to uint32, mostly for sake of consistency. * Moved the B_OVERCOMMITTING_AREA flag from B_KERNEL_AREA_FLAGS to B_USER_AREA_FLAGS, since we really allow it to be passed from userland. * Most VM syscalls check the provided protection against B_USER_AREA_FLAGS instead of B_USER_PROTECTION, now. This way they allow for B_OVERCOMMITTING_AREA as well. * _user_map_file(), _user_set_memory_protection(): Check the protection like the other syscalls do and use fix_protection() instead of doing that manually. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36572 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
ee0d2be9 |
|
11-Apr-2010 |
Axel Dörfler <axeld@pinc-software.de> |
bonefish+axeld: * Implemented a tiny bit more sophisticated version of estimate_max_scheduling_latency() that uses a syscall that lets the scheduler decide. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36170 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
|
#
3f67d04b |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* This fixes the "'noreturn' function returns" warning in exit(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34293 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
486fffda |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Forgot to add linkat(), this really closes #4928 now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34289 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
fb2500da |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Added missing AT_EACCESS. * Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat(). * Added stub for mknodat(). * The kernel backend for faccessat() does not yet differentiate between effective and real user/group IDs, though. * Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything (more or less). This also closes ticket #4928. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34288 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
213d2d8f |
|
29-Jul-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added syscall _kern_kernel_debugger() to enter the kernel debugger. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31965 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8ae594ff |
|
28-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Introduced dedicated syscalls for the deprecated BeOS fs_attr API. Before, each attribute access needed 3 syscalls, now only one as it should. * Renamed the new Haiku call fs_open_attr() to fs_fopen_attr(), and added a new function fs_open_attr() that takes a path (same semantics as the fs_[f]open_attr_dir() functions already present in BeOS). * Merged former _kern_open_attr(), and _kern_create_attr() into one syscall. * Cleaned up vfs.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31881 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
f75b8de3 |
|
26-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Discarded the "parametersSize" parameter from various disk device manager functions. * Since we now use UserStringParameter, this fixes the missing null termination of the parameter string, and thus bug #4045. * Removed UserMemoryParameter, as it's no longer in use. * Adjusted syscalls accordingly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31779 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0b11ecb1 |
|
21-Jul-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Always include the public arch_debugger.h headers. The structures defined there are prefixed with the respective architecture name. Useful for remote debugging a different architecture. * <x86/arch_debugger.h>: Introduced a structure for the FPU state, so that it isn't left to the debugger. * Removed the _kern_get_thread_cpu_state() syscall. Was originally intended for bdb compatiblity, but isn't really needed. * Kernel x86 arch_get_debug_cpu_state(): The use of fnsave was broken, since it reinits the FPU after saving the state. This resulted in weird results when debugging functions using the FPU. We now use fxsave, if available. Otherwise fnsave + frstor should be used -- not fully implemented yet. Same for arch_set_debug_cpu_state(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31682 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5fbad060 |
|
17-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Work-in-progress on a kernel profile service that can be evaluated from userland afterwards. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31621 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
3609af39 |
|
19-Jun-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Renamed _kern_reserve_heap_address_range() to _kern_reserve_address_range(), and added a _kern_unreserve_address_range() as well. * The runtime loader now reserves the space needed for all its areas first to make sure there is enough space left for all areas of a single image. * This also fixes the final part of bug #4008. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31115 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
82db8a9e |
|
19-Jun-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Added an "unmapAddressRange" argument to the file mapping syscall. This is the first part of making the runtime loader behave itself; it should already make Clockwerk run okay with any number of translators (even if not all of them will work yet). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31113 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
568ade58 |
|
13-Jun-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
User debugger support: * Generalized address checks. The debugger can now also read the commpage. * Added new syscall _kern_get_thread_cpu_state() to get the CPU state of a not running thread. Introduced arch_get_thread_debug_cpu_state() for that purpose, which is only implemented for x86 ATM (uses the new i386_get_thread_user_iframe()). * Don't allow a debugger to change a thread's "esp" anymore. That's the esp register in the kernel. "user_esp" can still be changed. * Generally set RF (resume flag) in eflags in interrupt handlers, not only after a instruction breakpoint debug exception. This should prevent breakpoints from being triggered more than once (e.g. when the breakpoint is on an instruction that can cause a page fault). I still saw those with bdb in VMware, but that might be a VMware bug. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31045 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
227fe7d3 |
|
23-Apr-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Scheduler/wait object listener: - Moved scheduler listening interface to <listeners.h> and added more convenient to use templatized notification functions. - Added a listener mechanism for the wait objects (semaphores, condition variables, mutex, rw_lock). * system profiler: - Hopefully fixed locking issues related to notifying the profiler thread for good. We still had an inconsistent locking order, since the scheduler notification callbacks are invoked with the thread lock held and have to acquire the object lock then, while the other callbacks acquired the object lock first and as a side effect of ConditionVariable::NotifyOne() acquired the thread lock. Now we make sure the object lock is the innermost lock. - Track the number of dropped events due to a full buffer. _user_system_profiler_next_buffer() returns this count now. - When scheduling profiling events are requested also listen to wait objects and generate the respective profiling events. We send those events lazily and cache the infos to avoid resending an event for the same wait object. - When starting profiling we do now generate "thread scheduled" events for the already running threads. - _user_system_profiler_start(): Check whether the parameters pointer is a userland address at all. - The system_profiler_team_added event does now also contain the team's name. * Added a sem_get_name_unsafe() returning a semaphore's name. It is "unsafe", since the caller has to ensure that the semaphore exists and continues to exist as long as the returned name is used. * Adjusted the "profile" and "scheduling_recorder" according to the system profiling changes. The latter prints the number of dropped events, now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30345 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5b2f0f33 |
|
18-Apr-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed the interface of _kern_system_profiler_start(). The parameters are passed in a structure now, so it is easier to extend it and ignore unused parameters. * One can now select which system profiling events one is interested in. * Added scheduling events to the system profiling interface. Those are pretty much the ones recorded when scheduler tracing is enabled. Still missing are the "wait object" events that allow to interpret what a thread is waiting for. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30243 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
|
#
3f78b216 |
|
18-Mar-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Implemented a basic notification mechanism. Right now, only media changes and device additions/removals can be monitored. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29582 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
38bbc957 |
|
13-Oct-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* Made the use of file devices more convenient and complete by adding the methods IsFile() and GetFilePath() to BDiskDevice, and BDiskDeviceRoster::GetFileDeviceForPath(). * Added new syscalls to implement this functionality. * Added new flag B_DISK_DEVICE_IS_FILE. * Fixed wrong operator precedence assumption in the BDiskDevice class at several places. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8839d592 |
|
22-Sep-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added syscall _kern_read_kernel_image_symbols() for reading a kernel image's symbol and string tables. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 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
|
#
020ac568 |
|
03-Sep-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Fixed bug in the "scheduler" command: The check when a thread was unscheduled was incorrect. * Introduced _kern_analyze_scheduling() syscall. It requires scheduler kernel tracing to be enabled. It uses the tracing entries for a given period of time to do a similar analysis the "scheduler" debugger command does (i.e. number of runs, run time, latencies, preemption times) for each thread. Additionally the analysis includes for each thread how long the thread waited on each locking primitive in total. * Added kernel tracing for the creation of semaphores and initialization of condition variables, mutexes, and rw locks. The enabling macro is SCHEDULING_ANALYSIS_TRACING. The only purpose is to provide _kern_analyze_scheduling() with more info on the locking primitives (the name in particular). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27304 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
a9d7be07 |
|
07-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Implemented mprotect(). A vm_area does now have an optional array specifying the protection of each page (4 bits per page). * Added no-op implementation of posix_madvise(). * Replaced a few "addr_t size" parameters by "size_t size". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26871 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
|
#
2965c99f |
|
23-Jun-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed the _kern_exec() and _kern_load_image() syscalls. They expect a flattened argument/environment buffer now. This simplifies the work for the kernel a bit, since it can just copy the buffer and check whether it looks OK instead of messing around with individual strings. The runtime loader also gets a flattened array. * Set the maximum size of the arguments/environment buffer to 128 KB. When more arguments are passed, we fail with a proper error code (instead of just truncating the arguments as before). * On exec*() the first argument was silently replaced by the given path name, which is not correct. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26119 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
a2cf1d70 |
|
18-Jun-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Removed <syscalls.h>' dependency to <semaphore.h> by giving the sem_t structure a name. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26015 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0f448d21 |
|
22-May-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Added vm_page_write_modified_page_range(), which is similar to vm_page_write_modified_pages(), save that it only writes pages in the given range. * Added vm_page_schedule_write_page_range() which schedules all modified pages in the given cache's range for writing by the page writer. * Added _kern_sync_memory() syscall and the msync() POSIX function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25620 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
6b202f4e |
|
13-May-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Introduced new header directory headers/private/system which is supposed to contain headers shared by kernel and userland (mainly libroot). * Moved quite a few private kernel headers to the new location. Split several kernel headers into a shared part and one that is still kernel private. Adjusted all affected Jamfiles and source in the standard x86 build accordingly. The build for other architectures and for test code may be broken. * Quite a bit of userland code still includes private kernel headers. Mostly those are <util/*> headers. The ones that aren't strictly kernel-only should be moved to some other place (maybe headers/private/shared/util). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
4bf862e3689b034d4e44cf94c5e50fe7ae05aee3 |
|
21-Apr-2015 |
Axel Dörfler <axeld@pinc-software.de> |
syslog_daemon: Converted to BServer. * Instead of letting the kernel search for the syslog port, the daemon now registers itself with the kernel (which even solves a TODO). * A port is created for the actual log messages from the launch_daemon, and used on start. * However, the SyslogTest does not yet work, due to the BMessage <-> KMessage communication problems.
|
#
d6d439f3f75a0986063d42eda8ff5281adcb29b1 |
|
11-May-2015 |
Hamish Morrison <hamishm53@gmail.com> |
Reimplement unnamed POSIX semaphores using user_mutex * Fixes sharing semantics, so non-shared semaphores in non-shared memory do not become shared after a fork. * Adds two new system calls: _user_mutex_sem_acquire/release(), which reuse the user_mutex address-hashed wait mechanism. * Named semaphores continue to use traditional sem_id semaphores.
|
#
8f9d4cad459baf5e64271aeb92f451c5aba270a5 |
|
11-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Remove get_stack_trace syscall again. This reverts the other half of b959d46dbd2f9087ae860dbced40440c28596a6e.
|
#
459e651fd518aaecda9ff6079ea0385456e0be5b |
|
11-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Remove lookup_symbol syscall again. This partially reverts b959d46dbd2f9087ae860dbced40440c28596a6e.
|
#
b959d46dbd2f9087ae860dbced40440c28596a6e |
|
10-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
syscalls: Add get_stack_trace and lookup_symbol syscalls. The get_stack_trace syscall generates a stack trace using the kernel debugging facilities and copies the resulting return address array to the preallocated buffer from userland. It is only possible to get a stack trace of the current thread. The lookup_symbol syscall can be used to look up the symbol and image name corresponding to an address. It can be used to resolve symbols from a stack trace generated by the get_stack_trace syscall. Only symbols of the current team can be looked up. Note that this uses the symbol lookup of the kernel debugger which does not support lookup of all symbols (static functions are missing for example). This is meant to be used in situations where more elaborate stack trace generation, like done in the userland debugging helpers, is not possible due to constraints.
|
#
e01de52283efe0bd8fa107bd493df302c070204e |
|
10-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
More whitespace cleanup all over the place.
|
#
8f4db360bc74cce76fff614da6ae0332e5fd52a8 |
|
15-Feb-2014 |
Ithamar R. Adema <ithamar@upgrade-android.com> |
arm/atomic: round of atomic function changes * change vint{32,64} to int{32,64} in: * kernel implementation * syscall definitions * libroot prototypes * update syscall functions with new atomic prototypes.
|
#
d02aaee17e007631fcfa91a012ec7b6386927012 |
|
15-Dec-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Add more memory info in system_info system_info now contains all information previously available only through __get_system_info_etc(B_MEMORY_INFO, ...).
|
#
1bc7045fdfb85e6151d01c73669be19627c4783b |
|
15-Dec-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Introduce new API for obtaining system info
|
#
308f594e2a5d3674bd019a7620e193ab0a845e6f |
|
20-Nov-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
kernel, libroot: Make scheduler modes interface public
|
#
8a1903353eedd95266c7241aada3a314c5d35a55 |
|
07-Aug-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Implemented user debugging support for x86_64. Reused x86 arch_user_debugger.cpp, with a few minor changes to make the code work for both 32 and 64 bit. Something isn't quite working right, if a breakpoint is hit the kernel will hang. Other than that everything appears to work correctly.
|
#
6e2f6d1ace7490a200dcff70c52acf2af59c5bc3 |
|
29-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Changed cookie type for get_next_area_info() to ssize_t. The cookie is used to store the base address of the area that was just visited. On 64-bit systems, int32 is not sufficient. Therefore, changed to ssize_t which retains compatibility on x86 while expanding to a sufficient size on x86_64.
|
#
195a0f350e3acd76856016f673c8a871ed687a07 |
|
21-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Changed argument type of fcntl syscall from uint32 to size_t. Since this argument may be used to pass pointers, uint32 is not correct for 64-bit. Effectively no change on 32-bit targets, both size_t and uint32 are unsigned long there.
|
#
659bacac269ec0992603008ef436ee20505bd67f |
|
11-Jul-2012 |
Alex Smith <alex@alex-smith.me.uk> |
Compile arch_real_time_clock.cpp and arch_system_info.cpp for x86_64.
|
#
d5e36fb599b43a6a9dfb3cf8e95018fe15780219 |
|
10-Aug-2011 |
Axel Dörfler <axeld@pinc-software.de> |
* Introduced new fs_lopen_attr_dir() function that opens the attribute directory of a file without traversing leaf links (just like lstat()). * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42620 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
36dc99a3237d35b1591fbdb1662ab083126ed5c5 |
|
12-Jun-2011 |
Rene Gollent <anevilyak@gmail.com> |
Add private get_memory_properties() syscall which allows one to retrieve the address protection bits as well as the wiring flags for an arbitrary address in a team's address space. Will be used in the debugger for the purposes of the memory inspector/editor, in order to determine whether it can in fact allow editing for the currently inspected address range. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42129 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
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
|
#
db0331134210bf63c82a298bb734f5fda4167a38 |
|
02-Jan-2011 |
Oliver Tappe <zooey@hirschkaefer.de> |
Closing #7056: * inherit umask of calling process to images loaded via exec...() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40071 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
d23cadce4cdbd4e891a2aedf4f82f252f71d2461 |
|
16-Dec-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
[_{kern,user}_]{start,stop}_system_watching() -> [_{kern,user}_]{start,stop}_watching_system() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39872 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
d2bf328d7214cbba46b4781d70c5abda13083b89 |
|
15-Dec-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Implemented a generic system watching mechanism with a userland API. Currently only a few events can be watched (team creation/deletion/exec, thread creation/ deletion/name changes). The functions start_system_watching()/ stop_system_watching start/stop watching events. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39862 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
56d734a1aa601a8a5cfc5dbc79433f96f4e1731e |
|
16-Nov-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added new private API to get more information on a team: * Userland interface: get_extended_team_info(). * Syscall: _kern_get_extended_team_info. Only partially implemented yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39453 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
dbe1e23aa87ced2603074f6e4eaca2c4d99cf971 |
|
16-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
Optimised passing around of timezone a bit * _kern_[sg]et_timezone() now accepts/passes out the timezone name, too * adjust Time preflet and clockconfig to pass the timezone name into the kernel when calling _kern_set_timezone() * ajust implementation of tzset() to fetch the timezone name from the kernel via _kern_get_timezone() instead of reading 'libroot_timezone_info' * the Time preflet no longer writes 'libroot_timezone_info' git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38164 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
7e965f506df723e0253980218bc3ce819b7736e4 |
|
03-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
More consolidation of timezone code: * dropped DaylightSavingTime from real_time_clock code in kernel, it was never really being used for what it meant (and just being referred to by gettimeofday(), which put a different meaning to it * adjusted the syscalls get_timezone() & set_timezone() as well as their callers accordingly * got rid of get_rtc_info() and rtc_info struct in kernel, as it was only being referred to by the FAT add-on and that one (like gettimeofday()) put a different meaning to tz_minuteswest. Added a comment to FAT's util.c showing a possible solution, should the hardcoded GMT timezone pose a problem. * fixed declaration of gettimeofday() to match POSIX base specs, issue 7 * changed implementation of gettimeofday() to not bother trying to fill struct timezone - it was using wrong values before, anyway. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37888 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
96ac47e3126d4001093b745baf4b3d8f31636314 |
|
03-Aug-2010 |
Oliver Tappe <zooey@hirschkaefer.de> |
Made some progress with consolidation of timezone-related code: * renamed syscalls _kern_[gs]et_tzfilename to _kern_[gs]et_real_time_clock_is_gmt, as the filename part is no longer relevant (and the two corresponding parameters were removed) * C++-ified and reworked clockconfig to use the info from 'Time settings' to setup the timezone info during boot * removed invocation of _kern_get_tzfilename() from tzset(), as the syscall no longer exists and tzset() is currently broken anyway * adjusted the Time preflet to use the renamed syscall when getting/setting the RTC info git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37881 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
9d570af7c878ba30043b23e6dce5f3ae5578aa7c |
|
24-May-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Changed the type of the "op" parameter of the fs_vnode_ops::ioctl() hook and the _kern_ioctl() syscall from ulong to uint32. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36927 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
907886143fe5656bb1ae0e616a9286b0ca8538c6 |
|
01-May-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed some parameters of VM syscalls from int to uint32, mostly for sake of consistency. * Moved the B_OVERCOMMITTING_AREA flag from B_KERNEL_AREA_FLAGS to B_USER_AREA_FLAGS, since we really allow it to be passed from userland. * Most VM syscalls check the provided protection against B_USER_AREA_FLAGS instead of B_USER_PROTECTION, now. This way they allow for B_OVERCOMMITTING_AREA as well. * _user_map_file(), _user_set_memory_protection(): Check the protection like the other syscalls do and use fix_protection() instead of doing that manually. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36572 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
ee0d2be9e44bc80bd060f2ad24fbf29d8d449250 |
|
11-Apr-2010 |
Axel Dörfler <axeld@pinc-software.de> |
bonefish+axeld: * Implemented a tiny bit more sophisticated version of estimate_max_scheduling_latency() that uses a syscall that lets the scheduler decide. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36170 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
|
#
3f67d04bc4166f235862876ac0650c9e3a982080 |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* This fixes the "'noreturn' function returns" warning in exit(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34293 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
486fffdaaf7f16e65bea9f4fde7d5d3c3726ece8 |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Forgot to add linkat(), this really closes #4928 now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34289 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
fb2500da15e8c574cbb343b8fc536d7094357f54 |
|
26-Nov-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Added missing AT_EACCESS. * Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat(). * Added stub for mknodat(). * The kernel backend for faccessat() does not yet differentiate between effective and real user/group IDs, though. * Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything (more or less). This also closes ticket #4928. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34288 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
213d2d8f9dc09656dd2c20cfa36f96d6d53a4f07 |
|
29-Jul-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added syscall _kern_kernel_debugger() to enter the kernel debugger. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31965 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8ae594ffd47d73edb1c9b9e1240a1ee667197472 |
|
28-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Introduced dedicated syscalls for the deprecated BeOS fs_attr API. Before, each attribute access needed 3 syscalls, now only one as it should. * Renamed the new Haiku call fs_open_attr() to fs_fopen_attr(), and added a new function fs_open_attr() that takes a path (same semantics as the fs_[f]open_attr_dir() functions already present in BeOS). * Merged former _kern_open_attr(), and _kern_create_attr() into one syscall. * Cleaned up vfs.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31881 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
f75b8de3fca930e6140a426ad6e4003be467be78 |
|
26-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Discarded the "parametersSize" parameter from various disk device manager functions. * Since we now use UserStringParameter, this fixes the missing null termination of the parameter string, and thus bug #4045. * Removed UserMemoryParameter, as it's no longer in use. * Adjusted syscalls accordingly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31779 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0b11ecb18c9afe14114fac959f698a2bfa5b7230 |
|
21-Jul-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Always include the public arch_debugger.h headers. The structures defined there are prefixed with the respective architecture name. Useful for remote debugging a different architecture. * <x86/arch_debugger.h>: Introduced a structure for the FPU state, so that it isn't left to the debugger. * Removed the _kern_get_thread_cpu_state() syscall. Was originally intended for bdb compatiblity, but isn't really needed. * Kernel x86 arch_get_debug_cpu_state(): The use of fnsave was broken, since it reinits the FPU after saving the state. This resulted in weird results when debugging functions using the FPU. We now use fxsave, if available. Otherwise fnsave + frstor should be used -- not fully implemented yet. Same for arch_set_debug_cpu_state(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31682 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5fbad060b393d0ea6d13c0800c28b313de3add93 |
|
17-Jul-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Work-in-progress on a kernel profile service that can be evaluated from userland afterwards. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31621 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
3609af391d646e2629e70e7b214a79ed57578ffc |
|
19-Jun-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Renamed _kern_reserve_heap_address_range() to _kern_reserve_address_range(), and added a _kern_unreserve_address_range() as well. * The runtime loader now reserves the space needed for all its areas first to make sure there is enough space left for all areas of a single image. * This also fixes the final part of bug #4008. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31115 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
82db8a9e159b60e775b4cab31d54ac40fe95de53 |
|
19-Jun-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Added an "unmapAddressRange" argument to the file mapping syscall. This is the first part of making the runtime loader behave itself; it should already make Clockwerk run okay with any number of translators (even if not all of them will work yet). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31113 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
568ade58d054e27ce4cd9da0d4e73ecb79563b96 |
|
13-Jun-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
User debugger support: * Generalized address checks. The debugger can now also read the commpage. * Added new syscall _kern_get_thread_cpu_state() to get the CPU state of a not running thread. Introduced arch_get_thread_debug_cpu_state() for that purpose, which is only implemented for x86 ATM (uses the new i386_get_thread_user_iframe()). * Don't allow a debugger to change a thread's "esp" anymore. That's the esp register in the kernel. "user_esp" can still be changed. * Generally set RF (resume flag) in eflags in interrupt handlers, not only after a instruction breakpoint debug exception. This should prevent breakpoints from being triggered more than once (e.g. when the breakpoint is on an instruction that can cause a page fault). I still saw those with bdb in VMware, but that might be a VMware bug. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31045 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
227fe7d34aeed45d0727a0abde2ea2309352983b |
|
23-Apr-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Scheduler/wait object listener: - Moved scheduler listening interface to <listeners.h> and added more convenient to use templatized notification functions. - Added a listener mechanism for the wait objects (semaphores, condition variables, mutex, rw_lock). * system profiler: - Hopefully fixed locking issues related to notifying the profiler thread for good. We still had an inconsistent locking order, since the scheduler notification callbacks are invoked with the thread lock held and have to acquire the object lock then, while the other callbacks acquired the object lock first and as a side effect of ConditionVariable::NotifyOne() acquired the thread lock. Now we make sure the object lock is the innermost lock. - Track the number of dropped events due to a full buffer. _user_system_profiler_next_buffer() returns this count now. - When scheduling profiling events are requested also listen to wait objects and generate the respective profiling events. We send those events lazily and cache the infos to avoid resending an event for the same wait object. - When starting profiling we do now generate "thread scheduled" events for the already running threads. - _user_system_profiler_start(): Check whether the parameters pointer is a userland address at all. - The system_profiler_team_added event does now also contain the team's name. * Added a sem_get_name_unsafe() returning a semaphore's name. It is "unsafe", since the caller has to ensure that the semaphore exists and continues to exist as long as the returned name is used. * Adjusted the "profile" and "scheduling_recorder" according to the system profiling changes. The latter prints the number of dropped events, now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30345 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5b2f0f33f9bcfadc050342f4937b0e4bf31fc6eb |
|
18-Apr-2009 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed the interface of _kern_system_profiler_start(). The parameters are passed in a structure now, so it is easier to extend it and ignore unused parameters. * One can now select which system profiling events one is interested in. * Added scheduling events to the system profiling interface. Those are pretty much the ones recorded when scheduler tracing is enabled. Still missing are the "wait object" events that allow to interpret what a thread is waiting for. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30243 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
|
#
3f78b216ad39f9f51adcedcbc75e770a51d232c9 |
|
18-Mar-2009 |
Axel Dörfler <axeld@pinc-software.de> |
* Implemented a basic notification mechanism. Right now, only media changes and device additions/removals can be monitored. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29582 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
38bbc957584704a85047dc84d4bc7653e44cff03 |
|
13-Oct-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* Made the use of file devices more convenient and complete by adding the methods IsFile() and GetFilePath() to BDiskDevice, and BDiskDeviceRoster::GetFileDeviceForPath(). * Added new syscalls to implement this functionality. * Added new flag B_DISK_DEVICE_IS_FILE. * Fixed wrong operator precedence assumption in the BDiskDevice class at several places. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8839d592bce4b8ffebdb440ed50085fbf397975b |
|
22-Sep-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added syscall _kern_read_kernel_image_symbols() for reading a kernel image's symbol and string tables. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 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
|
#
020ac568404b8ab78825622d8815be48e987f649 |
|
03-Sep-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Fixed bug in the "scheduler" command: The check when a thread was unscheduled was incorrect. * Introduced _kern_analyze_scheduling() syscall. It requires scheduler kernel tracing to be enabled. It uses the tracing entries for a given period of time to do a similar analysis the "scheduler" debugger command does (i.e. number of runs, run time, latencies, preemption times) for each thread. Additionally the analysis includes for each thread how long the thread waited on each locking primitive in total. * Added kernel tracing for the creation of semaphores and initialization of condition variables, mutexes, and rw locks. The enabling macro is SCHEDULING_ANALYSIS_TRACING. The only purpose is to provide _kern_analyze_scheduling() with more info on the locking primitives (the name in particular). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27304 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
a9d7be0708b660121608c1b916862ab6d664ba07 |
|
07-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Implemented mprotect(). A vm_area does now have an optional array specifying the protection of each page (4 bits per page). * Added no-op implementation of posix_madvise(). * Replaced a few "addr_t size" parameters by "size_t size". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26871 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
|
#
2965c99fea660b23b03b58a3c9955a16bed0e019 |
|
23-Jun-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed the _kern_exec() and _kern_load_image() syscalls. They expect a flattened argument/environment buffer now. This simplifies the work for the kernel a bit, since it can just copy the buffer and check whether it looks OK instead of messing around with individual strings. The runtime loader also gets a flattened array. * Set the maximum size of the arguments/environment buffer to 128 KB. When more arguments are passed, we fail with a proper error code (instead of just truncating the arguments as before). * On exec*() the first argument was silently replaced by the given path name, which is not correct. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26119 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
a2cf1d70efdd241524b885425a129779f50a84e6 |
|
18-Jun-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Removed <syscalls.h>' dependency to <semaphore.h> by giving the sem_t structure a name. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26015 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0f448d21e52dfbde6ebd029af30d19542224c16d |
|
22-May-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Added vm_page_write_modified_page_range(), which is similar to vm_page_write_modified_pages(), save that it only writes pages in the given range. * Added vm_page_schedule_write_page_range() which schedules all modified pages in the given cache's range for writing by the page writer. * Added _kern_sync_memory() syscall and the msync() POSIX function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25620 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
6b202f4e3da73d4c131355fcd82b792d153f84f6 |
|
13-May-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Introduced new header directory headers/private/system which is supposed to contain headers shared by kernel and userland (mainly libroot). * Moved quite a few private kernel headers to the new location. Split several kernel headers into a shared part and one that is still kernel private. Adjusted all affected Jamfiles and source in the standard x86 build accordingly. The build for other architectures and for test code may be broken. * Quite a bit of userland code still includes private kernel headers. Mostly those are <util/*> headers. The ones that aren't strictly kernel-only should be moved to some other place (maybe headers/private/shared/util). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
|