Commit Graph

22197 Commits

Author SHA1 Message Date
Axel Dörfler
11790544cd Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 14:52:18 +00:00
Axel Dörfler
02c8f6c89d * Coding style cleanups, no functional changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 14:06:38 +00:00
Salvatore Benedetto
51daeb7147 - Fixed warnings
- Fixed deadlock in xsi_sem_undo - RecordUndo
- Fixed issue in xsi_sem_undo: if the semaphore set does not exist
anymore, ignore the request but do remove the process from the sUndoList,
which wasn't previously done.
- free() in ClearUndos was called with interrupts disabled
- when a semaphore set ends to exist, remove all it's sem_undo request as it's ID
will be reused in the future.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 11:30:55 +00:00
François Revol
64ea0b9f74 - fix early_map
- iospace should now be initialized correctly, at least the kernel goes much further.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:39:31 +00:00
François Revol
2fc21d4fad Use a bool to check if an irq was acknowledged by the MFP, else we don't call the handler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:36:33 +00:00
François Revol
150b5ae01f - don't movem a7, it's the stack pointer. the cpu saves it for us before processing exceptions.
- push the address of the iframe before calling the C handler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:34:40 +00:00
François Revol
b061bf2471 cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:31:19 +00:00
Axel Dörfler
ee091fc0cb * clearenv() did not return anything, but should have returned 0 for success.
* sCopied wasn't needed anymore due to the sManagedEnviron variable.
* Minor cleanup, added a description to copy_environ_to_heap_if_needed().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 17:58:04 +00:00
François Revol
7a1fd4cbf8 allocate all kernel page directories at boot, this will simplify later code a lot.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 16:01:02 +00:00
Axel Dörfler
06b4c67fa5 * Instead of just deleting the array, we have to delete its contents, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 15:08:06 +00:00
Axel Dörfler
cc6c784ae7 * Sean C. Farley made me aware that some of the possible solutions to clear
the environment would crash on Haiku. Added a small test application that
  just checks every one of those.
* Fixed env locking (in userland, you better check against B_INTERRUPTED).
* Made our code safe against an environ of NULL.
* There is now an additional sManagedEnviron that points to the environment
  our code actually managed; whenever an application overrides environ, we'll
  get aware of it with the next *env() function invocation, and will handle
  it adequately.
* Added non-POSIX clearenv() function.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 15:02:03 +00:00
Axel Dörfler
2accd07be4 * Replaced Chain with the new SinglyLinkedList.
* Renamed openModeToAccess() to open_mode_to_access().
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 14:20:16 +00:00
Stephan Aßmus
c1c81d42d1 * Use shared AutoDeleter.h instead of custom array deleter.
* Improve code in FileUtils to copy attributes in chunks and improve
  error checking. Should also copy 0 size attributes now, since those are valid.
* Craft SoundConsumer towards more style guide compliance.
* Use new (std::nothrow) and check result.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 14:16:05 +00:00
Axel Dörfler
d2d52d31ab * Made _LaunchInputServer() more robust: when launching by signature fails,
we try its well-known location directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 14:02:02 +00:00
Axel Dörfler
2e3477e3d8 * Changed the inode write locking to be held as long as the transaction is
running - this fixes several cases where someone could see outdated data
  when a transaction had to be reverted (the time between unlocking the inode
  and actually reverting the blocks). For that, Inodes can now be put into a
  singly linked list.
* Added a TODO in Inode::WriteAt() which explains why it cannot use the above
  method: seems that our VFS/VM locking model isn't really that good.
* Fixed a possible deadlock in Attribute::_Truncate() where the inode write
  lock was held before starting the transaction.
* Added an InodeReadLocker convenience class, that should be used instead
  of ReadLocker - Inode::Lock() only still exists because of the needs of
  bfs_io().
* Moved the bfs_io() callback hooks out of the exported module API region,
  and removed their bfs_ prefix.
* Added a Volume::IsInitializing() method that should be used rather than
  checking if Volume::ID() is >= 0.
* Removed the MultiInodeLocker again, as it's pretty much superfluous now.
* Moved openModeToAccess() to the Utility.h header.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 12:28:28 +00:00
Axel Dörfler
ebaab6d5f4 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 12:07:41 +00:00
Axel Dörfler
9f6ae76f02 * Added acquire_vnode() call that you can use to get another reference to an
inode - unlike get_vnode() the busy flag won't prevent you from getting that
  reference.
* Changed put_vnode() to return an error in case the vnode couldn't be found.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 09:59:19 +00:00
Ingo Weinhold
e6f3de9a29 Added TODO -- food for thoughts.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 00:23:56 +00:00
Ingo Weinhold
dbc6635d1e The page queues no longer count added dummy pages. This fixes a problem
in steal_pages() which uses the number of pages in the inactive queue as
return criterion. It would thus return, if only marker pages were in the
queue and no page could be stolen. This led to a busy loop in
vm_page_allocate_page(). The whole system would become unusable when the
thread in question was the heap grower, since it would starve everyone
else due to its high priority.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26710 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 23:54:14 +00:00
Ingo Weinhold
5087b42fd6 Superfluous whitespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 23:45:56 +00:00
Oliver Ruiz Dorantes
bbe098994d Wrong blackboard calculation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:59:06 +00:00
Axel Dörfler
a9ae9781ea * Removed no longer needed IOCTL_FILE_UNCACHED_IO definition.
* Some cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:09:02 +00:00
Oliver Ruiz Dorantes
b48fa68ace Fix bluetooth_server debug window tabs, they were getting out of bounds due the index assignation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:03:17 +00:00
Ingo Weinhold
12c9f1761f * Added thread block type constant for rw_locks, so that they are listed
correctly by the "thread" and "threads" debugger commands.
* Added "rwlock" debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 20:43:40 +00:00
Ingo Weinhold
9a0fc9a874 In cache_io(): Don't keep the cache locked while doing a
user_{memcpy,memset}(), since that can cause a page fault, which needs
pages and might try to steal some from our cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26700 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 19:23:17 +00:00
Ingo Weinhold
b627c47932 IORequest::Advance() would access the vec array out of bounds after
advancing to the end of the request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 14:22:52 +00:00
Stephan Aßmus
97d52f8e2a Make the peak display automatically go back down for the max peaks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26698 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 13:33:37 +00:00
Stephan Aßmus
d666a89e8f Check for index < 0 too for B_BAD_INDEX. This fixes for example Tracker-Grep
which does

message->GetInfo("field", &type, &count);
while (message->FindBlah("field", --count, &...) == B_OK)
	...;



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 10:54:08 +00:00
Axel Dörfler
274e684a8e * bfs_rename() did not write lock the moved inode, but only its former and
new parent directories. This would only be necessary in case it's a directory,
  but we do it always now.
* This fixes bug #2556.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 07:41:58 +00:00
Ingo Weinhold
cc2da70688 vfs_{read,write}_pages() have an additional parameter now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 23:55:30 +00:00
Ingo Weinhold
7f12cc54a7 * It is now supported that I/O operations and requests are only handled
partially (e.g. due to hitting the end of file). The respective
  classes have grown new methods and attributes to deal with that. The
  "finished" callbacks have got additional parameters to indicate
  whether the transfer was only partial and how much has been
  transferred. Other callbacks and functions have a size_t* in/out
  parameter instead of a simple size_t, now.
* vfs_{read,write}_pages() do now use the I/O request framework instead
  of the underlying FS's {read,write}_pages() hooks (those should be
  unused now). Furthermore they've got an additional "flags" parameter,
  which is passed to IORequest::Init(), i.e. it allows to specify that
  the given vecs refer to physical addresses.
* The file cache's read_into_cache() reads directly into physical
  pages, now.
* Fixed bug in DoIO::IO(): The offset was not adjusted, so that all
  pages were incorrectly transferred from/to the same location.
* Fixed broken subrequest scheduling loop head in
  do_iterative_fd_io_iterate().
* Adjusted the test driver and implemented its io() hook. Using this
  driver I/O requests are passed all the way from the VFS/VM to the
  driver and through the I/O scheduler. It even seems to work. :-)
* Added missing const to the iovec* parameter of the IORequest::Init()
  methods.
* Disabled some debug output by default. Added new optional debug
  output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 23:34:10 +00:00
Karsten Heimrich
df24dede80 * rename InterfaceUtils.h/cpp to BlockingWindow.h/cpp and adjust includes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 21:24:19 +00:00
Karsten Heimrich
1bf69d91a3 * remove all classes that where only used in pdf writer from InterfaceUtils
* get rid of three of them, i don't know why they where implemented in the first place

* fix broken scrollbar adjustment
* cleanup DocInfoWindow.h and DocInfoWindow.cpp
* make the window resizable and get rid of the tabview



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 20:32:10 +00:00
Axel Dörfler
b99521f213 First round of locking fixes:
* Moved locking the data stream out of the BPlusTree methods; this fixes at
  least two locations where another thread could have seen outdated/incorrect
  data.
* Removed some superfluous code in bfs_rename(): we don't have to revert to the
  previous situation, the transaction does this for us automatically.
* Added a simple MultiWriteLocker, even though it's not really necessary anymore
  (since we always hold the transaction lock first when we lock more than one
  inode at a time).
* Inode::Create() called InodeAllocator::Keep() a bit too early, the file cache
  and map wasn't created and assigned yet.
* InodeAllocator now keeps the inode write locked.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 18:32:14 +00:00
Oliver Ruiz Dorantes
e16deeff23 Fix: Returning always error at submitting acl RX frames(Mika Lindqvist)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 16:51:06 +00:00
Axel Dörfler
f5d5ca18f6 Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 16:29:57 +00:00
Axel Dörfler
37de5a0d83 * The rw_lock now behaves just like a recursive locker if KDEBUG_RW_LOCK_DEBUG
is defined to 1; this allows asserting the read lock case, too.
* Added ASSERT_{READ|WRITE}_LOCKED_RW_LOCK() macros. The read assertion is only
  working when KDEBUG_RW_LOCK_DEBUG is defined to 1, the write assertion works
  always.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 15:27:58 +00:00
Stephan Aßmus
87b8310c0f The ClippedLineTest now runs for 5 seconds max (should change the other tests
accordingly and refactor a bit). It also prints the number of clipping rects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 11:40:18 +00:00
Axel Dörfler
0b46f622d1 * Made struct ring_buffer public (within the kernel).
* Added "syslog" command that dumps the contents of the syslog ring buffer into
  KDL. Use the '-n' option to only show what hasn't been sent to the syslog
  daemon yet.
* When entering the kernel debugger, the current thread ID and name are also
  printed (not only the current CPU).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 10:03:22 +00:00
Stephan Aßmus
b4e9c99bc4 * Added a SetupClipping() method to Test baseclass, which adds about 400
small clipping holes to the TestView user clipping.
* Added a bunch of new tests. Here are some numbers from the test environment,
  which is similar to running Haiku in VESA mode:

Horizontal lines per second:
Haiku:	192964.663	(117,7%)
ZETA:	163977.006

Vertical lines per second:
Haiku:	 90109.985	(276.9%)
ZETA:	 32538.458

Random lines per second:
Haiku:	  7998.451	(23.1%)
ZETA:	 34602.539

Random colored lines per second:
Haiku:	  7976.437	(22.9%)
ZETA:	 34788.247

Random clipped lines per second:
Haiku:	   262.180	(2.5%)
ZETA:	 10394.794

Clipped glyphs per second:
Haiku:	  5911.526	(1.0%)
ZETA:	590508.726

Obviously the clipping performance is a punch in the stomache.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 21:12:48 +00:00
Stephan Aßmus
7b0cfaa569 No space between copyright notice and header guard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 20:07:10 +00:00
Stephan Aßmus
3cb3e0e210 * Fixed coding style issues pointed out by Axel
* Use more letters of the roman alphabet (doh...)
* Tested drawing mode is currently B_OP_COPY


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 19:03:38 +00:00
Stephan Aßmus
7c2658585f The start of a benchmark application to test various performance questions
of the Haiku app_server. The immediate comparison are of course BeOS and ZETA.
Currently, it measures the performance of drawing untransformed text. For
now, I have only tested on ZETA and the app_server testing environment. Will
let you know my findings with Haiku running on real hardware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 16:41:19 +00:00
Axel Dörfler
d06cc6e386 * Unmounting a volume didn't wait for the block allocator's initializer thread.
* This fixed bug #2541.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 16:26:47 +00:00
Ingo Weinhold
e9c954c387 Use file_map_translate() instead of bfs_get_file_map().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 13:54:43 +00:00
Axel Dörfler
188233b954 * Removed execute property - I wonder why this file is located in this directory,
though; it shouldn't be in here.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 12:44:24 +00:00
Axel Dörfler
47ca7595ca 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
2008-07-29 12:03:41 +00:00
Ingo Weinhold
ecc1c87fc7 IORequest::CreateSubRequest() didn't return the created subrequest, nor
did it set its parent request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 01:53:14 +00:00
Ingo Weinhold
8cc3c74406 The "cvar" command wasn't happy with private condition variables. Now we
don't check any longer whether the given number is the address of a
condition variable in the global hash table; we just assume it is a
valid condition variable pointer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 01:52:20 +00:00
Ingo Weinhold
cfae07b6ac Added kernel private vfs_vnode_io() which performs an io_request on a
vnode (falling back to synchronous I/O if the io() is not supported).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 23:46:50 +00:00