disk system lists.
* Added module watching; on module changes, it will now automatically rescan
the disk systems.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26368 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Extend the app_server protocol by configuration options to turn
subpixel font rendering on/off and also make the glyph hinting optional
(aligning of glyph shapes to the pixel grid).
* Implement the setting in the app_server and also handle the persistency.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26362 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Prepared the AGG base_renderer code with two more functions needed to
handle subpixel scanline coverage values.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26356 a95241bf-73f2-0310-859d-f6bbb57e9c96
it clear when boot_splash_set_stage() must no longer be used.
* Free the memory associated with the kernel args before starting the
init process. Unlike the original TODO stated there are quite a few
more users of the kernel args (including the boot splash screen),
hence we can't really do that earlier, unless we decide to copy the
data over to the kernel heap.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26344 a95241bf-73f2-0310-859d-f6bbb57e9c96
when set, prevents any old mouse moved message discarding.
* BWindow::DispatchMessage(B_MOUSE_MOVED) checks the event time of the
message and discards too old events, but only if there is another event
in the queue and the view does not specify B_FULL_POINTER_HISTORY.
* BView::GetMouse() ignores the checkHistory flag passed to the function
in case the event mask specifies B_NO_POINTER_HISTORY.
B_FULL_POINTER_HISTORY on the other hand prevents the dropping of old
messages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26341 a95241bf-73f2-0310-859d-f6bbb57e9c96
header.
* Added fields necessary to make it possible to retrieve more than one
dirent from the underlying file system.
* Unless some app creates a DIR on its own to it to feed readdir(), this
change should be binary compatible. If we find an application misbehaving,
we can still make it a GCC4 only thing.
* fs_attr/fs_index/fs_query now all use readdir() directly (as that one
contains the logic to iterate through a number of dirents in userspace).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26339 a95241bf-73f2-0310-859d-f6bbb57e9c96
It follows the semantics of the BFS R/W lock, though, that is, if you unlock
your write lock before the read locks, the read locks effectively become
write locks, too.
* Added a mutex_transfer_lock() function that will allow you to unlock a mutex
in a different thread than the one which locked it (only matters if KDEBUG
is enabled, though).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26316 a95241bf-73f2-0310-859d-f6bbb57e9c96
* fssh_auto_locker.h should probably better use an FS-Shell header instead of
stddef.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26301 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Applied Korli's mutex_unlock() fix to block_cache.cpp.
* Removed block_cache_priv.h, as it's no longer needed (moved its definitions
into block_cache.cpp, as in the kernel file).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26296 a95241bf-73f2-0310-859d-f6bbb57e9c96
* fixed several byte order inconsistencies, it does not make sense to always
convert the byte order input/output values - no we convert where it can
be expected and leave it where it is confusing
* fixed size inconsistencies with respect to family and port, both of which
were sometimes handled as int8, as int16 and as int32 in different places
(now they are always int16)
These fixes make Beam connect to the correct address and port, but it still doesn't work, as it seems to be using UDP instead of TCP (doh!). Will look into that tomorrow.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26269 a95241bf-73f2-0310-859d-f6bbb57e9c96
automatically selected at boot time. Pit and Apic timers are implemented
for now. Thanks Dustin!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26265 a95241bf-73f2-0310-859d-f6bbb57e9c96
Patch by Mika Lindqvist. Could we give give him Commit access?
I am getting daily patches from him with fixes and new features.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26227 a95241bf-73f2-0310-859d-f6bbb57e9c96
serve, bin sizes and page size. This minimizes the amount of "large"
allocations made in heaps that don't have a bin for the allocation size
(combining multiple pages). This is desirable as such large allocations
are generally pretty inefficient, and also because it separates larger from
smaller allocations better, making the chance of a heap becoming empty higher.
For now there are three heap classes "small", "large" and "huge", with a
predefined set of bin sizes for each. This might need some finetuning later on.
Reduce the grow size to 4MB though as the allocations should now be spread
across heap classes which each grow on their own.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26210 a95241bf-73f2-0310-859d-f6bbb57e9c96
the newly found disk systems.
* _ScanPartition() now allows to restrict the disk systems to a predefined set.
* _ScanPartition() now even scans partitions that already have a disk system
assigned; if a better one is found, the existing one is replaced. It will
ignore mounted or partitions with children, though.
* KPartition now also stores the priority of the disk system assigned to it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26177 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Use the platform object to determine the platform type in system_info.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26166 a95241bf-73f2-0310-859d-f6bbb57e9c96
per cache.
* Changed the strategy vm_cache_acquire_page_cache_ref() uses to ensure
that the cache isn't deleted while trying to get a reference. Instead
of the global cache pages hash table lock, it holds the global cache
list lock now. We acquire + release this lock in delete_cache() after
removing all pages and just before deleting the object.
* Some small optimizations using the property that the cache's pages are
ordered, now (vm_cache_resize(), vm_page_write_modified_page_range(),
vm_page_schedule_write_page_range()).
* Replaced some code counting a cache's pages by simply using
vm_cache::page_count.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26160 a95241bf-73f2-0310-859d-f6bbb57e9c96
D. Sleater. Also added a IteratableSplayTree class that extends
SplayTree, additionally maintaining a singly-linked list, thus allowing
for efficient forward iteration.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26159 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed logic error in CountItemsUnder() that would sometimes
return the wrong count. This would result in issues such as
Vision's network reordering failing to reorder down due to
retrieving the wrong item based on the count.
This fixes ticket #2447.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26149 a95241bf-73f2-0310-859d-f6bbb57e9c96
always returned B_OK) by a Init() method, which sets the initial size
and returns an error, if that fails.
* Adjusted code using the classes accordingly. Replaced a few
InitCheck() methods in the network code by Init().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26127 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
- remove unneeded include to make those usable by bootloader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26117 a95241bf-73f2-0310-859d-f6bbb57e9c96
- kernel_m68K almost links now, jsut bails out on the linker script...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26096 a95241bf-73f2-0310-859d-f6bbb57e9c96
- we'll just use decimal chip number (68030, ...) to identify cpu, fpu, and mmu for simplicity.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26041 a95241bf-73f2-0310-859d-f6bbb57e9c96
been requested. The first call to a BView::Invalidate() will flush the link
so that app_server is notified as soon as possible. It makes no sense for
further calls to Invalidate() to flush also, since Flush() is not cheap. This
trick makes Invalidate() about 3.2 times faster, making it a cheaper operation.
I could not see any negative effects, I tested with apps that invalidate
multiple different parts inside a window in reaction to something. Thanks go to
Ingo who had the idea.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26020 a95241bf-73f2-0310-859d-f6bbb57e9c96
Adding some helper methods to the Local and remote devices
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26011 a95241bf-73f2-0310-859d-f6bbb57e9c96
waiting for a heap grow.
* Use that nogrow version in the VM code to avoid a deadlock with the address
space lock when a grow operation would try to create an area while a malloc
happened from such a function in the VM.
* When waiting for a grow to happen, notify the waiting thread from the grower
also if it failed to allocate a new heap. Otherwise a thread would just sit
there and wait until another thread requested growing too and that one
succeeded (or just forever in the worst case).
* Make the dedicated grow heap growable too. If the current grow heaps run low
on memory it will instruct the grower to allocate a new grow heap. This
reduces the likelyhood of running out of memory with no way to grow to a
minimum. As the growing is done asynchronously it is still possible to
happen, but it is highly unlikely as the grow heap is solely used to
allocate memory in the process of creating new heap areas and it will even
try using normal public memory if the dedicated memory has run out.
* Reduced the dedicated grow heap from 2 to 1MB. As it can now grow itself, it
doesn't need to last so long.
* Extract heap creation into it's own function that does area creation and heap
attach and use this function for growing normal and grow heaps.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26009 a95241bf-73f2-0310-859d-f6bbb57e9c96
We now keep track of a lower bound as to when the list should scale
itself back down. When increasing the list size, we double the current,
with the lower bound set to 1/4 of the current size, not allowing it to
go any smaller than the block size. These combined allow us to do very
cheap tests to see if an operation requires a resize at all, and minimize
how often the list actually needs to be resized, since the difference in upper
and lower bounds prevents bouncing back and forth between a size in the case
of adding/removing an item while close to a boundary. All in all this should
make BList noticably more scalable when doing large numbers of add/remove
operations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25946 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Tailor a bit the main module
- Fix definitions in the main header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25943 a95241bf-73f2-0310-859d-f6bbb57e9c96
* It was not self containing, as it used size_t without defining it.
* It was not C++ safe.
* It used the restrict keyword that is not recognized in GCC2. This fixes bug
#2262.
* It did not contain parameter names as demanded by our coding style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25818 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
* Cleanup the license header and add authors
* Sort the available keymaps list in the config file and add 'dv'
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25806 a95241bf-73f2-0310-859d-f6bbb57e9c96
keymap there too.
* Add a config header where one can select what KDL keymap should be used
(currently only 'us' and 'sg' are available though).
* Provide a third keymap that is used when the alt modifier is used (the swiss
german keymap is pretty useless without alt as all the useful keys like
backslash and curly braces use alt).
Our KDL is so powerful and nice to use, the only thing that bothered me was
that I always had to think about where some of the special keys are located in
the US keymap. So this simple compile-time keymap switching provided to be
helpful for me and might be for others too. Keymaps for other layouts obviously
have to be written before this becomes really useful.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25803 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added B_BITMAPS_SUPPORT_OVERLAY flag to indicate overlay support for the
color space.
* Rewrote GraphicsDefs.h - the previous one was obvious a copy of the Be header,
including typos and strange white space. I was a bit lazy with respect to
the color space details, and mostly trusted the information provided by the
Be header else.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25793 a95241bf-73f2-0310-859d-f6bbb57e9c96
be put into a boot_item in frame_buffer_console_init().
* The VESA driver now supports gettings the EDID information as well; this
is necessary now, since the app_server no longer takes over the mode the
boot loader had chosen.
* Note, we might want to do this via vm86 instead in the future, and remove
the kernel part again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25786 a95241bf-73f2-0310-859d-f6bbb57e9c96
file for hpet implementation. Not yet added to the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25773 a95241bf-73f2-0310-859d-f6bbb57e9c96
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
structure (thus breaking BeOS binary compatibility), containing a
counter which is incremented whenever a thread has to wait for the
spinlock.
* Added macros for spinlock initialization and access and changed
code using spinlocks accordingly. This breaks compilation for BeOS --
the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
the team spinlocks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96
pipes in the shell, though the semantics is a little different: The
second command is invoked whenever the first command has written a
complete line. The line is passed as last argument to the second
command. The new command flag B_KDEBUG_PIPE_FINAL_RERUN causes the
second command to be invoked again (with NULL argument) after the
first command is done.
* Added kprintf_unfiltered() and kputs_unfiltered() which bypass the
pipe mechanism and directly print to the bluescreen/serial output.
* Moved most commands from debug.cpp to the new
debug_builtin_commands.cpp.
* B_KDEBUG_DONT_PARSE_ARGUMENTS commands don't get an argument anymore,
if it would consist of white space only.
* Added new debugger command return value B_KDEBUG_ERROR, which
indicates that executing the command failed. This return code will
abort a complete pipe.
* Since debugger commands can nest (i.e. one command can invoke another
one) the setjmp()/longjmp() mechanism to restore the stack after a
page fault in a command needs more than one jump buffer.
* Added abort_debugger_command(), which longjmp()s out of the currently
executed command. This will also abort the current pipe.
* When pagination is enabled pressing "a" will abort the running command
(as opposed to "q" which only disables the blue screen output, but
lets the command continue).
* Added debugger commands:
- "grep" which can be used to filter output by pattern. Removed the
"filter" command and the underlying mechanism that did that before.
- "head" which prints only the first lines of output of another
command.
- "wc" counts lines, words, and characters of another command's
output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25744 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Renamed scsi_dsk to scsi_disk.
* Joined all scsi_disk sources together to a single scsi_disk.cpp file.
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25737 a95241bf-73f2-0310-859d-f6bbb57e9c96
the message count doesn't really make much sense anyway (as opposed to
limiting the maximum size of waiting messages), we might still want to
enlarge this even more.
* This should further help with #2212.
* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25709 a95241bf-73f2-0310-859d-f6bbb57e9c96
remains. This replaces the previous mechanism of switching the thread to
a dedicated death stack. We might consider moving more cleanup work to
the undertaker, but that seems a little more involved.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25704 a95241bf-73f2-0310-859d-f6bbb57e9c96
than a semaphore, and can already be used in the early boot process.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25689 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Adjusted code using recursive locks respectively. The initialization
cannot fail anymore, and it is possible to use recursive locks in the
early boot process (even uninitialized, if in BSS), which simplifies
things a little.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25687 a95241bf-73f2-0310-859d-f6bbb57e9c96
(which we don't implement ATM). Why do we have a header that declares
stuff that is for the most part not supported?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25684 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Use vm86 mode to call the VESA BIOS to do the actual mode switching by
providing an ioctl in the vesa driver.
* Fix vm86.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25680 a95241bf-73f2-0310-859d-f6bbb57e9c96
I added an #error directive, so configure scripts shouldn't be fooled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25663 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Moved devfs from fs/ to device_manager/, and separated the legacy driver
support from it.
* Removed fast_log module.
* There are a couple of (temporary) regressions, though:
- legacy SATA and ISA IDE support is disabled, the drivers haven't been
ported yet.
- The not yet used ATA bus manager hasn't been ported yet, either.
- AHCI changes have not been tested.
- the listdev command has been removed from the build (as it currently
doesn't work anymore).
- device manager generated IDs currently are not freed anymore when a device
node is removed.
- generic drivers can't yet use the new driver architecture.
- simple busses that do not support device types won't work yet.
- legacy driver publishing/unpublishing (ie. what USB needs) has not been
tested, and may be broken.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25662 a95241bf-73f2-0310-859d-f6bbb57e9c96
Our font has some extra styles and these could be picked up as the
"regular" face by accident, as witnessed by Firefox. Tracked down by
Michael Lotz. Firefox uses the correct font now for it's interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25636 a95241bf-73f2-0310-859d-f6bbb57e9c96
PTHREAD_SCOPE_SYSTEM which makes the implementation rather simple.
* This closed ticket #2242.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25628 a95241bf-73f2-0310-859d-f6bbb57e9c96
- *pathconf() now uses statvfs and fs_info data when appropriate. It should also check for file type though, some only apply to directory or others.
- added confstr(_CS_PATH) with a sensible default.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25625 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
* The new function vm86_do_int(struct vm86_state *state, uint8 vec) provides a
facility to call BIOS interupt handlers. The function must only be called from
a user thread context because the lower 1MB of the address space is used.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25610 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Add a "fault_callback" to the thread structure which is called when a
unhandled page fault happens in user space. A SIGSEGV will only be sent
if the callback returns "true".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25609 a95241bf-73f2-0310-859d-f6bbb57e9c96
* In vm86 mode CS will have arbitrary values so we check for both USER_CODE_SEG
and the VM flag in EFLAGS. This is also done when entering interrupt gates.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25607 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added "struct" to ancillary_data_container which fixes the build of the
Bluetooth h2generic driver.
---
* Updated license header.
* Honour 80 char line width.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25606 a95241bf-73f2-0310-859d-f6bbb57e9c96
Gerald Zajac. Thanks a lot!
* Also put it on the image by default.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25583 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Made the pthread_cond_t internals public. This is necessary to support
process shared condition variables. Fixed initializer macro.
* Made the pthread_rwlockattr_t structure opaque.
* pthread_t is no longer typedef'ed to int. It's the pointer to the
internal _pthread_thread structure.
* Removed __get_pthread(). pthread_self() can be used instead.
* No longer tunnel the pthread exit value through Haiku's thread exit
value. We do have a separate field in the _pthread_thread structure
for it, now.
* Handle detaching of threads correctly.
* pthread_rwlockattr_{g,s}etpshared() use the
PTHREAD_PROCESS_{SHARED,PRIVATE} constants, now.
* Commented out yet unsupported structures (barriers, spinlocks).
* Rebuilt APR optional package. The pthread changes weren't binary
compatible.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25582 a95241bf-73f2-0310-859d-f6bbb57e9c96
compatible with what our code assumed (pointers to objects of
TraceEntry and its POD base class trace_entry aren't identical
anymore).
* Added optional stack traces for ktrace_printf() output in the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25531 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed condition variables so that it is allowed to block (e.g. lock
mutexes etc.) between Add() and Wait(). This fixes#2059, since the
block writer used them this way and could thusly fail to wait for a
condition variable, causing a temporary stack object to be used past its
lifetime.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25525 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
particularly efficient.
* pthread_mutex implementation:
- Removed the pthread_mutex_t indirection (the type was a pointer to
the actual structure which was allocated on the heap), as it made
sharing the mutex between processes impossible.
- Removed the distinction between process shared and non-shared
mutexes. Benaphores work just as well in shared memory, so we always
use them.
* Fixed some static initializer macros. PTHREAD_COND_INITIALIZER is
still broken, since it doesn't work in C code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25481 a95241bf-73f2-0310-859d-f6bbb57e9c96
address space that is fully locked and marked B_KERNEL_AREA. It can
thus be accessed by the kernel without additional checks.
* For each userland thread we do create a user_thread structure in that
area. The structure is accessible from userland via TLS, using the
private get_user_thread() function.
* Introduced private userland functions [un]defer_signals(). They can be
used to cheaply disable/re-enable signal delivery. They use the
user_thread::defer_signals/pending_signals fields which are
checked/updated by the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25451 a95241bf-73f2-0310-859d-f6bbb57e9c96
changes to the area (delete, resize, clone) from userland.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25450 a95241bf-73f2-0310-859d-f6bbb57e9c96
Replaced single-line comments by multi-line comments for ANSI C
compliance.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25433 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Patch by Shinta: switch between input methods are now not only done with Alt+Space but Alt+Zenkaku/Hankaku.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25416 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
by short/pretty/module name - since they should all be unique, I put them
in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25414 a95241bf-73f2-0310-859d-f6bbb57e9c96
arguments they get a single thread_creation_attributes structure now.
* Added stack_address and stack_size to thread_creation_attributes,
which allow to specify the stack size or the stack to be used for the
new user thread.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25389 a95241bf-73f2-0310-859d-f6bbb57e9c96
compile time checks. Incidently those are not totally uncommon in
portable code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25385 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed operator=(): the second argument of SetTo() is a boolean (normalize),
not the length of the buffer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25382 a95241bf-73f2-0310-859d-f6bbb57e9c96
simply created as files in /boot/var/shared_memory/. The Bootscript
clears the directory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25374 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Changed the semantics of unnamed semaphores. Before parent and child
of a fork() would always share an earlier created semaphore. Now we do
that only, if the "shared" parameter of sem_init() was true. That's
still not quite the behavior Linux and Solaris have, but should be
perfectly fine with how reasonable code would use the API.
* There's a global table for shared unnamed semaphores now. ATM a
semaphore is leaked when no one explicitly destroys it (just as with
named sems).
* Enforce per-team and global semaphore number limits.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25362 a95241bf-73f2-0310-859d-f6bbb57e9c96
not supposed to be passed to pathconf() or sysconf().
* Added POSIX semaphore related macros.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25361 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Allow userland teams to create areas below 1 MB when requested specifically.
* Note, this is a temporary solution - see the comments in the code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25358 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Implemented BMediaFile::Copyright, which just calls Copyright() of the extractor. So this is just a simple pass through.
- Style cleanup (mostly whitespaces)
Problem is that our readers currently return the copyright of the source code, not the copyright of the MediaFile itself, like the BeBook documents. Thus, we might need to change all readers to return appropiate data or behave differently for Haiku readers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25356 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
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
module interface. They directly operate on iovecs and thus allow
protocols that don't need it to avoid the creation of a net_buffer.
* Adjusted the socket module to support the new hooks. If they are
present, they will be chosen over the old hooks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25299 a95241bf-73f2-0310-859d-f6bbb57e9c96
module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25292 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
that can unlock the mutex, so one bit is sufficient.
* Added cutex_init_etc() which has an additional "flags" parameter.
The only specifyable flag is CUTEX_FLAG_CLONE_NAME, which causes the
function to strdup() the given name and free() its copy in
cutex_destroy().
* cutex_destroy() does now unblock waiting threads.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25280 a95241bf-73f2-0310-859d-f6bbb57e9c96
name, couldn't resist :-P). It's semantically equivalent to a mutex,
but doesn't need a semaphore (it uses thread blocking and a simple
queue instead). Initialization can't fail. In fact it is ready to use
without initialization when living in the bss segment, also in the
early boot process. It's as fast as a benaphore in cases of low lock
contention, and faster otherwise. Only disadvantage is the higher
immediate memory footprint of 16 bytes.
* Changed how the "thread" and "threads" debugger commands list the
objects they are waiting for. Cutexes are also included.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25276 a95241bf-73f2-0310-859d-f6bbb57e9c96
the selecting thread, which has obviously no effect.
* Changed select_info::events to vint32. It is now updated atomically.
This removes a race condition when concurrent threads would notify at
the same time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25273 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Made the pointers const.
* Changed how the ARP module maintains its arp_entry::request_buffer: it
now uses the atomic_pointer*() functions to make sure there is no race
condition, and it's deleted only once.
* Getting an ARP entry would return uninitialized data, if the entry hadn't
been resolved yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25263 a95241bf-73f2-0310-859d-f6bbb57e9c96
64-bit safe version of atomic_test_and_set() for pointers:
atomic_pointer_test_and_set().
* The VFS is now using this function (it's not used anywhere else in the
kernel this way).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25260 a95241bf-73f2-0310-859d-f6bbb57e9c96
this (seems to be what R5 BStatusBar does):
* combine the "trailing text" with the "trailing label" and truncate the
resulting string on the left side according to the width of the entire
control
* combine the "label" with the "text" and truncate that on the right side
according to the space left by the right hand text.
-> No more overlaps (theoretically, in practise there are still overlaps
because our BFont::TruncateString() does not respect the width in some
situations.)
* Changed _SetTextData() accordingly, it is not used anymore for the
label and trailing label, and could therefor be simplified a little.
* fixed _BarFrame() to not return fractional coords, which could sometimes
leave a dirty line of pixels.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25244 a95241bf-73f2-0310-859d-f6bbb57e9c96
* cache paranoia was always enabled.
* Changed from paranoia on/off to levels. Adjusted the macros to take a
level argument.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25215 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added "mode" parameter to set_paranoia_check(), which specifies
whether the check is supposed to already exist/not exist yet. This
allows for, as it turns out, very useful additional tests. Added
{ADD,UPDATE}_PARANOIA_CHECK macros that imply the used "mode"
parameter.
* PARANOIA_SLOT_COUNT was accidentally redefined in the source file.
* Fixed remove_paranoia_check(). It didn't remove anything.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25207 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added capture_tracing_stack_trace() which allocates space in the
tracing buffer and captures the stack trace according to the given
parameters.
* Added TraceOutput::PrintStackTrace() to print a stack trace thus
created.
* Added TraceEntry::DumpStackTrace() callback which is supposed to print
a stack trace for the entry, if it can do that.
* Added "--stacktrace" switch to the "traced" command, which causes the
stack traces for all entries that have one to be printed as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25205 a95241bf-73f2-0310-859d-f6bbb57e9c96
- use the dano version by default
- s/ddraquire/ddaquire/
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25203 a95241bf-73f2-0310-859d-f6bbb57e9c96
- the dano version is exposed as v1.1 so drivers can use select with a simple ifdef
- add copyrights from the tty driver as I'll be copying code from it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25201 a95241bf-73f2-0310-859d-f6bbb57e9c96
or connect() that passed sizeof(sockaddr_un) would always fail.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25138 a95241bf-73f2-0310-859d-f6bbb57e9c96
unlockpt(), which provide a portable way of opening a pty.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25134 a95241bf-73f2-0310-859d-f6bbb57e9c96
again.
* Publish /dev/ptmx. Opening it will open a fresh pty master. In
principle /dev/pt/ is obsolete now, but I guess we keep it around for
compatibility with BeOS. Though there shouldn't be many applications
opening a pty, that we might be interested in...
* New ioctls B_IOCTL_GET_TTY_INDEX (returns the tty index) and
B_IOCTL_GRANT_TTY (grants tty slave access rights).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25133 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added support for non-published condition variables. One has to call
Init() on those, and add entries directly with the
ConditionVariable::Add() method.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25110 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Made the object pointer passed to thread_prepare_to_block() const, so
that strings can be passed without casting. Passing a string could
maybe be made a convention for THREAD_BLOCK_TYPE_OTHER.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25109 a95241bf-73f2-0310-859d-f6bbb57e9c96
respective Private* base class.
* Changed sigwait() and sigsuspend() to use thread_block() instead of a
condition variable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25100 a95241bf-73f2-0310-859d-f6bbb57e9c96
thread_block(), thread_unblock(),...) that allow a thread to wait for
something without needing a semaphore or condition variable. It can
simply block and another thread can unblock it. Supports timeouts and
interrupting. Both semaphores and condition variables use this
common mechanism, now.
* Semaphores:
- Some simplifications due to the thread blocking mechanism.
- Changed locking order to sem -> thread. It was the other way around
before and when introducing the wait_for_objects() support I had
also introduced a situation where the locking was reverse, which
could potentially cause a dead lock on SMP systems.
- Instead of queueing thread structures, a semaphore queues
queued_thread entries now, which are created on the stack. The
thread::sem structure could thus be removed.
- Added sem_entry::net_count, which is sem_entry::count plus the
acquisition count of all waiting threads. This number is needed in
remove_thread_from_sem() and instead of computing it there we
maintain it.
- Fixed remove_thread_from_sem(). It would not unblock threads, if
the sem count was <= 0.
- Made sem::last_acquirer unconditional. It is actually needed for
sem_info::latest_holder. Fixed fill_sem_info() accordingly.
- Added some optional tracing output, though only via ktrace_printf().
* Condition variables:
- Could be simplified significantly through the use of the thread
blocking mechanism. Removed a good deal of unnecessary code.
- Moved the ConditionVariableEntry "flags" parameter from Wait() to
Add(), and adjusted all places where condition variables are used
accordingly.
* snooze() uses thread_block_with_timeout() instead of a semaphore.
* Simplified thread interrupting in the signal and user debugger code.
Instead of separate functions for threads waiting on a semaphore or
condititon variable, we only have a single thread_interrupt(), now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25099 a95241bf-73f2-0310-859d-f6bbb57e9c96
- If the hook of the timer we're cancelling is currently being
executed, we do now wait till it is finished. This is how the BeBook
specifies the function to behave.
- Periodic timers would not be cancelled, if their hook was being
invoked at the same time, since they weren't in the queue during
that time.
- Since we know the CPU on which the timer is scheduled (timer::cpu),
we don't have to look through any other CPU queue to find it.
- Fixed the return value. It should report whether the timer had
already fired, and was not always doing that.
* Added private add_timer() flag B_TIMER_ACQUIRE_THREAD_LOCK. It causes
the thread spinlock to be acquired before the event hook is called.
cancel_timer() doesn't wait for timers with the flag set. Instead we
check in the timer interrupt function after acquiring the thread
spinlock whether the timer was cancelled in the meantime. Calling
cancel_timer() with the thread spinlock being held does thus avoid any
race conditions and won't deadlock, if the event hook needs to acquire
the thread spinlock, too. This feature proves handy for some kernel
internal needs.
* The scheduler uses a B_TIMER_ACQUIRE_THREAD_LOCK timer now and
cancel_timer() instead of the no longer needed
_local_timer_cancel_event().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25098 a95241bf-73f2-0310-859d-f6bbb57e9c96
kernel and added a WrapperTraceFilter* parameter, which allows for
additional filtering. This way other commands can print tracing output
with special filtering.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25094 a95241bf-73f2-0310-859d-f6bbb57e9c96
keyword, so this stupid python should really be fixed instead.
* Enforced the 80 column limit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25090 a95241bf-73f2-0310-859d-f6bbb57e9c96
variable at once. It wasn't used anymore, and the code gets simpler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25080 a95241bf-73f2-0310-859d-f6bbb57e9c96
ones) for wait_for_child(), which is notified when any job control
condition (child dead, stopped, continued) occurs. These events are
relatively rare anyway, and it simplifies the code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25079 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Also removed the header files that belong to those files.
* Only kept the userland_ipc.h header for now, to remember us about the
former userland server driver (that I also removed - it can always be
resurrected from SVN if needed).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25045 a95241bf-73f2-0310-859d-f6bbb57e9c96
<libroot_private.h> to <user_group.h>.
* Added support in the registrar for adding and modifying users.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25040 a95241bf-73f2-0310-859d-f6bbb57e9c96
to port_buffer_size_etc(), but returns the info through a structure,
which also identifies the sender (uid, gid, team ID) of the message.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25003 a95241bf-73f2-0310-859d-f6bbb57e9c96
registrar provides access to the DBs via a port message based
protocol. The functions in libroot just ask the registrar now.
* Added Linuxish shadow passwd support. No putspent() though -- we'll
provide private functions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25002 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added virtual destructor to BRefFilter in case the GCC version is 3 or newer
(can't do it for GCC 2.95.3, since that would break binary compatibility
AFAIKT)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24986 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Renamed BView::Alignment() to LayoutAlignment() which fixes a ton of warnings
and some conflicts with BControls.
* Added virtual destructor to BRefFilter in case the GCC version is 3 or newer
(can't do it for GCC 2.95.3, since that would break binary compatibility
AFAIKT)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24983 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Updated code so Processor IDs for older processor do not have to be
modified.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24979 a95241bf-73f2-0310-859d-f6bbb57e9c96
and defines the macros needed by them.
* Renamed syscall sys_vm_map_file() to _kern_map_file() and changed the
path to an FD parameter. Changed vm_map_file() accordingly and
adjusted the kernel ELF loader and the runtime loader.
* Added syscall _kern_unmap_memory().
* Added bool unmapAddressRange parameter to vm_create_anonymous_area()
and map_backing_store(). If true and the address specification is
B_EXACT_ADDRESS, all areas in the specified address range will be
deleted (unless an area is covered only partially).
* Introduced B_SHARED_AREA flag, which is set on areas that have been
created by {vm,_user}_map_file() with REGION_NO_PRIVATE_MAP. When
fork()ing those areas won't be copied CoW, but rather be cloned. This
is needed for mmap() MAP_SHARED.
* {vm,_user}_map_file() also accept an FD argument < 0, in which case an
anonymous area is created.
* Implemented mmap() and munmap(). Currently there's the restriction
that we can't partially unmap areas. Otherwise the functions should be
rather compliant. We also support the non-POSIX extension
MAP_ANONYMOUS.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24964 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Updated Intel processor IDs.
- Only take extended family/model into account on Intel processors.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24958 a95241bf-73f2-0310-859d-f6bbb57e9c96
have two more optional hooks for attaching supplied ancillary data to a
net_buffer and for processing received ancillary data. Not sure, if that
is flexible enough for all kinds of ancillary data, but it is for
SCM_RIGHTS and also should for SCM_CRED[ENTIAL]S (if we ever decide to
implement one of those) -- don't know any other types on other protocol
levels.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24941 a95241bf-73f2-0310-859d-f6bbb57e9c96
implementation ATM, since it malloc()s the required memory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24940 a95241bf-73f2-0310-859d-f6bbb57e9c96
That would explain why syscall restarts were broken. In fact there's no
reason to check the flag at all, since we know we set it.
ftp appears to work again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24918 a95241bf-73f2-0310-859d-f6bbb57e9c96
ATM.
* Changed common_fcntl() to also work for non-vnode-based FDs. Only the
operations that require a vnode do fail now. F_SETFL uses the new
fd_ops::set_flags() if available, falling back to the vnode respective
operation.
* Changed some direct accesses to file_descriptor::u::vnode. It was safe
in those cases, but might not be anymore if we ever change fd_vnode().
ftp can at least connect to servers again, now, but apparently we still
have a problem with syscall restarts -- downloads fail after one second,
when the timer goes off.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24917 a95241bf-73f2-0310-859d-f6bbb57e9c96
syscall_restart_ioctl_is_restarted() to syscall_restart_is_restarted,
IoctlSyscallFlagUnsetter to SyscallFlagUnsetter, and
IoctlSyscallRestartWrapper to SyscallRestartWrapper, as they are no
longer only used for ioctl().
* Removed unused syscall_restart_ioctl_handle_post().
* Made SyscallRestartWrapper a lot fancier. Instead of storing a
reference to the result value, it stores the value itself, and it
features all the interesting operators that make it appear like that
value. This simplifies the use of the class quite a bit.
* THREAD_FLAGS_SYSCALL is now set for all socket function and the
read[v](), write[v]() syscalls.
* Added is_syscall() function and net_stack hook to the net stack.
* Removed "kernel" parameter from all net_stack_interface and net_socket
module hooks. They aren't need any longer, since is_syscall() can be
used instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24914 a95241bf-73f2-0310-859d-f6bbb57e9c96