Commit Graph

1445 Commits

Author SHA1 Message Date
Axel Dörfler
2ecef3acbe * As Korli pointed out, I got a bit confused with Rescan() vs. Probe().
* Therefore, device_manager::rescan_node() now actually causes the
  driver::rescan_child_devices() function to be called, instead of probing
  again.
* Added a device_node::Reprobe() method that does what Rescan() did previously.
* Probe() should now also work with "dumb" busses that don't support type
  information - it will now probe all of these nodes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 09:13:04 +00:00
Axel Dörfler
7830589f02 Patch by Vasilis Kaoutsis:
* Added a missing close_module_list().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 07:28:04 +00:00
Michael Lotz
83d453239c Directly use memalign instead of malloc to safe one indirection.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 06:56:24 +00:00
Michael Lotz
b4babdf47e Move the device deletion after the unpublish call. Fixes crashes where a
device is still referenced through the devfs and used right between deleting
and unpublishing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 06:53:57 +00:00
Stefano Ceccherini
fa827b37fc took the liberty to add this to the buiild and fix compilation :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 05:02:59 +00:00
Stefano Ceccherini
54d9d37f9d Added patch by Dustin Howett: header with HPET definitions and (empty)
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
2008-06-03 04:37:18 +00:00
Ingo Weinhold
0cb2617fa5 Before starting to wait the undertaker does now check whether there's
already a dead thread available. Fixes a race condition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-02 04:34:09 +00:00
Ingo Weinhold
1c8de8581b * Added optional spinlock contention measurement feature. Enabled when
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
2008-06-02 02:04:12 +00:00
Axel Dörfler
032f1e5f90 * Fixed an endless loop when using vfs_get_vnode_name() or the "wrong"
get_vnode_name() variant.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 18:47:18 +00:00
Jérôme Duval
19b07e67d2 when acquiring results in an error, the resource should be reset to avoid a crash on delete
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 15:27:00 +00:00
Axel Dörfler
710b77326d * vm_cache::virtual_size is not always a multiple of B_PAGE_SIZE for files.
In these cases, the last partial page would have never been written back.
* This fixes bug #2282, and eventually others.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 10:53:10 +00:00
Ingo Weinhold
123dfa78e5 Enforce 80 columns maximum line length.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:40:08 +00:00
Rene Gollent
3104402815 gcc4 build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:36:47 +00:00
Ingo Weinhold
73aa393d73 * Introduced pipes in the kernel debugger. The syntax is similar to
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
2008-06-01 02:25:00 +00:00
Michael Lotz
9a18e1d269 * Do not delete the device handed over to the devfs when deleting the vnode
as it seems devfs should not take over ownership. The device is deleted
  in republish_driver for legacy drivers before the call to devfs_unpublish_device
  that in turn deletes the vnode. This looks generally suspicious to me as
  the device pointer the devfs vnode may still use gets invalid for a certain
  amount of time (until the node is unpublished). So maybe the devfs should
  take ownership of the device afterall and it shouldn't be deleted by the
  device_manager/legacy driver functions. Axel please review.
* Do not try to delete the IOScheduler for now as creating one is disabled
  currently too.

This fixes the crash on rescans of legacy drivers as seen when unplugging
USB devices.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 20:30:07 +00:00
Michael Lotz
3cec30848c Fix build with TRACE_VFS enabled and also fix a warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 19:06:30 +00:00
Michael Lotz
2ec83efbb2 Fix one reason for crashing on legacy driver rescans, but there seems to be
more to it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 17:45:27 +00:00
Ingo Weinhold
e4d2f9ba4f Removed the condition that only caches with a source can be merged.
Instead we only allow temporary caches to be merged. This remedies the
problem that after fork() + join() there remains a superfluous cache
layer for all RAM areas.
I haven't tested it, but this might improve the jam situation
memory-wise (huge heap is committed one less time), though it might
worsen it performance-wise (lots of heap pages are moved with every
merge).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 01:02:29 +00:00
Ingo Weinhold
ad66253c1a * Broke the cache merging code out of vm_cache_remove_consumer() into
new function merge_cache_with_only_consumer(), which is also used in
  vm_cache_remove_area(), now.
* Added tracing for the merge case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 00:27:02 +00:00
Ingo Weinhold
0a871009db Added VM cache kernel tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 22:09:51 +00:00
Ingo Weinhold
91312c915d Changed tracing output prefix from "cache" to "block cache".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 21:21:33 +00:00
Axel Dörfler
abc690633a * AHCI and other SATA drivers aren't in busses/sata, but either busses/scsi
or busses/ide.
* This change makes the AHCI driver working again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 15:03:15 +00:00
Ingo Weinhold
9101535322 Added new kernel thread "undertaker" which gets rid of dead thread
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
2008-05-29 14:28:31 +00:00
Ingo Weinhold
2b07b8e0f1 * Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 02:08:23 +00:00
Ingo Weinhold
1c18a5df87 Replaced R/W lock implementation. Should have a little less overhead
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
2008-05-29 00:32:06 +00:00
Ingo Weinhold
b0f5179aa5 * Changed recursive_lock to use a mutex instead of a semaphore.
* 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
2008-05-28 23:12:36 +00:00
Axel Dörfler
3023ab11f7 Patch by Jan Klötzke:
* Improve vm86 mode tracing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 12:44:56 +00:00
Axel Dörfler
9f16184577 Patch by Jan Klötzke with minor changes by myself:
* 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
2008-05-28 10:48:01 +00:00
Axel Dörfler
2c8b410ad5 Patch by Jan Klötzke:
* Current linking scheme does not always export arch specific symbols from the
  kernel. Merging all compiled arch stuff into a single .o file (and linking
  that to the kernel) fixes it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 10:08:07 +00:00
Ingo Weinhold
0e82c8d555 Improved the "caches" command:
* List the sum of pages used by a cache tree in the line printed for the
  root cache.
* Also print the amount of committed memory per cache (and the sum for
  the tree), and allow sorting the list by it ("-c" switch).
* Added usage text.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-27 23:23:01 +00:00
Axel Dörfler
2976912a51 * BaseDevice didn't initialize the fInitialized member, and thus causing bug
#2265.
* Device::InitDevice()/UninitDevice() are called from outside of the device
  manager, so they better lock it.
* Turned off debug output in devfs and the device manager.
* Fixed debug output in devfs to print the actual vnode/cookie values, instead
  of the structures the VFS passes in now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-27 12:04:09 +00:00
Axel Dörfler
4584521e0b * PCI_mass_storage_other no longer scans the non-existing busses/disk path, but
all busses now. This should help with broken controllers that don't advertize
  their capabilities correctly.
* Maybe we want to have a list that translates some types for certain devices,
  too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 21:03:32 +00:00
Maurice Kalinowski
ac1d597e94 gcc4 build fix. Don't have default value for declaration+definition. Build is still broken...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 20:49:22 +00:00
Axel Dörfler
34d976b499 Forgot to remove now unused files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 18:07:04 +00:00
Axel Dörfler
368167ede8 * Integration of the new driver architecture.
* 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
2008-05-26 16:52:27 +00:00
Axel Dörfler
113a13d83e Print actual floating point number, instead of integer fraction.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:13:19 +00:00
Axel Dörfler
1e18692e12 * get_vnode() now accepts a NULL parameter for the fsNode argument.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 11:32:27 +00:00
Ingo Weinhold
61de73e29c Memory leak in error cases. CID 729.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25659 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-25 23:41:22 +00:00
Ingo Weinhold
5839058aa9 Memory leak in error cases. CID 737.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:29:53 +00:00
Ingo Weinhold
a1e3759f69 Memory leak in error cases. CID 808.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25644 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:17:56 +00:00
Ingo Weinhold
cefcb7b41c Memory leak in error case. CID 872.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:07:29 +00:00
Ingo Weinhold
7ad3cf0bc3 Memory leak in error case. CID 873.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25642 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 16:04:57 +00:00
Ingo Weinhold
1462a0827b Reordered the functions (private -> public). No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 15:27:31 +00:00
Ingo Weinhold
6607b17d6b Pimped up the "caches" command. Now it prints the caches in trees with
additional info (offset, size, used pages, areas), sorting the trees
by used pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 00:48:15 +00:00
Ingo Weinhold
5e3a974d1e * When KERNEL_HEAP_LEAK_CHECK is enabled we also store the calling
function requesting the allocation.
* The "allocations" commands does also print the caller and can filter
  by caller, now.
* Added new "allocations_per_caller" command, which sums up allocations
  per caller and prints them in a table sorted by size or count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 22:30:20 +00:00
Ingo Weinhold
fe8878faa4 Implemented unmapping of partial areas (mmap()/munmap()). Review
welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 14:00:15 +00:00
François Revol
15ebab7616 *pathconf() need to call statvfs() to be more correct, but the kernel doesn't have it. Remove conf.c for now, it's likely not needed anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 00:11:07 +00:00
Ingo Weinhold
0f448d21e5 * Added vm_page_write_modified_page_range(), which is similar to
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
2008-05-22 21:51:12 +00:00
Axel Dörfler
403bfdda6c * The floating point output now correctly honours eventual sign flags,
and actually shows the sign (before, it would just absorb it).
* On calling floating() from vsnprintf(), the order of the "fieldWidth", and
  "flags" parameters were mixed, causing some strange output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 15:38:09 +00:00
Axel Dörfler
15173df4e9 Last patch of the vm86 patch series from Jan Klötzke - thanks!:
* 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
2008-05-22 13:54:28 +00:00