[−][src]Struct sunrise_ahci::disk::Disk
An AHCI Disk
Manages an AHCI port, and provides functions to read and write sectors.
Memory
A disk is responsible for all allocated memory in use by the port. When dropped, the port is put to a stop, pointers to these regions are cleared from the hardware, and the regions are eventually de-allocated.
Lifetime
A Disk holds a reference to its Port Control Registers
,
which is located in the root HBA Memory Registers
mapping (the one found at BAR5
).
As this root mapping will never be unmapped, the lifetime of this reference is 'static
.
Fields
px: &'static mut Px
Pointer back to the corresponding Port Control Registers, found at BAR5[100h]
-BAR5[10FFh]
.
rfis: ZeroBox<ReceivedFis>
The allocated Received FIS memory zone that the port uses.
cmd_list: ZeroBox<CmdHeaderArray>
The allocated Command List memory zone that the port uses.
cmd_tables: [Option<ZeroBox<CmdTable>>; 32]
An allocated Command Table for each implemented Command List slot.
sectors: u64
Number of addressable sectors of this disk. Each sector is 512 octets.
supports_48_bit: bool
Indicates if the device supports 48 bit addresses.
Implementations
impl Disk
[src]
fn sector_count(&self) -> Result<u64, Error>
[src]
Returns the number of addressable 512-octet sectors for this disk.
fn read_dma(
&mut self,
buffer: *mut u8,
buffer_len: usize,
lba: u64,
sector_count: u64
) -> Result<(), Error>
[src]
&mut self,
buffer: *mut u8,
buffer_len: usize,
lba: u64,
sector_count: u64
) -> Result<(), Error>
Reads sectors from disk.
Reads sector_count
sectors starting from lba
.
fn write_dma(
&mut self,
buffer: *const u8,
buffer_len: usize,
lba: u64,
sector_count: u64
) -> Result<(), Error>
[src]
&mut self,
buffer: *const u8,
buffer_len: usize,
lba: u64,
sector_count: u64
) -> Result<(), Error>
Writes sectors to disk.
Writes sector_count
sectors starting from lba
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl !UnwindSafe for Disk
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SizedIPCBuffer for T
[src]
fn size(&self) -> usize
[src]
fn is_cool(addr: usize, size: usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(addr: usize, _size: usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(addr: usize, _size: usize) -> &'a mut T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,