Home
last modified time | relevance | path

Searched refs:FdtError (Results 1 – 14 of 14) sorted by relevance

/packages/modules/Virtualization/libs/libfdt/src/
Dresult.rs23 pub enum FdtError { enum
66 impl fmt::Display for FdtError { implementation
95 pub type Result<T> = result::Result<T, FdtError>;
107 type Error = FdtError;
119 x if x == -(FDT_ERR_NOTFOUND as c_int) => Err(FdtError::NotFound), in try_from()
120 x if x == -(FDT_ERR_EXISTS as c_int) => Err(FdtError::Exists), in try_from()
121 x if x == -(FDT_ERR_NOSPACE as c_int) => Err(FdtError::NoSpace), in try_from()
122 x if x == -(FDT_ERR_BADOFFSET as c_int) => Err(FdtError::BadOffset), in try_from()
123 x if x == -(FDT_ERR_BADPATH as c_int) => Err(FdtError::BadPath), in try_from()
124 x if x == -(FDT_ERR_BADPHANDLE as c_int) => Err(FdtError::BadPhandle), in try_from()
[all …]
Dsafe_types.rs20 use crate::{FdtError, Result};
111 type Error = FdtError;
114 Self::new(value).ok_or(FdtError::BadPhandle) in try_from()
119 type Error = FdtError;
122 Self::new(res.try_into()?).ok_or(FdtError::BadPhandle) in try_from()
139 type Error = FdtError;
147 type Error = FdtError;
152 Err(FdtError::NotFound) => Ok(None), in try_from()
172 type Error = FdtError;
180 type Error = FdtError;
[all …]
Dlib.rs29 pub use result::{FdtError, Result};
49 type Error = FdtError;
56 _ => Err(FdtError::BadNCells), in try_from()
70 type Error = FdtError;
77 _ => Err(FdtError::BadNCells), in try_from()
208 CStr::from_bytes_with_nul(name).map_err(|_| FdtError::Internal) in name()
214 Ok(Some(CStr::from_bytes_with_nul(bytes).map_err(|_| FdtError::BadValue)?)) in getprop_str()
232 Ok(Some(u32::from_be_bytes(bytes.try_into().map_err(|_| FdtError::BadValue)?))) in getprop_u32()
241 Ok(Some(u64::from_be_bytes(bytes.try_into().map_err(|_| FdtError::BadValue)?))) in getprop_u64()
266 self.reg()?.ok_or(FdtError::NotFound)?.next().ok_or(FdtError::NotFound) in first_reg()
[all …]
Dlibfdt.rs26 use crate::{FdtError, NodeOffset, Phandle, PropOffset, Result, StringOffset};
74 let len = path.len().try_into().map_err(|_| FdtError::BadPath)?; in path_offset_namelen()
218 get_slice_at_ptr(self.as_fdt_slice(), name.cast(), len).ok_or(FdtError::Internal) in get_name()
225 let namelen = name.len().try_into().map_err(|_| FdtError::BadPath)?; in getprop_namelen()
236 Ok(Some(bytes.ok_or(FdtError::Internal)?)) in getprop_namelen()
253 let len = data_offset.checked_add(data_len).ok_or(FdtError::Internal)?; in get_property_by_offset()
256 return Err(FdtError::Internal); in get_property_by_offset()
263 return Err(FdtError::BadLayout); in get_property_by_offset()
308 get_slice_from_ptr(self.as_fdt_slice(), ptr.cast()).ok_or(FdtError::Internal)?; in string()
310 CStr::from_bytes_until_nul(bytes).map_err(|_| FdtError::Internal) in string()
[all …]
Diterators.rs18 use crate::FdtError;
35 pub(crate) fn new(fdt: &'a Fdt, compatible: &'a CStr) -> Result<Self, FdtError> { in new() argument
97 type Error = FdtError;
101 let size = to_usize(reg.size.ok_or(FdtError::NotFound)?)?; in try_from()
102 let end = addr.checked_add(size).ok_or(FdtError::BadValue)?; in try_from()
107 fn to_usize<T: TryInto<usize>>(num: T) -> Result<usize, FdtError> { in to_usize() argument
108 num.try_into().map_err(|_| FdtError::BadValue) in to_usize()
295 pub(crate) fn new(node: &FdtNode<'a>) -> Result<Self, FdtError> { in new() argument
344 pub(crate) fn new(node: &'a FdtNode) -> Result<Self, FdtError> { in new() argument
/packages/modules/Virtualization/pvmfw/src/
Dfdt.rs38 use libfdt::FdtError;
118 let mut node = fdt.chosen_mut()?.ok_or(FdtError::NotFound)?; in patch_initrd_range()
129 let copy = CString::new(bootargs.to_bytes()).map_err(|_| FdtError::BadValue)?; in read_bootargs_from()
137 let mut node = fdt.chosen_mut()?.ok_or(FdtError::NotFound)?; in patch_bootargs()
185 .ok_or(FdtError::NotFound)? in patch_memory_range()
205 let prop = subnode.getprop_u64(cstr!("opp-hz"))?.ok_or(FdtError::NotFound)?;
252 let cpu = core.getprop_u32(cstr!("cpu"))?.ok_or(FdtError::NotFound)?; in read_cpu_map_from()
255 return Err(FdtError::BadValue); in read_cpu_map_from()
277 let node = fdt.node_with_phandle(phandle)?.ok_or(FdtError::NotFound)?;
286 let phandle = cpu.get_phandle()?.ok_or(FdtError::NotFound)?;
[all …]
Ddevice_assignment.rs31 use libfdt::{Fdt, FdtError, FdtNode, FdtNodeMut, Phandle, Reg};
96 UnexpectedFdtError(FdtError),
99 impl From<FdtError> for DeviceAssignmentError {
100 fn from(e: FdtError) -> Self { in from()
351 return Err(FdtError::BadPhandle.into()); in parse_physical_iommus()
922 return Err(FdtError::BadPhandle.into()); in parse_pviommus()
1191 return Err(FdtError::NotFound.into()); in parse()
/packages/modules/Virtualization/vmbase/src/
Dfdt.rs19 use libfdt::{self, Fdt, FdtError};
36 fdt.compatible_nodes(cstr!("restricted-dma-pool"))?.next().ok_or(FdtError::NotFound)?; in new_from_fdt()
39 let reg = reg.next().ok_or(FdtError::NotFound)?; in new_from_fdt()
40 let size = reg.size.ok_or(FdtError::NotFound)?; in new_from_fdt()
43 let size = node.getprop_u64(cstr!("size"))?.ok_or(FdtError::NotFound)?; in new_from_fdt()
44 let align = node.getprop_u64(cstr!("alignment"))?.ok_or(FdtError::NotFound)?; in new_from_fdt()
/packages/modules/Virtualization/rialto/src/
Dfdt.rs19 use libfdt::{Fdt, FdtError};
23 let node = fdt.node(cstr!("/reserved-memory"))?.ok_or(FdtError::NotFound)?; in read_dice_range_from()
24 let node = node.next_compatible(cstr!("google,open-dice"))?.ok_or(FdtError::NotFound)?; in read_dice_range_from()
29 let node = fdt.node(cstr!("/avf"))?.ok_or(FdtError::NotFound)?; in read_vendor_hashtree_root_digest()
Derror.rs21 use libfdt::FdtError;
37 InvalidFdt(FdtError),
98 impl From<FdtError> for Error {
99 fn from(e: FdtError) -> Self { in from()
Dmain.rs37 use libfdt::FdtError;
126 Error::from(FdtError::BadValue) in try_main()
/packages/modules/Virtualization/libs/fdtpci/src/
Dlib.rs24 use libfdt::{AddressRange, Fdt, FdtError, FdtNode};
35 FdtErrorPci(FdtError),
39 FdtErrorReg(FdtError),
49 FdtErrorRanges(FdtError),
/packages/modules/Virtualization/libs/libfdt/tests/
Dapi_test.rs21 use libfdt::{Fdt, FdtError, FdtNodeMut, Phandle};
67 assert_eq!(fdt.first_memory_range(), Err(FdtError::NotFound)); in retrieving_first_memory_from_fdt_with_empty_memory_range_fails()
75 assert_eq!(fdt.memory().unwrap_err(), FdtError::NotFound); in retrieving_memory_from_fdt_with_no_memory_node_fails()
76 assert_eq!(fdt.first_memory_range(), Err(FdtError::NotFound)); in retrieving_memory_from_fdt_with_no_memory_node_fails()
113 type Result<T> = core::result::Result<T, FdtError>; in node_properties()
169 assert_eq!(Phandle::try_from(value), Err(FdtError::BadPhandle)); in phandle_new()
/packages/modules/Virtualization/virtualizationmanager/src/
Ddebug_config.rs22 use libfdt::{Fdt, FdtError};
88 Err(error) if error != FdtError::NotFound => { in get_fdt_prop_bool()
98 Err(error) if error != FdtError::NotFound => { in get_fdt_prop_bool()