Commit Graph

1330 Commits

Author SHA1 Message Date
Stefano Ceccherini
5945644720 Implemented _debuggerAssert().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-20 16:15:27 +00:00
Ingo Weinhold
f969977bc1 Patch by Vasilis Kaoutsis (modified by myself): Implemented sigset().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-18 16:39:18 +00:00
Axel Dörfler
d4fc2b7db7 * Fixed a bug reported by Ryan: the stack_end pointer of a thread was reported
one too low in comparison with BeOS (ie. the end pointer was inclusive, now
  it's exclusive).
* Moved static functions fill_thread_info(), and {send|receive}_data_etc() to
  the private function section.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-18 11:59:53 +00:00
Axel Dörfler
79939c8d1e The KDL command "teams" now also prints the team ID in decimal rather than hex.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22944 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-18 11:57:35 +00:00
François Revol
05c6416eba Add macros for syscalls with 11 to 13 args.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-15 22:59:35 +00:00
Axel Dörfler
fb431b443b * vfs_unmount() can now safely be called from the kernel (fs_unmount() still
tried to access the uninitialized vnode in that case).
* That means that it's now safe to remove a mounted CD from the drive, it
  will then be unmounted automatically.
* Added a check for partition::Device() - even though Ingo tells me it's
  impossible, it was NULL once.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 15:19:21 +00:00
Axel Dörfler
64a19b4444 Philippe was right, of course, the media checker thread did not bother to
check the fTerminating flag, so it would never quit (too bad no one ever quits
it anyway :-)). Thanks for proofreading!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 12:20:39 +00:00
Axel Dörfler
7333992516 On a media change, the KDiskDevice must do a bit more than it did:
* it now updates the partition data,
* the flags,
* and the disk geometry - and that now allows the session add-on to actually
  detect a newly inserted CD.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 12:18:06 +00:00
Axel Dörfler
ddd1769901 The file map code isn't that smart yet...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 11:20:17 +00:00
Axel Dörfler
4a31d30e84 * The file map needs to know the actual file size to be able to know if it has
the complete extent info or not.
* file_map_translate() now cuts down the request to the file bounds.
* Adjusted BFS and FAT to the API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 10:34:48 +00:00
Axel Dörfler
88ef411154 * Added an UninitializeMedia() method to KDiskDevice that also resets the
device geometry.
* If SetTo() reports no media, and GetGeometry() fails, the device geometry
  is now reset as well.
* KDiskDeviceManager::_ScanPartition() no longer unmarks the partition busy;
  this is now done by the caller, and done independently from the outcome of
  _ScanPartition(). This also fixes the problem that devices with no media
  were never marked unbusy (and thus were ignored subsequently).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 23:20:33 +00:00
Ingo Weinhold
6e122bd99e axeld + bonefish: Missed those changes in the previous commit:
* Added vfs_unmount(), which allows unmounting by dev_t (used by the DDM).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 20:54:17 +00:00
Ingo Weinhold
b3a5629b9e axeld + bonefish:
* Unmount when uninitializing a partition.
* Finished the media checker implementation, i.e. we rescan when a media
  was inserted and uninitialize when ejected.
* Turned the disk device media checker from a kernel daemon into a thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 18:41:36 +00:00
Axel Dörfler
637c2a8557 A tiny bit more debug output when tracing is enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-11 16:33:28 +00:00
Ryan Leavengood
0e230349da I needed nextafterf support in WebKit, so I added it here. It was already
defined in the headers. If this is not the correct way to do this, let me
know, but it seems to work (well it compiled at least.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-11 03:23:17 +00:00
Axel Dörfler
3d268eda3d * Extracted file_map API out of the file cache - it's now an optional service
that can be used by file systems.
* Changed the way the file cache works: instead of reading/writing to the
  underlying device directly, it can now be used for any data source, ie.
  also network file systems.
* As a result, the former pages_io() moved to the VFS layer, and can now be
  called by a file system via {read|write}_file_io_vec_pages() (naming
  suggestions are always welcomed :-)). It now gets an FD, and uses that to
  communicate with the device (via its fs_{read|write}_pages() hooks).
* The file_cache_{read|write}() functions must now be called without holding
  an I/O relevant file system lock. That allows the file cache to prepare the
  pages without colliding with the page writer, IOW the "mayBlock" flag can
  go into the attic again (yay!).
* This also results in a much better performance when the system does I/O and
  is low on memory, as the page writer can now finally write back some pages,
  and that even without maxing out the CPU :)
* The API changes put slightly more burden on the fs_{read|write}_pages()
  hooks, but in combination with the file_map it's still pretty straight
  forward. It just will have to dispatch the call to the underlying device
  directly, usually it will just call its fs_{read|write}_pages() hooks
  via the above mentioned calls.
* Ported BFS and FAT to the new API, the latter has not been tested, though.
* Also ported the API changes to the fs_shell. I also completely removed its
  file cache level page handling - the downside is that device access is no
  longer cached (ie. depends on the host OS now), the upside is that the code
  is greatly simplified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-10 21:19:52 +00:00
Ingo Weinhold
c9830ce0f5 * KDiskDeviceManager::{Find,Load}DiskSystem() can also find the disk
system by pretty name (not only module name) now.
* _user_initialize_partition() loads the disk system by pretty name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-10 20:30:22 +00:00
Ingo Weinhold
99ed286c94 Patch by Vasilis Kaoutsis: Implemented sigrelse().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-09 23:23:46 +00:00
Axel Dörfler
c84c58e41a Extracted file_map API for later use.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-09 17:09:54 +00:00
Axel Dörfler
3af0509ddb No wonder the page writer sucked so many cycles: the PageCacheLocker constructor
did not propagate the "dontWait" argument, letting the page writer never wait
for its pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-08 15:24:27 +00:00
Axel Dörfler
9edc2b526f The reserved pages computation used the same broken logic as read_into_cache()
and write_to_cache() before, IOW the cache could reserve too few pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-08 14:44:13 +00:00
Axel Dörfler
cfe386c2d5 * read_into_cache() and write_to_cache() both did not compute the number of
needed pages correctly, and would also not read/write enough in case the
  offset didn't start at 0 resulting in undetected short reads/writes. It's
  amazing how many bugs can be hidden in a few lines of code.
* Fixed a bug that might have been the cause for bug #1601: when the last part
  of the write did not end on a page boundary, the last page had to be read
  first, but that was done from the wrong offset. Also, if only parts of that
  page could be read (because the file size didn't span over the whole page)
  the remaining parts needed to be cleared.
* The cache_funcs were always called with the same value for numBytes and
  bufferSize so I've eliminated the former.
* Large reads now also bypass the cache in case of low memory, large writes now
  also only bypass the cache in that case, following Ingo's suggestion.
* Fixed compilation with debugging turned on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-08 13:45:04 +00:00
Axel Dörfler
09149281e0 The file cache now completely bypasses the cache for writes equal or larger
than 64KB. Reads should probably get a similar logic, at least if memory is
tight.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22857 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-08 09:30:58 +00:00
Axel Dörfler
67f0ddf604 Added the sModifiedTemporaryPages counter to the output of the "page_stats" KDL
command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-07 22:26:55 +00:00
Axel Dörfler
f7e414f22b * Made page_writer() use a marker page as well, so that it won't try to get
the same pages over and over.
* Increased the priority of the page writer a bit, so that it is higher than
  the one of the page daemon.
* Added a sModifiedTemporaryPages counter to let the page_writer decide how
  many pages are there to write back (temporary pages would go to the swap file
  and are only written back when memory is low).
* In case there are more than 1024 modified (non-temporary) pages around, the
  page writer will constantly write out pages, not only when being pushed.
* The page writer now temporarily always leave out temporary pages (as long as
  we don't have a swap file).
* Shuffled functions around a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22852 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-07 17:09:05 +00:00
Ingo Weinhold
0a1968cf8f Patch by Vasilis Kaoutsis: Implemented sighold().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-06 22:11:43 +00:00
Ingo Weinhold
a81e874ffb * Added opt-in debugging feature: Recent allocation-related operations
on pages are recorded in a history and can be printed via the
  "page_allocations" command.
* Fixed a problem in the page scrubber. It temporarily removed pages
  from the free list, which could have been reserved by someone else.
  When actually allocating the reserved pages, that someone could find
  free and clear lists empty and would therefore rightfully panic
  ("Had reserved page, but there is none!").


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-06 01:07:13 +00:00
Axel Dörfler
5ff3d4f2db * If steal_pages() stole more than originally asked for, it might have lost those pages in the
non-reserve case.
* vm_page_allocate_page() could also lose a stolen page in case more free pages were available
  after steal_pages() was called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-05 11:37:02 +00:00
Ingo Weinhold
7b45b55be1 * Added back and partially reimplemented the
K{Disk,File,Partitioning}System writing methods. It is now required
  that the caller has marked the concerned partitions busy, hence we can
  (read-)access them without needing a lock. The module interfaces will
  will be changed to take advantage of the fact as well. The methods take a
  disk_job_id instead of a KDiskDeviceJob* now, though I haven't quite
  decided, whether we need it at all or just want to add a special
  handling in the cases where notifications during the operation make
  sense.
* Reimplemented the disk device write support syscalls (save
  _user_move_partition() for which other module hooks are needed). They
  call the KDiskSystem methods, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-05 00:42:47 +00:00
Ingo Weinhold
2128ea4f31 Added IsBusy(bool) version, which optionally also checks the
descendants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-05 00:30:14 +00:00
Ingo Weinhold
a56a0c276a Patch by Vasilis Kaoutsis: Removed redundant parameter check (sigaction()
does it anyway).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-04 17:48:49 +00:00
François Revol
4e44040df4 Ditto.
cleanup
Less ppc, more m68k :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22822 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-03 21:04:42 +00:00
Jérôme Duval
f87a6142a4 SYSCALL20 is needed on x64-64
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-02 19:18:01 +00:00
Ingo Weinhold
53715fe060 * Got rid of the B_PARTITION_DESCENDANT_BUSY flag.
* Added CheckAndMarkBusy() and UnmarkBusy() methods to KPartition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-02 00:29:46 +00:00
Ingo Weinhold
8354dac78e Folded KPhysicalPartition into KPartition. Removed the notion of shadow
partitions from the disk device manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 23:36:21 +00:00
Ingo Weinhold
327887959e * Moved partition scanning back to KDiskDeviceManager. ATM only
synchronous scanning is supported.
* Removed the disk device job support from the disk device manager.
* K{Disk,File,Partitioning}System:
  - Remove querying and validation methods.
  - Commented out the modification methods until their fate is decided.
* Removed obsolete _user_get_partitionable_spaces().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22799 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 22:41:22 +00:00
Jérôme Duval
7d2666b85a added a few more syscalls arguments for _kern_create_child_partition()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22793 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 19:36:34 +00:00
Ingo Weinhold
c727d6fd76 Patch by Vasilis Kaoutsis: Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22790 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 18:05:22 +00:00
Ingo Weinhold
74fa73bac6 Patch by Vasilis Kaoutsis: Implemented sigignore(). Small changes by myself.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 18:03:36 +00:00
François Revol
1b6ddd3492 Optimized 64bit atomics:
- use movem
- fix return value: the convention is to return in d0:d1 (MSB:LSB)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 03:43:08 +00:00
Ingo Weinhold
300868ce27 * Removed no longer needed disk device related syscalls
(_kern_{supports,validate}_*(), etc.).
* Adjusted the prototypes of the disk device modification syscalls.
  Commented out their implementations for the time -- they'll mostly
  have to be rewritten completely.
* Implemented the userland disk device jobs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 21:16:22 +00:00
François Revol
ac1a8a0c8d Note on 060 equivalent of HLT.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-27 23:50:58 +00:00
François Revol
7986b7e36d Make use of the kernel's elf loader code instead of duplicating it.
Add placeholder for m68k.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-27 12:01:52 +00:00
François Revol
0743882d32 Make kernel elf loaders usable by bootloader to factor them out of it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-27 11:49:59 +00:00
François Revol
b82ae48b36 Note on use of TAS,CAS and CAS2 on Amiga.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 22:27:31 +00:00
François Revol
fac9743e5c s/ppc/m68k/
Lure the preprocessor to not replace #n by "123" for syscalls...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 17:09:08 +00:00
François Revol
dd68e9e8b4 More of the libc...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 17:07:23 +00:00
Axel Dörfler
c657332910 * The file cache now remembers the last 3 accesses to be able to detect
sequential access.
* This is now used to let the cache free some pages (or schedule them to be
  written back) before vm_reserve_pages() is called, but only if that cache
  is not mapped, and there is a memory shortage.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 09:15:33 +00:00
Ingo Weinhold
77c02b906b Patch by Vasilis Kaoutsis: Check for a valid signal number before
doing something. If the signal is not valid, set errno and return -1.
Mini style changes by myself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 22:01:16 +00:00
François Revol
2bbf13b7a5 Add syscalls.
Fix CAS2 usage, only supports (An) addressing mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 18:45:34 +00:00