[Denali] Reset HBA and iterate over ports.
This commit is contained in:
parent
7d4c882f2b
commit
df79233bbb
6 changed files with 289 additions and 162 deletions
|
|
@ -13,6 +13,10 @@ impl PortServer {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn from_cap(port_cap: Capability) -> Self {
|
||||
Self { port_cap }
|
||||
}
|
||||
|
||||
pub fn create_client_cap(&self) -> Result<z_cap_t, ZError> {
|
||||
self.port_cap
|
||||
.duplicate(!kZionPerm_Read)
|
||||
|
|
|
|||
|
|
@ -295,6 +295,18 @@ pub fn port_poll(
|
|||
Ok((num_bytes, num_caps))
|
||||
}
|
||||
|
||||
pub fn register_irq(irq_num: u64) -> Result<Capability, ZError> {
|
||||
let mut port_cap: z_cap_t = 0;
|
||||
syscall(
|
||||
zion::kZionIrqRegister,
|
||||
&zion::ZIrqRegisterReq {
|
||||
irq_num,
|
||||
port_cap: &mut port_cap,
|
||||
},
|
||||
)?;
|
||||
Ok(Capability::take(port_cap))
|
||||
}
|
||||
|
||||
pub fn endpoint_create() -> Result<Capability, ZError> {
|
||||
let mut endpoint_cap: z_cap_t = 0;
|
||||
syscall(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue