Skip to content

Commit

Permalink
refactor(cndrv): Blob 移动到 memory,缩小范围
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <ydrml@hotmail.com>
  • Loading branch information
YdrMaster committed Jul 26, 2024
1 parent fc35abc commit 8278816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions cndrv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ pub use notifier::{Notifier, NotifierSpore};
pub use queue::{Queue, QueueSpore};
pub use version::{driver_version, library_version, Version};

struct Blob<P> {
ptr: P,
len: usize,
}


#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(transparent)]
Expand Down
7 changes: 6 additions & 1 deletion cndrv/src/memory.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{bindings::CNaddr, Blob, CurrentCtx, Queue};
use crate::{bindings::CNaddr, CurrentCtx, Queue};
use context_spore::{impl_spore, AsRaw};
use std::{
alloc::Layout,
Expand Down Expand Up @@ -63,6 +63,11 @@ impl Queue<'_> {
}
}

struct Blob<P> {
ptr: P,
len: usize,
}

impl_spore!(DevMem and DevMemSpore by (CurrentCtx, Blob<CNaddr>));

impl CurrentCtx {
Expand Down

0 comments on commit 8278816

Please sign in to comment.