Skip to content

Commit 47e51fa

Browse files
Matthew Shyuivila
authored andcommitted
utee: Enhancement for Object APIs
* Fix fn get_next, this function can run without ObjectInfo, moving the parameter to Option<&mut ObjectInfo>. * Add PrivateRee and PrivateRpmb to ObjectStorageConstants. These two are OPTEE storage extensions.
1 parent 8b177af commit 47e51fa

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

crates/optee-utee/src/object/enum_handle.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,20 @@ impl ObjectEnumHandle {
6969

7070
/// Get the next object in an enumeration and returns information about the
7171
/// object: type, size, identifier, etc.
72-
pub fn get_next<T>(
72+
pub fn get_next(
7373
&mut self,
74-
object_info: &mut ObjectInfo,
74+
object_info: Option<&mut ObjectInfo>,
7575
object_id: &mut [u8],
7676
) -> Result<u32> {
77-
let mut object_id_len: usize = 0;
77+
let mut object_id_len = object_id.len();
78+
let object_info = match object_info {
79+
Some(a) => &mut a.raw,
80+
None => core::ptr::null_mut(),
81+
};
7882
match unsafe {
7983
raw::TEE_GetNextPersistentObject(
8084
*self.raw,
81-
&mut object_info.raw,
85+
object_info,
8286
object_id.as_mut_ptr() as _,
8387
&mut object_id_len,
8488
)

crates/optee-utee/src/object/object_define.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ impl From<Whence> for raw::TEE_Whence {
4242
#[repr(u32)]
4343
pub enum ObjectStorageConstants {
4444
Private = 0x00000001,
45+
PrivateRee = 0x80000000,
46+
PrivateRpmb = 0x80000100,
4547
IllegalValue = 0x7FFFFFFF,
4648
}
4749

0 commit comments

Comments
 (0)