⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

CommandHeader

Struct CommandHeader 

Source
#[repr(C)]
pub struct CommandHeader { pub flags_and_prdtl: u32, pub prdbc: u32, pub ctba_lo: u32, pub ctba_hi: u32, pub _reserved: [u32; 4], }
Expand description

Command Header (32 bytes, one per command slot).

The command list is an array of up to 32 command headers.

Fields§

§flags_and_prdtl: u32

DW0: Command FIS Length (bits 4:0, in DWORDs), ATAPI (bit 5), Write direction (bit 6), Prefetchable (bit 7), Reset (bit 8), BIST (bit 9), Clear Busy upon R_OK (bit 10), Reserved (bit 11), Port Multiplier Port (bits 15:12), PRDT Length (bits 31:16).

§prdbc: u32

DW1: Physical Region Descriptor Byte Count (transferred so far).

§ctba_lo: u32

DW2: Command Table Descriptor Base Address (lower 32 bits, 128-byte aligned).

§ctba_hi: u32

DW3: Command Table Descriptor Base Address (upper 32 bits).

§_reserved: [u32; 4]

DW4-7: Reserved.

Implementations§

Source§

impl CommandHeader

Source

pub fn new( fis_len_dwords: u8, prdt_count: u16, write: bool, ctba_phys: u64, ) -> Self

Create a new command header.

fis_len_dwords: Length of the command FIS in DWORDs (typically 5 for H2D FIS). prdt_count: Number of PRDT entries. write: True if this is a write (host-to-device data) command. ctba_phys: Physical address of the command table (128-byte aligned).

Trait Implementations§

Source§

impl Clone for CommandHeader

Source§

fn clone(&self) -> CommandHeader

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for CommandHeader

Auto Trait Implementations§

§

impl Freeze for CommandHeader

§

impl RefUnwindSafe for CommandHeader

§

impl Send for CommandHeader

§

impl Sync for CommandHeader

§

impl Unpin for CommandHeader

§

impl UnwindSafe for CommandHeader

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.