Commit Graph

159 Commits

Author SHA1 Message Date
Ingo Weinhold bf95c9aee6 * The shadow_changed() FS and partitioning system hooks take an
additional partition_data* child parameter now.
* _user_get_partitionable_spaces() doesn't need to copy the buffer into
  the kernel, since it is no input parameter. It also copies back the
  actual partitionable spaces count on error, now -- B_BUFFER_OVERFLOW
  is returned when the buffer was too small, but then the count must be
  returned too.
* Fixed several instances of syscall implementations that unloaded a disk
  system, although they didn't load it in the first place. This screwed
  up the load count with undesirable consequences.
* _user_create_child_partition() would set the size to the supplied
  offset.
* Fixed broken loop in KPhysicalPartition::CreateShadowPartition().
* KPartition::RemoveChild() notified the listeners about the wrong
  event.
* Intel partitioning module:
  - The *_get_partitionable_spaces() correctly return B_BUFFER_OVERFLOW
    now, if the supplied buffer is too small.
  - Implemented a part of pm_shadow_changed(), which creates and updates
    the PartitionMap, so that the validate_*() hooks have a chance to
    work at all.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 15:39:35 +00:00
Ingo Weinhold dbef8fc452 * Added get_physical_partition() function, which always retrieves the
physical partition, unlike get_partition() which returns the shadow
  partition, if it exists.
* Added B_PARTITION_SHADOW[_CHILD] partition pseudo operation values for
  the shadow_changed() hook, notifying a disk system, that a shadow
  partition has been created.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 15:11:37 +00:00
Ingo Weinhold db5c68ca46 * Added the partition size as parameter to the file and partitioning
system initialize() hooks. It's often the only info about the
  partition one needs and thus locking the partition just to get it is
  no longer necessary.
* intel partitioning system:
  - Removed passing around block sizes. We require 512 byte sectors
    anyway. In fact using the parent partition's block size was even
    wrong.
  - Simplified writing the partition map sector.
  - Simplified and corrected the partition map initialization.
  - We don't fail identifying a partition anymore, if the partition map
    contains no partitions. We would never identify a freshly
    initialized partition map before.
  - Made pm_identify() more intelligent: It determines the priority to
    return depending on whether the partition is the device itself and
    whether we have recognized child partitions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 23:48:18 +00:00
Ingo Weinhold 8c8f8c8420 Added scan_partition() function which can be used by disk systems (e.g.
in *_initialize()) to save some work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 18:03:24 +00:00
Axel Dörfler 3e9513aa4a * fs_{write|read}_pages() now has an additional argument "mayBlock".
* the page writer don't allow to block, while all other writers do. This fixes
  bug #1509. The reason the page writer needs this is because it marks several
  pages from different caches as busy.
* Fixed a warning about ASSERT being defined already in BFS, since
  util/DoublyLinkedList.h now includes debug.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 12:45:15 +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
Marcus Overhagen 8ce98e44cc convert files to new include file locations
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22347 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:53:42 +00:00
Marcus Overhagen 641e015e6e this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:08:52 +00:00
Marcus Overhagen 178bce195a this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:07:23 +00:00
Marcus Overhagen 4ecfa05eb3 this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:06:24 +00:00
Marcus Overhagen 5451eb688b this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:05:55 +00:00
Marcus Overhagen 7d4093aa23 this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:04:05 +00:00
Marcus Overhagen 402a4a4e7b Set scsi target id limit to 16, was previously hardcoded to 2. Add a node attribute to allow overriding this value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-26 19:57:51 +00:00
Marcus Overhagen c42a837e85 scsi_sim_cookie is just another name for void *
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-26 16:55:45 +00:00
Ingo Weinhold 76a8ec23db * Added disk system flags for whether a partition name and partition
content name are supported.
* Added file_system_module_info::flags (analogously to
  partition_module_info::flags) which indicate which disk device
  features the FS supports.
* Replaced the
  file_system_module_info/partition_module_info::supports_*()
  hooks by a get_supported_operations() hook and for partitioning
  systems additionally a get_supported_child_operations() hook.
* Updated file and partitioning systems accordingly.
* Updated fs_shell accordingly.
* Updated the DDM accordingly. The syscall interface remains unchanged,
  though.
* _user_supports_initializing_partition() also checks whether the parent
  partitioning system is content now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-22 21:21:30 +00:00
Ingo Weinhold 9e12e9a72e * Added mapping of dup() in the FS shell.
* Adjusted the FS initialize() hook to have FD and partition_id
  parameters like the other hooks instead of the partition path.
* Adjusted initialization in BFS accordingly.
* Implemented the FS initialization method in KFileSystem.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-02 12:43:49 +00:00
Axel Dörfler edb15b5565 bonefish+axeld:
* Simplified the notification framework: removed the updater stuff completely;
  it was only there to account for some peculiarities of the node monitor which
  we now solved differently.
* NotificationListener no longer includes a doubly linked list link for convenience;
  it might want to listen to more than just one service.
* NotificationService cannot have an abstract destructor.
* Changed the _user_stop_watching() syscall to mirror the Be API; ie. it's no
  longer possible to just remove some flags separately, just to stop listening
  completely.
* Adapted the node monitor implementation to live in the NodeMonitorService class
  that uses the new notification framework.
* Removed the public kernel node monitor API - it wasn't useful that way since you
  couldn't do a lot with the KMessage in the kernel without using a private API.
  Now you will have to use the (private) notification manager to use the node monitor
  from inside the kernel. At a later point, we might introduce a public API for that,
  too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-01 14:48:44 +00:00
Ingo Weinhold 2dc6403ddc Addition of write support to the disk device manager. Courtesy of Tomas
Kucera and Jan Matejek.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-27 12:12:35 +00:00
Philippe Houdoin f4ac9a9693 DPC module interface is not binary compatible with Be's own DPC.
Make our DPC named differently to avoid this confusion.
Detected while testing our ACPI (which needs our DPC) under 
R5...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-25 23:44:00 +00:00
Axel Dörfler 7a1b4ef3fd Obviously forgot to commit these; they were part of the mount_id/vnode_id to dev_t/ino_t
conversion.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-05 14:48:16 +00:00
Michael Lotz ac9d119566 Commiting patch by Salvatore Benedetto. This adds isochronous handling to the USB bus manager and enables inbound isochronous support in the UHCI driver. Thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-25 19:51:12 +00:00
Axel Dörfler 6be1e37d94 * Cleaned up SCSI headers a bit.
* scsi_cmds.h declared several variables instead of naming enums.
* the CD-ROM standard retrieval was broken (always checked index 0).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-10 14:13:37 +00:00
Hugo Santos cdb3eb762a the previously added IO interrupt handling routines are no longer necessary, at least for now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-06 22:40:52 +00:00
Hugo Santos 5502e596dc added io_interrupt_handler methods for dynamic handling of IO interrupts, including enabling/disabling without allocation and in interrupt context.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-06 15:07:56 +00:00
Axel Dörfler 5c03270bea Added block_cache_sync_etc() that allows you to sync single blocks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20811 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-25 12:07:30 +00:00
Ingo Weinhold 2f92537221 One unremove_vnode() prototype shall suffice.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-06 01:22:47 +00:00
Ingo Weinhold cf4ccd6575 Renamed the FS interface hook read_link() to read_symlink().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-05 03:52:57 +00:00
Ingo Weinhold 12d359b85a * Removed write_link from the FS module interface. Adjusted all FS
add-ons accordingly and removed the syscall.
* Removed send_notification().
* Reimplemented notify_listener(). It used the unimplemented
  send_notification(). Now it has a chance to work. Note that
  notify_listener() is obsolete. I would already have removed it, if
  there weren't lots of FS implementations still using it (Hint!).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-05 00:46:57 +00:00
Ingo Weinhold 9481e62bdb is_vnode_removed() is now known as get_vnode_removed() and returns its
answer through a reference parameter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-02 00:34:20 +00:00
Ingo Weinhold 223bba10f3 Resurrected is_vnode_removed().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-28 22:24:28 +00:00
Ingo Weinhold 1fbe3ccd4e * Reformatted to honor 80 chars/line limit.
* Renamed a few parameters of the FS module hooks:
  - *file in the attribute functions to *vnode
  - v to vnode
  - I could barely restrain myself from renaming the "_*" parameters. I
    understand this marks return parameters, but I'd prefer a nicer prefix
    or suffix (that doesn't makes you think this is a private/internal
    identifier) like "out", "ret", "return", "result", or something similar.

I'd also like to propose renaming {read,write}_link() to
{read,write}_symlink(). Er, and do we need write_link() at all?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-24 23:05:18 +00:00
Marcus Overhagen 9e8dd0a713 added PCI express capability
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20198 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-22 17:46:44 +00:00
Travis Geiselbrecht badc7b674e yet another fix for #1018, which has at this point blossomed into a reorg of how AP cpus are initialized.
the new cpuid stuff was apparently exacerbating an existing problem where various bits of low level
cpu code (specifically get_current_cpu) weren't really initialized before being used. Changed the
order to set up a fake set of threads to point each cpu at really early in boot to make sure that at
all points in code it can get the current 'thread' and thus the current cpu.
A probably better solution would be to have dr3 point to the current cpu which would then point to the 
current thread, but that has a race condition that would require an int disable, etc.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20160 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-19 00:11:24 +00:00
Marcus Overhagen 3f8d7bce7c added PCI capability support to bus api
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20151 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-18 00:18:13 +00:00
Marcus Overhagen 13dbe1c7ff Added support function to find a PCI capability offset in the configuration data, needed for SATA support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20149 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-17 22:57:59 +00:00
Michael Lotz 3a630146d2 * Minor cleanup
* Fixed wrong wording in comment

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-23 16:44:37 +00:00
Bruno G. Albuquerque e62e6bd5a7 Implemented support for hardware cache flush. This is based on code I originally
did for yellowTAB GmbH when I worked for then and is being used under permission.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-17 01:39:59 +00:00
Marcus Overhagen ebb02063bd Fixed documentation, uint16 was wrong and doesn't work. Also checked other usage of this items, but they are already correct.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-17 00:19:59 +00:00
Philippe Houdoin af1c1a0a03 Renamed the public api to underline the DPC *queue* mechanism handled.
Pending DPCs at queue death time are now called too, to avoid possible leaks.
Meanwhile, queue_dpc() will refuse to add another DPC and returns B_CANCELLED.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19798 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-14 21:58:19 +00:00
Axel Dörfler ce51da52b6 Added a kernel socket API module which exports the usual BSD socket API to kernel modules.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-13 13:18:54 +00:00
Philippe Houdoin a5347f68f8 Moved public interface into its own header file.
Fixed most obvious issues, as reported by Marcus and Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19765 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-10 20:28:45 +00:00
Marcus Overhagen aa88acd003 added define for SATA AHCI
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-23 02:39:58 +00:00
Jérôme Duval c20e9eefcd added a jam rule AddDriverRegistrationToHaikuImage to add device mappings on the image
commented the insertion of the attribute name in patterns in the case of a string attribute
notify_probe_by_file chooses a module based on a bus specific suffix
dm_register_child_device has a parameter to optionally check the support for the node
added scanning of bus devices after the boot filesystem is mounted
fixed dm_rescan, locking was misbehaving
fixed SYSTEM_DRIVER_REGISTRATION definition
added B_DRIVER_MAPPING attributes for PCI and ACPI devices:
  %vendor%_%device% for PCI, hid_%hid% and type_%type% for ACPI
moved acpi_device_module_info definition to public ACPI.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-29 19:09:45 +00:00
Jérôme Duval ea71f2e7b8 acpi now uses a simple pci layer instead of the pci bus manager
added a new style module to publish acpi devices ("listdev -d" to list them)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-18 20:46:58 +00:00
Jérôme Duval d39c286399 added some endpoints constants
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19142 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-29 13:31:17 +00:00
Michael Lotz 17f83b219d * Switched from the old v2 callback status codes to the new v3 codes
This means that the usb_callback_func now takes a status_t instead of a uint32 status.
Also the error codes are now different. I don't see this as a real problem in binary compatibility, as the status codes were never really documented and most drivers just assumed that a nonzero status meant an error.
Source compatibility breaks for callback functions and error defines. I fixed (hopefully) all places in the tree that are currenty included in the image and affected by the change.
* Corrected error reporting in UHCI and EHCI using the new status codes.
* Fixed a memory leak in EHCI where the async advance interrupt was not triggered in time.
* Fixed another race condition in usb_raw that could cause a crash when a device is removed while a transfer is pending.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-24 20:17:56 +00:00
Marcus Overhagen 12cf623f5c unified callback parameter definition of size_t and uint32, now uses size_t
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-16 23:35:26 +00:00
Marcus Overhagen c8443ce024 Replaced "ide_channel_cookie channel" and "ide_adapter_channel_info *" with "void *channel_cookie".
This improves abstraction and allows bus drivers that are independant of ide_adapter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-10 18:55:00 +00:00
Axel Dörfler 9b906ccf04 * You can now create the block cache in read-only mode (using an additional
parameter during construction).
* Doing so will now result in a kernel panic whenever your file system tries to
  write to a block.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 23:18:31 +00:00
Jérôme Duval 2761c5ae55 replaced with PCI.h definitions, added PCI_usb_ehci
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-30 08:36:53 +00:00