Commit Graph

21317 Commits

Author SHA1 Message Date
Ingo Weinhold
99454e4a90 If the ring buffer is full line_buffer_readable_line() returns the
buffer size in case the buffer does not contain an EOL or EOF. This
prevents readers from waiting infinitely, if canonical input processing
is enabled in that situation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 19:07:51 +00:00
Ingo Weinhold
e8429ec9e6 * Added debugger command "tty", which dumps some info about a tty.
* RequestOwner was removing the wrong request from the second queue,
  which could cause the list structure to become invalid and result in
  bug #1526.
* In the writer loops we do now call tty_notify_if_available() when
  we're potentially going to wait and had written something before, so
  that a waiting reader will be woken up also when we write more bytes
  than fit into the ring buffer.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 19:04:44 +00:00
Marcus Overhagen
2f28a3f623 Added PCI ids from Freebsd, Netbsd and Openbsd pcidevs files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22420 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 17:57:09 +00:00
Marcus Overhagen
83447512ed Changed device detection. The driver now first uses device and vendor id to check
for devices. This allows using devices that are in IDE compatibility mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22419 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 16:05:23 +00:00
Ingo Weinhold
b2d056ecde Add wait_for_objects.cpp to the kernel, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22418 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:52:47 +00:00
Ingo Weinhold
b16fdbd661 Little test program for wait_for_objects_etc().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:48:39 +00:00
Ingo Weinhold
636bfc08ae * Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
  private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
  work pretty much like poll(), but also for semaphores, ports, and
  threads.
* Removed the "ref" parameter from notify_select_events() and the
  select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
  is no longer needed. The FS interface select() hook still has it,
  though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
  pair, now. Added respective functions for semaphores, ports, and
  threads.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:47:31 +00:00
Axel Dörfler
a82d70c719 Fixed PLL clock for i8xx chips again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 17:40:05 +00:00
Stephan Aßmus
2a74c55308 * when a vector icon was present, BAppFileInfo::GetIcon() would return an
error if the provided bitmap was B_CMAP8, now BIconUtils will convert the
  icon to B_CMAP8
-> this behaviour is a little inconsistent compared to what happens when
  reading icons from attributes, there, the CMAP8 icon is prefered in case
  such a bitmap is passed, even if a vector icon exists. I am not really
  sure which behaviour is better. For a consistent UI, maybe it is better
  to prefer the vector icon always. I've added a note to BAppFileInfo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 16:54:34 +00:00
Axel Dörfler
e5b464d09f Added a TODO what we need to do with stolen active pages - for now, we don't
do anything with them, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 16:06:17 +00:00
Axel Dörfler
4421183286 * Changed Ld rule to allow adding resource files.
* Changed ResAttr rule to allow not deleting the file before writing the
  attributes.
* Added application signatures for the runtime_loader and zbeos, just so that
  they may have an icon, too (hint, hint) :-)
* As a side effect, this also let's FileTypes handle these two as apps (even
  though they aren't), so that I can close bug #606.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 15:22:13 +00:00
Stephan Aßmus
0064e64138 patch by Julun:
* fixed ticket #1500
	* big cleanup and removal of unused code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 14:54:15 +00:00
Stephan Aßmus
4d1c422802 * added a way for the ServerWindow message loop to determine the required type
of locking before processing the message (single/all window lock)
  -> in most message cases, I could comment out the unlocking/locking which
  switched to the different lock, because the required lock is now already held,
  this removes some race conditions which were commented in the code already
* EventDispatcher::SetDragMessage() didn't lock the object, this would have
  been bad if multiple windows tried to set a drag bitmap at once
* the Desktop object keeps track of mouse position and pressed buttons, so
  that it doesn't need to lock the EventDispatcher for sending fake mouse
  moves to windows on show/hide of windows (solves some cases of possible
  dead locks with the new locking strategy)
* the keyboard EventFilter switches the current workspace asynchrnously from
  the Desktop thread (another source of possible deadlocks)
* the "reader is trying to become writer" check in MultiLocker is only used
  in DEBUG mode now

As a summary: It would be nice if ServerWindow used a readlock for all messages
it processes itself, and forwards all messages for which it needs a write lock
to the Desktop thread. All cases where either the Desktop or the ServerWindow
mess with the EventDispatcher are possible sources of deadlocks. This is solved
right now by making sure that the lock is released before using the
EventDispatcher.

I have not observed any deadlocks while switching workspaces and launching
many apps anymore, neither crashes. But I have not tested extensively except
for in the test environment. That being said, I could reproduce the problems
on first try before in Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 14:09:11 +00:00
Axel Dörfler
2760c4cd73 * load_program() (and probably others) could call delete_image() with a NULL
pointer - which it now handles gracefully.
* This also fixes starting the runtime loader directly: it no longer crashes
  but will just return an error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22409 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 13:17:19 +00:00
Axel Dörfler
828d9454da * Fixed module leak in case there was an error during init when used on BeOS.
* Check safemode settings only when it's not already disabled (doesn't make
  sense to check those then).
* Minor cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 11:56:33 +00:00
Axel Dörfler
fb151b4af1 Fixed initialization threading issues I introduced yesterday.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 10:54:32 +00:00
Stefano Ceccherini
9c16019f62 Patch by Rene Gollent which fixes displaying of current time. I've used
snprintf instead of sprintf and reduced the size of the char array, 
though. Hope you don't mind, Rene.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 09:37:41 +00:00
Axel Dörfler
b5b11466b2 If opening the net_stack driver failed because there was no stack, opening it
a second time would magically work, as it skipped its initialization then...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 01:01:01 +00:00
Axel Dörfler
9f0d226c72 The no-swap store shouldn't fool the page writer into believing that its pages
could be written back. This should stop the page thief from stealing active
pages that cannot be recreated easily :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 00:01:18 +00:00
Ingo Weinhold
3c3674113f Fixed a race condition on thread exit: There was a gap between releasing
the death stack and reacquiring the thread lock in which another thread
could snatch our stack that we were still going to use for the
scheduler. Now we've got a second spinlock that we can hold while
releasing a semaphore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 22:46:56 +00:00
Ingo Weinhold
8609f5a242 * Increased condition variable hash size.
* Renamed condition variable debugger commands to cvar and cvars.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 22:28:54 +00:00
Ingo Weinhold
d0c2af7713 Addressed a deadlock race condition: Acquiration of condition variable
and thread spinlock was reverse in Wait() and Notify(). The thread lock
is now the outer lock -- this way it is still possible to call Notify()
with the thread lock being held.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 22:24:42 +00:00
Ingo Weinhold
1c118ebc62 * Added a handy FDGetter AutoLocker-style class.
* In select_fd(): First get the file descriptor, then check whether any
  events have to be selected at all. This has the advantage that the
  caller can interpret an error return code as invalid FD. Consequently
  common_poll() no longer checks FD validity separately -- this was a
  race condition.
* common_poll() always selects POLLERR and POLLHUP now, which it has to
  do according to the specs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 18:48:52 +00:00
Ingo Weinhold
1221a4f200 Allow derived classes to access the member variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 18:39:02 +00:00
Ingo Weinhold
21873fffb3 Partitions are no regular files. The check for mere existence shall
suffice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22398 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 17:36:52 +00:00
Ingo Weinhold
f515ed5f77 Added build variable HAIKU_DONT_CLEAR_IMAGE. When set and the image does
already exist, it won't be zeroed out. The image will still be
initialized with BFS, though. Handy for installing Haiku on a partition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 17:27:13 +00:00
Axel Dörfler
a977fc17e3 Build fix; I renamed the "dos" file system to "fat".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 15:52:28 +00:00
Axel Dörfler
10194ebc8a Minor build fix - it still doesn't link, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 15:43:45 +00:00
Marcus Overhagen
c134c7b07c disable some debug output
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 10:28:24 +00:00
Axel Dörfler
7746846941 * The ProgressWindow now starts centered over the reference window on every
open.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 10:21:12 +00:00
Ingo Weinhold
eb138dc9c4 Moved the select_sync_pool from tty_cookie to tty. No need to have one
per cookie.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 01:41:46 +00:00
Ingo Weinhold
66c03dc3a9 * fd.c -> fd.cpp
* Reworked the select support:
  - The io_context additionally stores a table of lists of select_infos,
    which enables it to deselect events of a pending select() when
    closing a FD. This prevents a race condition potentially causing a
    write to stale memory.
  - The opaque selectsync* passed to FSs is now actually a select_info*.
    This was necessary, since the FDs deselect() hook (unlike the
    select() hook) doesn't take a "ref" argument and deselecting a
    single info (e.g. caused by a premature close()) was not possible.
    The select() hook's "ref" argument has become superfluous.
  - It should now be relatively easy to implement a poll_on_steroids()
    that can also wait for objects other than FDs (e.g. semaphores,
    ports, threads etc.). 
* Set/reset the signal mask in common_select(). This makes pselect()
  work as required.
* Reorganized vfs_resize_fd_table().



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 01:37:28 +00:00
Ingo Weinhold
f5ede4ec02 Added two small select() test programs. select_check select()s
stdin/out/err according the what was specified via arguments.
select_close_test select()s a file descriptor that is closed a little
later by another thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 00:39:38 +00:00
Stephan Aßmus
242eff3d7b * prepare optional package Vision (download at sourceforge has been updated
with HVIF icon too, thanks DeadYak!)
* enable optional packages in your UserBuildSetup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 17:24:57 +00:00
Axel Dörfler
e2693621b6 Correctly implemented the missing BBitmap::GetOverlayRestrictions() on the
client and the server. This should fix bug #1490, but I haven't tested it yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 16:03:53 +00:00
Marcus Overhagen
bfd9a59f77 This enable write support. The driver should be useable now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22387 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 15:54:35 +00:00
Marcus Overhagen
a2a169feab Improved interrupt handling
Removed DBC_I interrupt
Reduce debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 15:12:39 +00:00
Marcus Overhagen
ea44575a31 Cleanup, improved error handling, fix setting of DBC_I bit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 14:02:04 +00:00
Axel Dörfler
083de48a4b * Rewrote the trigger selection mechanism: it now searches for uppercase
characters first, and then falls back to take everything. fTrigger is now
  uint32 and works with all unicode characters; unlike in BeOS, the
  MenuTriggerTest application now works correctly in Haiku.
* fTriggerIndex is now a character position, not a byte position of the label;
  this allows BMenuItem::DrawContent() to draw the trigger at the correct
  position, even if there are multi-byte UTF-8 characters.
* The above fixed bug #1506; triggers are still not working, though.
* Rewrote Menu.h header.
* Renamed all private methods (that are not called by BWindow) to have the
  underscore prefix.
* Removed unused methods.
* Some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 10:52:45 +00:00
Stephan Aßmus
05bcaa5a60 * put more website icons under version control
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 09:49:01 +00:00
Axel Dörfler
b15c9adec7 * Decoupled the page_thief() from the low memory handler chain. This is
necessary because low memory handlers might need to wait for other services
  while we need to make sure the page thief can always steal pages.
* Made the page thief more aggressive when memory is critical: added a third
  run where it will also steal a small amount of active pages to keep things
  going.
* The page thief did not maintain the cache's reference correctly in all
  situations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 09:36:28 +00:00
Stephan Aßmus
212ad3266b * all the icons in native Icon-O-Matic format (including named paths, styles and
shapes) which have so far been done for Haiku, the website and other apps


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 09:34:20 +00:00
Stephan Aßmus
86952603d8 * updated WonderBrush location to the new release
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 07:54:58 +00:00
Ingo Weinhold
f0c668a83a Notifying readers and select() takes canonical input processing into
account when checking for the number of readable bytes. For readers
it doesn't make a difference, since they were looping anyway, but
select() would report read-availability incorrectly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-30 00:52:06 +00:00
Ingo Weinhold
d5cbcd91b7 * Use condition variables instead of semaphores for blocking readers and
writers.
* Removed the optimization for piping data between two threads of the
  same team. This greatly simplifies the code. It seems to me the case
  is very uncommon; it could be added back later, though.
* Basically rewrote reading from and writing to the pipe:
  - A blockable writer can now write more than what is currently
    available in the ring buffer.
  - Writing respects the PIPE_BUF non-interleaving limit, though our
    headers don't seem to define PIPE_BUF anywhere.
  - Unblock writers, when the last reader is gone and send those that
    haven't written anything yet a SIGPIPE. Fixes bug #1476.
* Correctly implemented select() support. We were only notifying
  writers. We manage two separate select sync pools per pipe now: one
  for the reader end and one for the writer end.
* Reading/writing from the root dir does no longer end in KDL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22378 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 23:52:23 +00:00
Axel Dörfler
16da0b3cdd Added test application for menu triggers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22377 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 18:17:40 +00:00
Marcus Overhagen
0845746bf7 Cleanup, device present detection improved.
Added support for non-48-bit LBA, added write support.
Proper error handling still missing, write support disabled for your protection.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 17:11:24 +00:00
Axel Dörfler
3392e9bcd6 * Added some more debug output.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 15:48:11 +00:00
Axel Dörfler
b062823d81 * register_low_memory_handler() was called too early by several kernel
components - now, we divide the initialization of that service into two parts
  which allows this (before, most handlers were gone after boot).
* Added debugger command that dumps the low memory handlers.
* The slab allocator now registers its low memory handler with a higher
  priority, so that it'll run before the potentially heavier ones.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 15:46:40 +00:00
Stephan Aßmus
2a88281a61 * check for possible division by zero (just had a crash with divide error
on another machine, don't know if this was really the cause, but it should
  be checked nevertheless I guess)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22373 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 14:06:19 +00:00