Lines Matching refs:raw
20 use optee_utee_sys as raw;
26 raw: raw::TEE_Attribute, field
31 pub fn raw(&self) -> raw::TEE_Attribute { in raw() method
32 self.raw in raw()
39 Self { raw: attr.raw() } in from()
46 Self { raw: attr.raw() } in from()
53 raw: raw::TEE_Attribute, field
59 pub fn raw(&self) -> raw::TEE_Attribute { in raw() method
60 self.raw in raw()
64 let raw = raw::TEE_Attribute { in new_ref()
66 content: raw::content { in new_ref()
67 memref: raw::Memref { in new_ref()
74 raw: raw, in new_ref()
94 raw::TEE_InitRefAttribute( in from_ref()
95 &mut res.raw, in from_ref()
107 raw: raw::TEE_Attribute, field
112 pub fn raw(&self) -> raw::TEE_Attribute { in raw() method
113 self.raw in raw()
117 let raw = raw::TEE_Attribute { in new_value()
119 content: raw::content { in new_value()
120 value: raw::Value { a: 0, b: 0 }, in new_value()
123 Self { raw } in new_value()
141 raw::TEE_InitValueAttribute(&mut res.raw, id as u32, a, b); in from_value()
153 raw: raw::TEE_ObjectInfo, field
178 pub fn from_raw(raw: raw::TEE_ObjectInfo) -> Self { in from_raw()
179 Self { raw } in from_raw()
184 self.raw.dataSize as usize in data_size()
189 self.raw.objectSize as usize in object_size()
203 impl Into<raw::TEE_Whence> for Whence {
204 fn into(self) -> raw::TEE_Whence { in into()
206 Whence::DataSeekSet => raw::TEE_Whence::TEE_DATA_SEEK_SET, in into()
207 Whence::DataSeekCur => raw::TEE_Whence::TEE_DATA_SEEK_CUR, in into()
208 Whence::DataSeekEnd => raw::TEE_Whence::TEE_DATA_SEEK_END, in into()
215 raw: *mut raw::TEE_ObjectHandle, field
219 fn handle(&self) -> raw::TEE_ObjectHandle { in handle()
220 unsafe { *(self.raw) } in handle()
223 fn from_raw(raw: *mut raw::TEE_ObjectHandle) -> ObjectHandle { in from_raw()
224 Self { raw } in from_raw()
228 let mut raw_info: raw::TEE_ObjectInfo = unsafe { mem::zeroed() }; in info()
229 match unsafe { raw::TEE_GetObjectInfo1(self.handle(), &mut raw_info) } { in info()
230 raw::TEE_SUCCESS => Ok(ObjectInfo::from_raw(raw_info)), in info()
236 match unsafe { raw::TEE_RestrictObjectUsage1(self.handle(), obj_usage.bits()) } { in restrict_usage()
237 raw::TEE_SUCCESS => Ok(()), in restrict_usage()
245 raw::TEE_GetObjectBufferAttribute( in ref_attribute()
252 raw::TEE_SUCCESS => Ok(size as usize), in ref_attribute()
261 raw::TEE_GetObjectValueAttribute( in value_attribute()
268 raw::TEE_SUCCESS => Ok((value_a, value_b)), in value_attribute()
477 fn handle(&self) -> raw::TEE_ObjectHandle; in handle()
529 let raw_handle: *mut raw::TEE_ObjectHandle = Box::into_raw(Box::new(ptr::null_mut())); in allocate()
531 raw::TEE_AllocateTransientObject(object_type as u32, max_object_size as u32, raw_handle) in allocate()
533 raw::TEE_SUCCESS => { in allocate()
546 raw::TEE_ResetTransientObject(self.handle()); in reset()
587 let p: Vec<raw::TEE_Attribute> = attrs.iter().map(|p| p.raw()).collect(); in populate()
589 raw::TEE_PopulateTransientObject(self.0.handle(), p.as_ptr() as _, attrs.len() as u32) in populate()
591 raw::TEE_SUCCESS => Ok(()), in populate()
771 match unsafe { raw::TEE_CopyObjectAttributes1(self.handle(), src_object.handle()) } { in copy_attribute_from()
772 raw::TEE_SUCCESS => Ok(()), in copy_attribute_from()
812 let p: Vec<raw::TEE_Attribute> = params.iter().map(|p| p.raw()).collect(); in generate_key()
814 match raw::TEE_GenerateKey( in generate_key()
820 raw::TEE_SUCCESS => Ok(()), in generate_key()
828 fn handle(&self) -> raw::TEE_ObjectHandle { in handle()
845 if self.0.raw != ptr::null_mut() { in drop()
846 raw::TEE_FreeTransientObject(self.0.handle()); in drop()
848 Box::from_raw(self.0.raw); in drop()
906 let raw_handle: *mut raw::TEE_ObjectHandle = Box::into_raw(Box::new(ptr::null_mut())); in open()
908 raw::TEE_OpenPersistentObject( in open()
916 raw::TEE_SUCCESS => { in open()
987 let raw_handle: *mut raw::TEE_ObjectHandle = Box::into_raw(Box::new(ptr::null_mut())); in create()
993 raw::TEE_CreatePersistentObject( in create()
1004 raw::TEE_SUCCESS => { in create()
1050 match unsafe { raw::TEE_CloseAndDeletePersistentObject1(self.0.handle()) } { in close_and_delete()
1051 raw::TEE_SUCCESS => { in close_and_delete()
1053 Box::from_raw(self.0.raw); in close_and_delete()
1099 raw::TEE_RenamePersistentObject( in rename()
1105 raw::TEE_SUCCESS => Ok(()), in rename()
1195 raw::TEE_ReadObjectData( in read()
1202 raw::TEE_SUCCESS => Ok(count), in read()
1248 raw::TEE_WriteObjectData(self.handle(), buf.as_ptr() as _, buf.len() as u32) in write()
1250 raw::TEE_SUCCESS => Ok(()), in write()
1289 match unsafe { raw::TEE_TruncateObjectData(self.handle(), size) } { in truncate()
1290 raw::TEE_SUCCESS => Ok(()), in truncate()
1332 match unsafe { raw::TEE_SeekObjectData(self.handle(), offset, whence.into()) } { in seek()
1333 raw::TEE_SUCCESS => Ok(()), in seek()
1340 fn handle(&self) -> raw::TEE_ObjectHandle { in handle()
1355 if self.0.raw != Box::into_raw(Box::new(ptr::null_mut())) { in drop()
1356 raw::TEE_CloseObject(self.0.handle()); in drop()
1358 Box::from_raw(self.0.raw); in drop()
1367 raw: *mut raw::TEE_ObjectEnumHandle, field
1374 let raw_handle: *mut raw::TEE_ObjectEnumHandle = Box::into_raw(Box::new(ptr::null_mut())); in allocate()
1375 match unsafe { raw::TEE_AllocatePersistentObjectEnumerator(raw_handle) } { in allocate()
1376 raw::TEE_SUCCESS => Ok(Self { raw: raw_handle }), in allocate()
1390 raw::TEE_ResetPersistentObjectEnumerator(*self.raw); in reset()
1398 match unsafe { raw::TEE_StartPersistentObjectEnumerator(*self.raw, storage_id) } { in start()
1399 raw::TEE_SUCCESS => Ok(()), in start()
1412 raw::TEE_GetNextPersistentObject( in get_next()
1413 *self.raw, in get_next()
1414 &mut object_info.raw, in get_next()
1419 raw::TEE_SUCCESS => Ok(object_id_len), in get_next()
1434 raw::TEE_FreePersistentObjectEnumerator(*self.raw); in drop()
1435 Box::from_raw(self.raw); in drop()