Move denali client to separate lib.
This commit is contained in:
parent
c8f84ec352
commit
59efb1659a
10 changed files with 56 additions and 18 deletions
|
|
@ -6,17 +6,11 @@ edition = "2021"
|
|||
[dependencies]
|
||||
bitfield-struct = "0.8.0"
|
||||
mammoth = { path = "../../lib/mammoth" }
|
||||
yunq = {path = "../../lib/yunq"}
|
||||
|
||||
yellowstone-yunq = { path = "../../lib/yellowstone", optional = true }
|
||||
yunq = { path = "../../lib/yunq" }
|
||||
yellowstone-yunq = { path = "../../lib/yellowstone" }
|
||||
|
||||
[[bin]]
|
||||
name = "denali"
|
||||
required-features = ["binary"]
|
||||
|
||||
[build-dependencies]
|
||||
yunqc = {path = "../../../yunq/rust"}
|
||||
|
||||
[features]
|
||||
default = ["binary"]
|
||||
binary = ["dep:yellowstone-yunq"]
|
||||
yunqc = { path = "../../../yunq/rust" }
|
||||
|
|
|
|||
|
|
@ -7,5 +7,9 @@ define_entry!();
|
|||
|
||||
#[no_mangle]
|
||||
extern "C" fn main() -> z_err_t {
|
||||
let yellowstone = yellowstone_yunq::from_init_endpoint();
|
||||
|
||||
let denali = yellowstone.get_denali().unwrap();
|
||||
|
||||
0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
mammoth = { path = "../../lib/mammoth" }
|
||||
denali = { path = "../denali", default-features = false }
|
||||
denali_client = { path = "../../lib/client/denali_client" }
|
||||
victoriafalls = { path = "../victoriafalls" }
|
||||
voyageurs = { path = "../../lib/voyageurs" }
|
||||
yellowstone-yunq = { path = "../../lib/yellowstone" }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use denali::DenaliClient;
|
||||
use denali_client::DenaliClient;
|
||||
use mammoth::{cap::Capability, zion::ZError};
|
||||
|
||||
const MBR_SIG: u16 = 0xAA55;
|
||||
|
|
@ -47,9 +47,9 @@ struct PartitionEntry {
|
|||
}
|
||||
|
||||
pub fn read_gpt(mut denali: DenaliClient) -> Result<u64, ZError> {
|
||||
let resp = denali.read(&denali::ReadRequest {
|
||||
let resp = denali.read(&denali_client::ReadRequest {
|
||||
device_id: 0,
|
||||
block: denali::DiskBlock { lba: 0, size: 2 },
|
||||
block: denali_client::DiskBlock { lba: 0, size: 2 },
|
||||
})?;
|
||||
|
||||
let first_lbas = mammoth::mem::MemoryRegion::from_cap(Capability::take(resp.memory))?;
|
||||
|
|
@ -99,9 +99,9 @@ pub fn read_gpt(mut denali: DenaliClient) -> Result<u64, ZError> {
|
|||
num_blocks
|
||||
);
|
||||
|
||||
let resp = denali.read(&denali::ReadRequest {
|
||||
let resp = denali.read(&denali_client::ReadRequest {
|
||||
device_id: 0,
|
||||
block: denali::DiskBlock {
|
||||
block: denali_client::DiskBlock {
|
||||
lba: lba_partition_entries,
|
||||
size: num_blocks,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ impl YellowstoneServerHandler for YellowstoneServerImpl {
|
|||
|
||||
fn get_denali(&mut self) -> Result<DenaliInfo, ZError> {
|
||||
match self.context.service_map.lock().get("denali") {
|
||||
Some(ep_cap) => crate::gpt::read_gpt(denali::DenaliClient::new(
|
||||
Some(ep_cap) => crate::gpt::read_gpt(denali_client::DenaliClient::new(
|
||||
ep_cap.duplicate(Capability::PERMS_ALL).unwrap(),
|
||||
))
|
||||
.map(|lba| DenaliInfo {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue