Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 19 of 19) sorted by relevance

/bootable/libbootloader/gbl/libabr/src/
Dlib.rs148 pub fn deserialize(bytes: &[u8; ABR_SLOT_DATA_SIZE]) -> Self { in deserialize()
150 priority: bytes[0],
151 tries_remaining: bytes[1],
152 successful_boot: bytes[2],
153 reserved: bytes[3],
240 let mut bytes = [0u8; ABR_DATA_SIZE]; in deserialize() localVariable
241 abr_ops.read_abr_metadata(&mut bytes[..])?; in deserialize()
248 magic: bytes[..4].try_into().unwrap(), in deserialize()
249 version_major: bytes[4], in deserialize()
250 version_minor: bytes[5], in deserialize()
[all …]
/bootable/libbootloader/gbl/libgbl/src/fastboot/
Dsparse.rs228 bytes: &mut [u8], in get_mut()
232 bytes.get_mut(to_usize(start)?..to_usize(end)?).ok_or(ERR_IMAGE_SIZE.into()) in get_mut()
237 bytes: &[u8], in get()
241 bytes.get(to_usize(start)?..to_usize(end)?).ok_or(ERR_IMAGE_SIZE.into()) in get()
245 fn copy_from<T: AsBytes + FromBytes + Default>(bytes: &[u8]) -> Result<T, CommandError> { in copy_from()
247 res.as_bytes_mut().clone_from_slice(get(bytes, 0, size_of::<T>())?); in copy_from()
315 fn copy_to<T: AsBytes + FromBytes>(val: &T, bytes: &mut [u8]) { in copy_to()
316 bytes[..size_of::<T>()].clone_from_slice(val.as_bytes()); in copy_to()
/bootable/recovery/otautil/include/otautil/
Dprint_sha1.h43 [[maybe_unused]] static std::string print_hex(const uint8_t* bytes, size_t len) { in print_hex() argument
44 return print_sha1(bytes, len); in print_hex()
/bootable/libbootloader/gbl/libc/src/
Dlib.rs51 let bytes = unsafe { core::ffi::CStr::from_ptr(ptr).to_bytes_with_nul() }; in strrchr() localVariable
53 for c in bytes.iter().rev() { in strrchr()
/bootable/recovery/
Drecovery-persist.cpp72 size_t bytes; in copy_file() local
73 while ((bytes = fread(buf, 1, sizeof(buf), source_fp)) != 0) { in copy_file()
74 fwrite(buf, 1, bytes, dest_fp); in copy_file()
/bootable/libbootloader/gbl/docs/
DEFI_ANDROID_BOOT_PROTOCOL.md106 On exit, set to the maximum packet size in bytes allowed by the USB interface.
116 * Max packet size must be 64 bytes for full-speed, 512 bytes for high-speed and
117 1024 bytes for Super Speed USB.
213 On entry, the size in bytes of `Buffer`. On exit, the size in bytes of the
261 On entry, the size in bytes of `Buffer` to be sent. If the size is greater than
/bootable/libbootloader/gbl/libbootconfig/src/
Dlib.rs135 let bytes = self.config_bytes(); in fmt() localVariable
136 for val in &bytes[..bytes.len().checked_sub(BOOTCONFIG_TRAILER_SIZE).unwrap()] { in fmt()
/bootable/deprecated-ota/applypatch/
Dfreecache.cpp154 bool CheckAndFreeSpaceOnCache(size_t bytes) { in CheckAndFreeSpaceOnCache() argument
157 LOG(WARNING) << "Skipped making (" << bytes in CheckAndFreeSpaceOnCache()
164 if (RemoveFilesInDirectory(bytes, dirname, FreeSpaceForFile)) { in CheckAndFreeSpaceOnCache()
/bootable/recovery/recovery_utils/
Dlogging.cpp192 size_t bytes; in copy_log_file() local
193 while ((bytes = fread(buf, 1, sizeof(buf), source_fp)) != 0) { in copy_log_file()
194 fwrite(buf, 1, bytes, dest_fp); in copy_log_file()
/bootable/libbootloader/gbl/efi/src/
Dutils.rs58 pub fn aligned_subslice(bytes: &mut [u8], alignment: usize) -> Result<&mut [u8]> { in aligned_subslice()
59 let addr = bytes.as_ptr() as usize; in aligned_subslice()
60 Ok(&mut bytes[usize_roundup(addr, alignment)? - addr..]) in aligned_subslice()
Dandroid_boot.rs134 usize_roundup(hdr.bytes().len(), hdr.page_size)?, in load_android_simple()
139 usize_roundup(hdr.bytes().len(), hdr._base.page_size)?, in load_android_simple()
/bootable/deprecated-ota/applypatch/include/applypatch/
Dapplypatch.h125 bool CheckAndFreeSpaceOnCache(size_t bytes);
/bootable/libbootloader/gbl/libstorage/src/
Dgpt.rs47 fn from_bytes(bytes: &mut [u8]) -> &mut GptHeader { in from_bytes()
48 Ref::<_, GptHeader>::new_from_prefix(bytes).unwrap().0.into_mut() in from_bytes()
143 fn from_bytes(bytes: &mut [u8]) -> &mut Self { in from_bytes()
144 Ref::<_, GptInfo>::new_from_prefix(bytes).unwrap().0.into_mut() in from_bytes()
/bootable/libbootloader/gbl/libfdt/src/
Dlib.rs374 let (header, bytes) = unsafe { FdtHeader::from_raw(init.as_ptr()).unwrap() }; in test_header_from_raw()
376 assert_eq!(bytes.to_vec(), init); in test_header_from_raw()
/bootable/libbootloader/gbl/libgbl/src/
Dlib.rs222 let bytes: SuffixBytes = in load_and_verify_image() localVariable
226 let avb_suffix = CStr::from_bytes_until_nul(&bytes)?; in load_and_verify_image()
/bootable/deprecated-ota/updater/
Dinstall.cpp615 size_t bytes; in ApplyPatchSpaceFn() local
616 if (!android::base::ParseUint(bytes_str.c_str(), &bytes)) { in ApplyPatchSpaceFn()
622 if (state->is_retry || CheckAndFreeSpaceOnCache(bytes)) { in ApplyPatchSpaceFn()
/bootable/libbootloader/gbl/libfastboot/src/
Dlib.rs934 pub fn append(&mut self, bytes: &[u8]) -> &mut [u8] { in append()
938 let to_write = core::cmp::min(buf.len(), bytes.len()); in append()
939 buf[..to_write].clone_from_slice(&bytes[..to_write]); in append()
/bootable/libbootloader/gbl/third_party/libzbi/src/
Dlib.rs627 self.buffer[start..end].clone_from_slice(b.header.bytes()); in extend()
1265 pub fn padding(mut self, val: u8, bytes: usize) -> Self { in padding()
1266 self.buffer[self.tail_offset..self.tail_offset + bytes].fill(val); in padding()
1267 self.tail_offset += bytes; in padding()
/bootable/libbootloader/gbl/libefi/src/
Dlib.rs620 let bytes = &self.memory_map.buffer[self.offset..][..self.memory_map.descriptor_size]; in next() localVariable
622 Some(Ref::<_, EfiMemoryDescriptor>::new_from_prefix(bytes).unwrap().0.into_ref()) in next()