Commit Graph

25101 Commits

Author SHA1 Message Date
Axel Dörfler
9c5c79ad86 * Made DIR definition private, and moved it into the new dirent_private.h
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
2008-07-09 11:16:00 +00:00
Axel Dörfler
6ad2f357dc * Both, rootfs, and devfs did not correctly report the number of entries
returned by fs_read_dir().
* Removed superfluous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 10:59:02 +00:00
Stephan Aßmus
fe3d5b3083 Implemented a simple fix for the message-pile-up problem of
BView::GetMouse( , ,useHistory = true) in case the application
calls GetMouse() in a loop with a longer delay then mouse
messages arrive at the queue. The "when" field of the messages
is used to discard old mouse moved messages. This also fixes
the possible problem of finding the same message over and over
in case it is not removed from the queue for other reasons.
This fix makes selecting text in Pe for example usable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 10:03:28 +00:00
Ingo Weinhold
74d5c1e499 * Fixed serious memory leak in team_create_thread_start(). The
destructor of the automatic KPath variable was never invoked, since
  normally arch_thread_enter_userspace() would not return and thus the
  function scope never be left. After a standard "jam @image" almost
  42 MB of kernel heap were lost this way.
* Added a few warning comments in functions that shouldn't use automatic
  variables with a destructor in the function scope either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26336 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 03:58:38 +00:00
Ingo Weinhold
d1d7044ed1 Added TODO regarding memory leak. Too tired ATM to solve it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26335 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 03:04:39 +00:00
Ingo Weinhold
b64e66fbd0 Changes related to the "caches" command:
* The table used for sorting the caches could be too small for the
  number of caches in the system. We never checked that, which could
  cause a crash or triple faults when invoking the command.
* We now allocate the table as an area. Also increased the table size to
  102400 entries.
* Also print the committed memory for non-RAM caches, if they are the
  root cache of a cache tree that has committed memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26333 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 01:56:58 +00:00
Marcus Overhagen
0cd4d5fa02 Report SCSI_STATUS_GOOD after successful ATAPI commands. This makes CDDA-fs work with AHCI.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26332 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 22:39:03 +00:00
Stephan Aßmus
f3312751b9 honor 80 char limit in comment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26331 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 22:31:26 +00:00
Jérôme Duval
3787196a5a * some methods to access stream registers were defined with wrong types
* use HDAC_BIDIR_STREAM_OFFSET and HDAC_OUTPUT_STREAM_OFFSET when applicable
* use a PAGE_ALIGN macro


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 21:48:50 +00:00
Jérôme Duval
f67bbdb2a6 fixed warnings
use playback rate as preferred rate (instead of record)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 21:31:14 +00:00
Stephan Aßmus
264df95726 All input device add-ons should already do this, but make sure that
mouse messages have a "when" field with the event system time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 20:29:18 +00:00
Stephan Aßmus
d36ae78cc6 Added two tests:
* statusbar was used to test and improve some BStatusBar behavior
* lagging_get_mouse demonstrates what the problem is with older
  applications using synchronous GetMouse() calls without specifying
  that they actually don't care about mouse history.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 20:01:31 +00:00
Oliver Ruiz Dorantes
48cca06a81 Add new virtual method in the delegates to launch the device, Instantiation meant only to open/register the localdevice
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 18:39:41 +00:00
Stephan Aßmus
6be60b2d19 Applied patch by Jan Kloetzke:
The PUSHF/POPF instructions were not emulated correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 18:25:45 +00:00
Stephan Aßmus
fc8e77f863 When a BBitmap is drawn with scale, but also only partly, the inverse
image scan generator matrix was calculated wrongly. The part of the offset
that lies within the bitmap bounds needs to have the scale applied as well.
Maybe this code can be simplified. Appearantly there is not a lot of code
that uses BBitmap drawing this way, perhaps because the R5 version has had
issues with rounding. But MediaPlayer uses this feature for drawing the peak
levels and this is fixed by this change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 17:48:30 +00:00
Stephan Aßmus
93016537eb Check if the Painter even has a clipping region set before trying to take the
short cut when no text needs to be rendered. I've seen a crash yesterday in
the app_server test environment when the decorater was drawing something,
although it may also have been because I had a screwed up objects folder
where some objects were not recompiled because I am switching back and forth
between two app_server code folders.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 17:41:15 +00:00
Stephan Aßmus
bafcc63bcc This is either a fix or a workaround for a problem in Pe, where the
application modifies the scrollbars one by one and the changes would
have some weird cyclic effect where the constrains of one scrollbar
affected the scrolling already while they would be lifted afterwards.
It sounds weird, but maybe it is simply a resulting behavior of the
BeOS implementation which does not check the scrollbar restrictions
in the BView code. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 17:21:39 +00:00
Jérôme Duval
81a7dedd6b init buffer_cycle
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26321 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 16:41:52 +00:00
Ingo Weinhold
65748dc8d9 Remove() was moving an additional array element. Mostly harmless, but
would cause a crash when the array end was page-aligned and the next
page was not accessible. Happened to me during a "rm -rf ...".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26320 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 16:15:41 +00:00
Axel Dörfler
1bde8b03e7 * Replaced BFS's ReadWriteLock implementation with the kernel's rw_lock.
* The BlockAllocator now uses the new mutex_transfer_lock() function instead
  of clobbering the mutex directly.
* Removed Lock.h - it's no longer needed.
* Minor white space cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-08 08:04:37 +00:00
Axel Dörfler
78b32dd026 * The rw_lock is now able to nest read/write locks when you have a write lock.
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
2008-07-08 07:56:49 +00:00
Michael Lotz
f90a5e346d Adding bus_barrier macro to compatibility layer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 21:52:40 +00:00
Oliver Tappe
a042907733 * removed debuggin leftover
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 21:06:04 +00:00
Jérôme Duval
b5f75a7ec8 forgot to close the stream before deletion
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26310 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 20:45:54 +00:00
Karsten Heimrich
685483eada * set the what field to okok on success, as the epson returns 'Good' for some reason
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 20:04:03 +00:00
Karsten Heimrich
c5ea3d591d * rearranged header a bit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 20:01:46 +00:00
Karsten Heimrich
a836d47d56 * cleanup, no functional change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 19:39:10 +00:00
Karsten Heimrich
30cf4e6a54 * revert the last change as we can get stop etc. also
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 19:23:40 +00:00
Karsten Heimrich
7630cacab6 * check against baad as e.g. the epson addon does not return okok on success
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 19:14:08 +00:00
Karsten Heimrich
f56301c9e8 * maintain our own rect while printing, this makes it possible to print all pages e.g. syslog from StyledEdit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 19:10:39 +00:00
Oliver Tappe
3ad86c7ff5 Fixed R5 compatibility "layer" in libnetwork:
* instead of always converting from the expected r5_sockaddr_in to haiku's own,
  we now explicitly check whether or not the given sockaddr is an r5_sockaddr_in
  or not, naturally doing the conversion only if it is. This is necessary since
  even R5 applications may not always pass in r5_sockaddr_in structs (as for
  instance gethostbyname() will return a native [haiku-]sockaddr_in)
* cleaned up the confusion between the name r5addr and it's actual meaning
  (holding a haiku sockaddr_in) - renaming it to haikuAddr instead
* undid the part of Ingo's r25489 described as: "Extended R5 compatibility 
  check to also consider calls from libbnetapi" - as I fail to see why this
  would be desirable and in fact it stops at least Beam from working.
  Ingo: if you can remember, please enlighten me what was the reason behind 
  this change.
This finally makes Beam "work" (well: connect to servers and download mails ;-)
Vision, NetworkTime and NetPositive are still working, too, so hopefully there
are no regressions.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 18:53:01 +00:00
Axel Dörfler
06d5e1b3b6 * Added ReadLocker/WriteLocker classes to auto lock an rw_lock.
* Added *_init_etc() functions to the fs_shell.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26302 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 18:12:33 +00:00
Axel Dörfler
e2dfe00484 * Replaced most of the error enums with #defines.
* 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
2008-07-07 18:10:21 +00:00
Axel Dörfler
846f4fa2ab * Work-around for the KDEBUG "holder" mechanism; we actually want to lock the
mutex in another thread here than we will unlock it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26300 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:34:38 +00:00
Axel Dörfler
e0fc5e7380 * The fssh_auto_locker.h header was not self-contained.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:26:57 +00:00
Axel Dörfler
03fa417b70 * Removed the home-brewn locking classes in BFS besides the read/write lock
(for now).
* Inode::fSmallDataLock is now a recursive_lock, Journal::fLock is now
  a recursive_lock, too, Journal::fEntriesLock is now a mutex, as is
  BPlusTree::fIteratorLock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26298 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:21:00 +00:00
Axel Dörfler
af370c702a * Added a recursive_lock_trylock() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:17:34 +00:00
Axel Dörfler
589f1a9133 * Made the private kernel locking primitives available to file systems as well.
* 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
2008-07-07 15:19:19 +00:00
Axel Dörfler
36bf05cac9 * Added a lock to FileMap - since the map is retrieved lazily, and file
systems like BFS only hold a read lock when reading the map, accessing the
  file map wasn't safe.
* Made FileMap::Free() private, and renamed it to _Free().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:53:53 +00:00
Axel Dörfler
92c3ae2b69 * Reverted r26293 again, as that "subtle" change also prevented any device I/O
from happening...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:45:38 +00:00
Axel Dörfler
bed8516acc * file_{read|write}() now only accept regular files, and will return either
B_BAD_VALUE or B_IS_A_DIRECTORY depending on the vnode type.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:27:37 +00:00
Axel Dörfler
469c26e738 * Since we now have a vnode::type field, several calls of read_stat() were no
longer necessary.
* Optimized file_seek() using this field, too; reading the stat is now only done
  when necessary.
* file_read() and file_write() will now return B_IS_A_DIRECTORY so that not
  every file system has to care about that particular error code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:24:24 +00:00
Axel Dörfler
52ecda6ecf * Added some optional KDL command and statistics to the file map implementation.
* Turned them on for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:02:24 +00:00
François Revol
0cd3ea3e50 ...and the correct struct name.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 11:31:40 +00:00
François Revol
26e45f0523 Would work better with the definition...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 11:30:12 +00:00
François Revol
30145fa1fd - handle the supervisor bit from SR correctly on iframes
- various notes on 060 vs others:
	- 060 has 040 compatible mmu, except pgtables must *not* be on copyback memory
	- 060 has a processor control reg which has a revision number to use in system_info
- notes on ctx switch:
	- must be kept in sync with asm code
	- fsave generate variable size frames, so reserve space and use non-predecrementing EA.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 11:22:26 +00:00
Axel Dörfler
9dcc2929fa * Made a class FileMap from struct file_map.
* Added two TODO comments to the start of the file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 11:16:50 +00:00
Stephan Aßmus
62bf33df96 Don't reset the window size when playing a new file if it isn't necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 08:33:03 +00:00
Stephan Aßmus
591f4c05bc Remove the negative delay that was supposed to account for client->app_server
delay. The audio is later than the calculated realtime anyways, I suspect
the OSS Node does not advertise it's latency 100% correctly yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 08:32:17 +00:00
Michael Lotz
432e3df3c7 * Change the fixed bin list to a generated one based on a few constraining
factors per heap class. The previous bin sizes would in many cases just have
  wasted memory by not fully using up the available space while not providing
  any more elements than a bigger size. The computed bins ensure that the best
  sizes are used based on a min count, min size, alignment and max waste per
  page. Also changed the heap sizes to more reasonable values and renamed them
  to small, medium and large.
* Remove the shouldGrow parameter from heap_memalign() and just check it using
  heap_should_grow() where appropriate.
* Fix readding a nun-full area to the area list, the added page count can be
  bigger than one, therefore the check must be free_page_count == pageCount.
* Simplify ensuring correct alignment, just aligning the size instead of
  checking each candidate bin for alignment is enough.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 01:09:41 +00:00