Home
last modified time | relevance | path

Searched refs:u8 (Results 1 – 25 of 44) sorted by relevance

12

/bootable/libbootloader/gbl/libabr/src/
Dlib.rs19 const ABR_MAGIC: &[u8; 4] = b"\0AB0";
20 const ABR_MAJOR_VERSION: u8 = 2;
21 const ABR_MINOR_VERSION: u8 = 2;
27 pub const ONE_SHOT_RECOVERY: u8 = 1 << 0;
29 pub const ONE_SHOT_BOOTLOADER: u8 = 1 << 1;
31 const ABR_MAX_PRIORITY: u8 = 15;
32 const ABR_MAX_TRIES_REMAINING: u8 = 7;
54 fn read_abr_metadata(&mut self, out: &mut [u8]) -> Result<(), Option<&'static str>>; in read_abr_metadata()
58 fn write_abr_metadata(&mut self, data: &mut [u8]) -> Result<(), Option<&'static str>>; in write_abr_metadata()
121 Bootable(u8), // u8 = tries remaining
[all …]
Dc_staticlib.rs49 fn abr_print_ascii_char(ch: u8) { in abr_print_ascii_char() argument
93 Option<unsafe extern "C" fn(context: *mut c_void, size: usize, buffer: *mut u8) -> bool>,
95 Option<unsafe extern "C" fn(context: *mut c_void, buffer: *const u8, size: usize) -> bool>,
120 fn read_abr_metadata(&mut self, out: &mut [u8]) -> Result<(), Option<&'static str>> { in read_abr_metadata()
134 fn write_abr_metadata(&mut self, data: &mut [u8]) -> Result<(), Option<&'static str>> { in write_abr_metadata()
195 const SLOT_A_SUFFIX: &[u8] = b"_a\0";
196 const SLOT_B_SUFFIX: &[u8] = b"_b\0";
197 const SLOT_R_SUFFIX: &[u8] = b"_r\0";
198 const SLOT_SUFFIX_INVALID: &[u8] = b"\0";
315 pub num_tries_remaining: u8,
/bootable/libbootloader/gbl/libfastboot/src/
Dlib.rs102 fn receive_packet(&mut self, out: &mut [u8]) -> Result<usize, TransportError>; in receive_packet()
108 fn send_packet(&mut self, packet: &[u8]) -> Result<(), TransportError>; in send_packet()
113 const TCP_HANDSHAKE_MESSAGE: &[u8] = b"FB01";
121 fn read_exact(&mut self, out: &mut [u8]) -> Result<(), TransportError>; in read_exact()
124 fn write_exact(&mut self, data: &[u8]) -> Result<(), TransportError>; in write_exact()
144 fn receive_packet(&mut self, out: &mut [u8]) -> Result<usize, TransportError> { in receive_packet()
159 fn send_packet(&mut self, packet: &[u8]) -> Result<(), TransportError> { in send_packet()
177 pub struct CommandError(FormattedBytes<[u8; COMMAND_ERROR_LENGTH]>);
221 out: &mut [u8], in get_var() argument
230 out: &'s mut [u8], in get_var_as_str() argument
[all …]
/bootable/libbootloader/gbl/efi/src/
Davb.rs29 preloaded_partitions: Option<&'b [(&'b str, &'b [u8])]>,
35 preloaded_partitions: Option<&'b [(&'b str, &'b [u8])]>, in new() argument
51 buffer: &mut [u8], in read_from_partition() argument
71 fn get_preloaded_partition(&mut self, partition: &CStr) -> IoResult<&'b [u8]> { in get_preloaded_partition() argument
84 _public_key: &[u8], in validate_vbmeta_public_key() argument
85 _public_key_metadata: Option<&[u8]>, in validate_vbmeta_public_key() argument
133 fn read_persistent_value(&mut self, _name: &CStr, _value: &mut [u8]) -> IoResult<usize> { in read_persistent_value()
138 fn write_persistent_value(&mut self, _name: &CStr, _value: &[u8]) -> IoResult<()> { in write_persistent_value()
151 _public_key: &[u8], in validate_public_key_for_partition() argument
152 _public_key_metadata: Option<&[u8]>, in validate_public_key_for_partition() argument
Dfuchsia_boot.rs40 pub fn relocate_kernel(kernel: &[u8], dest: &mut [u8]) -> Result<usize> { in relocate_kernel() argument
67 fn zbi_container_size(zbi: &[u8]) -> Result<usize> { in zbi_container_size()
75 fn zbi_get_unused_buffer(zbi: &mut [u8]) -> Result<(&mut [u8], &mut [u8])> { in zbi_get_unused_buffer() argument
83 fn relocate_to_tail(kernel: &mut [u8]) -> Result<(&mut [u8], &mut [u8], usize)> { in relocate_to_tail() argument
93 fn load_fuchsia_simple<'a>(efi_entry: &EfiEntry, load: &'a mut [u8]) -> Result<&'a mut [u8]> { in load_fuchsia_simple() argument
Dutils.rs58 pub fn aligned_subslice(bytes: &mut [u8], alignment: usize) -> Result<&mut [u8]> { in aligned_subslice() argument
78 out: &mut [u8], in read_blocks() argument
88 data: &mut [u8], in write_blocks() argument
99 scratch: Vec<u8>,
114 fn with(&mut self, f: &mut dyn FnMut(&mut dyn BlockIo, &mut [u8], u64)) { in with() argument
174 pub fn get_efi_fdt<'a>(entry: &'a EfiEntry) -> Option<(&FdtHeader, &[u8])> { in get_efi_fdt() argument
209 pub fn cstr_bytes_to_str(data: &[u8]) -> Result<&str> { in cstr_bytes_to_str()
/bootable/libbootloader/gbl/libstorage/src/
Dtestlib.rs68 Pending(u64, u64, &'static mut [u8], bool),
79 pub storage: Vec<u8>,
89 pub fn new(block_size: u64, alignment: u64, data: Vec<u8>) -> Self { in new()
93 fn check_alignment(&mut self, buffer: &[u8]) -> bool { in check_alignment()
104 fn read_blocks(&mut self, blk_offset: u64, out: &mut [u8]) -> Result<(), BlockIoError> { in read_blocks()
109 fn write_blocks(&mut self, blk_offset: u64, data: &mut [u8]) -> Result<(), BlockIoError> { in write_blocks()
135 buffer: *mut [u8], in write_blocks() argument
155 buffer: *mut [u8], in read_blocks() argument
172 fn check_status(&mut self, buf: *mut [u8]) -> IoStatus { in check_status()
175 if std::ptr::eq(*buffer as *const [u8], buf as _) => in check_status()
[all …]
Dnon_blocking.rs75 buffer: *mut [u8], in write_blocks() argument
101 buffer: *mut [u8], in read_blocks() argument
121 fn check_status(&mut self, buf: *mut [u8]) -> IoStatus; in check_status()
140 out: &mut [u8], in read_blocks() argument
142 let ptr = out as *mut [u8]; in read_blocks()
160 data: &mut [u8], in write_blocks() argument
162 let ptr = data as *mut [u8]; in write_blocks()
220 Ready(&'a mut [u8], IoStatus),
222 Pending(*mut [u8], *mut [u8], PhantomData<&'a mut [u8]>),
243 fn new(buffer: &'a mut [u8]) -> Self { in new()
[all …]
Dlib.rs230 out: &mut [u8], in read_blocks() argument
248 data: &mut [u8], in write_blocks() argument
343 fn with(&mut self, f: &mut dyn FnMut(&mut dyn BlockIo, &mut [u8], u64)); in with() argument
369 fn read(&mut self, offset: u64, out: &mut [u8]) -> Result<()> { in read()
386 fn write(&mut self, offset: u64, data: &mut [u8]) -> Result<()> { in write()
444 fn read_gpt_partition(&mut self, part_name: &str, offset: u64, out: &mut [u8]) -> Result<()> { in read_gpt_partition()
467 fn write_gpt_partition(&mut self, part_name: &str, offset: u64, data: &mut [u8]) -> Result<()> { in write_gpt_partition()
476 fn with(&mut self, f: &mut dyn FnMut(&mut dyn BlockIo, &mut [u8], u64)) { in with() argument
484 scratch: &'b mut [u8],
489 pub fn new(io: &'a mut dyn BlockIo, scratch: &'b mut [u8], max_gpt_entries: u64) -> Self { in new() argument
[all …]
Dgpt.rs38 pub guid: [u8; GPT_GUID_LEN],
47 fn from_bytes(bytes: &mut [u8]) -> &mut GptHeader { in from_bytes()
62 pub part_type: [u8; GPT_GUID_LEN],
63 pub guid: [u8; GPT_GUID_LEN],
84 pub fn name_to_str<'a>(&self, buffer: &'a mut [u8]) -> Result<&'a str> { in name_to_str()
143 fn from_bytes(bytes: &mut [u8]) -> &mut Self { in from_bytes()
156 primary_header: &'a mut [u8],
158 primary_entries: &'a mut [u8],
160 secondary_header: &'a mut [u8],
162 secondary_entries: &'a mut [u8],
[all …]
/bootable/libbootloader/gbl/libboot/src/
Daarch64.rs55 fn flush_dcache_buffer(buf: &[u8]) { in flush_dcache_buffer() argument
96 pub unsafe fn jump_linux_el2_or_lower(kernel: &[u8], ramdisk: &[u8], fdt: &[u8]) -> ! { in jump_linux_el2_or_lower() argument
118 pub unsafe fn jump_zircon_el2_or_lower(zbi_kernel: &[u8], entry_off: usize, zbi_item: &[u8]) -> ! { in jump_zircon_el2_or_lower() argument
Dx86.rs62 const LOAD_FLAG_LOADED_HIGH: u8 = 0x1;
79 pub fn from_bytes_ref(buffer: &[u8]) -> Result<&BootParams> { in from_bytes_ref()
87 pub fn from_bytes_mut(buffer: &mut [u8]) -> Result<&mut BootParams> { in from_bytes_mut()
171 kernel: &[u8], in boot_linux_bzimage() argument
172 ramdisk: &[u8], in boot_linux_bzimage() argument
173 cmdline: &[u8], in boot_linux_bzimage() argument
178 F: FnOnce(&mut [e820entry]) -> Result<u8>, in boot_linux_bzimage() argument
204 from_raw_parts_mut(LOAD_ADDR_HIGH as *mut u8, kernel[boot_sector_size..].len()) in boot_linux_bzimage()
Driscv64.rs22 pub unsafe fn jump_linux(kernel: &[u8], boot_hart_id: usize, fdt: &[u8]) -> ! { in jump_linux() argument
/bootable/libbootloader/gbl/libgbl/src/
Dops.rs36 pub kernel: &'a mut [u8],
37 pub ramdisk: &'a mut [u8],
38 pub fdt: &'a mut [u8],
43 pub zbi_kernel: &'a mut [u8],
44 pub zbi_items: &'a mut [u8],
82 fn console_put_char(&mut self, ch: u8) -> Result<(), GblOpsError>; in console_put_char()
145 scratch: &'b mut [u8],
159 pub fn new(ops: &'a mut T, scratch: &'b mut [u8]) -> GblResult<(Self, &'b mut [u8])> { in new() argument
206 fn console_put_char(&mut self, ch: u8) -> Result<(), GblOpsError> { in console_put_char()
Dlib.rs87 pub address: Option<&'c mut [u8]>,
94 pub struct BootImage<'a>(&'a mut [u8]);
97 pub struct VendorBootImage<'a>(&'a mut [u8]);
100 pub struct InitBootImage<'a>(&'a mut [u8]);
103 pub struct KernelImage<'a>(&'a mut [u8]);
106 pub struct Ramdisk<'a>(&'a mut [u8]);
108 pub struct Bootconfig<'a>(&'a mut [u8]);
110 pub struct Dtb<'a>(&'a mut [u8]);
300 load_buffer: &'b mut [u8], in kernel_load() argument
410 kernel_load_buffer: &mut [u8], in load_verify_boot() argument
[all …]
Doverlap.rs33 pub fn is_overlap(buffers: &[&[u8]]) -> bool { in is_overlap()
42 .map(|slice: &&[u8]| (slice.as_ptr(), slice.last_chunk::<1>().unwrap().as_ptr())) in is_overlap()
54 fn get_range(first: usize, last: usize) -> &'static [u8] { in get_range() argument
58 static BUFFER: &'static [u8; SIZE] = &[0; SIZE]; in get_range()
65 let ranges_slices: Vec<&[u8]> = in check_overlap()
74 let ranges_slices: Vec<&[u8]> = in check_not_overlap()
Dslots.rs38 impl From<u8> for Tries {
39 fn from(u: u8) -> Self { in from()
55 impl From<u8> for Priority {
56 fn from(u: u8) -> Self { in from()
101 pub type SuffixBytes = [u8; SUFFIX_CSTR_MAX_BYTES];
136 impl From<u8> for UnbootableReason {
137 fn from(val: u8) -> Self { in from()
148 impl From<UnbootableReason> for u8 { implementation
/bootable/libbootloader/gbl/libefi/src/
Dallocation.rs85 fn allocate(&self, size: usize) -> *mut u8 { in allocate() argument
100 fn deallocate(&self, ptr: *mut u8) { in deallocate() argument
113 unsafe fn alloc(&self, layout: Layout) -> *mut u8 { in alloc() argument
124 unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) { in dealloc() argument
130 pub fn efi_malloc(size: usize) -> *mut u8 { in efi_malloc() argument
137 pub fn efi_free(ptr: *mut u8) { in efi_free() argument
/bootable/libbootloader/gbl/libfdt/src/
Dlib.rs55 fn fdt_check_header(fdt: &[u8]) -> Result<()> { in fdt_check_header()
65 fdt: &mut [u8], in fdt_add_subnode() argument
82 fdt: &[u8], in fdt_subnode_offset() argument
120 pub fn from_bytes_ref(buffer: &[u8]) -> Result<&FdtHeader> { in from_bytes_ref()
128 pub fn from_bytes_mut(buffer: &mut [u8]) -> Result<&mut FdtHeader> { in from_bytes_mut()
140 pub unsafe fn from_raw(ptr: *const u8) -> Result<(&'static FdtHeader, &'static [u8])> { in from_raw() argument
156 impl<T: AsRef<[u8]>> Fdt<T> {
172 pub fn get_property<'a>(&'a self, path: &str, name: &CStr) -> Result<&'a [u8]> { in get_property() argument
189 v.data.as_ptr() as *const u8, in get_property() constant
211 impl<T: AsMut<[u8]> + AsRef<[u8]>> Fdt<T> {
[all …]
/bootable/libbootloader/gbl/libgbl/src/slots/
Dandroid.rs31 const MAX_SLOTS: u8 = 4;
62 const DEFAULT_PRIORITY: u8 = 7;
63 const DEFAULT_RETRIES: u8 = 7;
86 fn priority(&self) -> u8 { in priority() argument
89 fn set_priority(&mut self, priority: u8) { in set_priority() argument
93 fn tries(&self) -> u8 { in tries() argument
96 fn set_tries(&mut self, tries: u8) { in set_tries() argument
101 get_field::<_, u8>(self.0, Self::SUCCESSFUL_OFFSET, Self::SUCCESSFUL_MASK) != 0 in successful()
108 get_field::<_, u8>(self.0, Self::VERITY_CORRUPTED_OFFSET, Self::VERITY_CORRUPTED_MASK) != 0 in verity_corrupted()
148 fn nb_slots(&self) -> u8 { in nb_slots() argument
[all …]
Dfuchsia.rs31 const DEFAULT_PRIORITY: u8 = 15;
32 const DEFAULT_RETRIES: u8 = 7;
37 priority: u8,
38 tries: u8,
39 successful: u8,
40 unbootable_reason: u8,
56 struct OneShotFlags(u8);
59 impl OneShotFlags: u8 {
93 const ABR_MAGIC: &[u8; 4] = b"\0AB0";
94 const ABR_VERSION_MAJOR: u8 = 2;
[all …]
/bootable/libbootloader/gbl/libmisc/src/
Dlib.rs64 command: [u8; 32],
65 status: [u8; 32],
66 recovery: [u8; 768],
67 stage: [u8; 32],
68 reserved: [u8; 1184],
76 pub fn from_bytes_ref(buffer: &[u8]) -> Result<&BootloaderMessage> { in from_bytes_ref()
/bootable/libbootloader/gbl/libavb/src/
Dlib.rs61 let mut ptr = ptr as *mut u8; in avb_free()
100 unsafe { (src.cast::<u8>()).copy_to(dest as *mut _, n) }; in avb_memcpy()
113 core::slice::from_raw_parts(src1 as *const u8, n), in avb_memcmp() constant
114 core::slice::from_raw_parts(src2 as *const u8, n), in avb_memcmp() constant
151 let arr = unsafe { core::slice::from_raw_parts_mut(dest as *mut u8, n) }; in avb_memset()
152 arr.fill(c as u8); in avb_memset()
/bootable/libbootloader/gbl/libgbl/src/fastboot/
Dsparse.rs61 pub fn is_sparse_image(sparse_img: &[u8]) -> Result<SparseHeader, CommandError> { in is_sparse_image()
138 pub fn write_sparse_image<F>(sparse_img: &mut [u8], mut write: F) -> Result<u64, CommandError> in write_sparse_image() argument
140 F: FnMut(u64, &mut [u8]) -> Result<(), CommandError>, in write_sparse_image()
206 buffer: &'a mut [u8],
211 fn get(&mut self, val: u32, size: u64) -> Result<&mut [u8], CommandError> { in get() argument
228 bytes: &mut [u8], in get_mut()
231 ) -> Result<&mut [u8], CommandError> { in get_mut() argument
237 bytes: &[u8], in get()
240 ) -> Result<&[u8], CommandError> { in get() argument
245 fn copy_from<T: AsBytes + FromBytes + Default>(bytes: &[u8]) -> Result<T, CommandError> { in copy_from()
[all …]
/bootable/libbootloader/gbl/libc/src/
Dlib.rs30 let start = ptr as *const u8; in memchr() constant
31 let target = (ch & 0xff) as u8; in memchr()
52 let target = (ch & 0xff) as u8; in strrchr()

12