Home
last modified time | relevance | path

Searched refs:usize (Results 1 – 25 of 197) sorted by relevance

12345678

/packages/modules/Virtualization/libs/libvmbase/src/
Dheap.rs50 pub struct HeapArray<const SIZE: usize> {
54 impl<const SIZE: usize> HeapArray<SIZE> {
81 static HEAP_RANGE: Once<Range<usize>> = Once::new();
92 range.start as usize..range.end as usize in init()
95 let start = heap.as_mut_ptr() as usize; in init()
104 pub fn aligned_boxed_slice(size: usize, align: usize) -> Option<Box<[u8]>> { in aligned_boxed_slice() argument
117 unsafe extern "C" fn malloc(size: usize) -> *mut c_void { in malloc()
122 unsafe extern "C" fn calloc(nmemb: usize, size: usize) -> *mut c_void { in calloc() argument
131 len: usize, in __memset_chk() argument
132 destlen: usize, in __memset_chk() argument
[all …]
Dutil.rs23 pub const fn unchecked_align_down(addr: usize, alignment: usize) -> usize { in unchecked_align_down() argument
30 pub const fn unchecked_align_up(addr: usize, alignment: usize) -> usize { in unchecked_align_up() argument
35 pub const fn align_up(addr: usize, alignment: usize) -> Option<usize> { in align_up() argument
49 const fn align_down(addr: usize, alignment: usize) -> Option<usize> { in align_down() argument
60 pub const fn ceiling_div(num: usize, den: usize) -> Option<usize> { in ceiling_div() argument
/packages/modules/Virtualization/libs/libvmbase/src/memory/
Dutil.rs23 pub const SIZE_4KB: usize = 4 << 10;
25 pub const SIZE_16KB: usize = 16 << 10;
27 pub const SIZE_64KB: usize = 64 << 10;
29 pub const SIZE_128KB: usize = 128 << 10;
31 pub const SIZE_2MB: usize = 2 << 20;
33 pub const SIZE_4MB: usize = 4 << 20;
36 pub const PAGE_SIZE: usize = SIZE_4KB;
41 flush_region(reg.as_ptr() as usize, reg.len()) in flush()
52 pub const fn page_4kb_of(addr: usize) -> usize { in page_4kb_of() argument
60 pub(crate) fn virt_to_phys(vaddr: NonNull<u8>) -> usize { in virt_to_phys() argument
[all …]
Dtracker.rs82 pub fn resize_available_memory(memory_range: &Range<usize>) -> Result<()> { in resize_available_memory()
89 pub fn init_shared_pool(static_range: Option<Range<usize>>) -> Result<()> { in init_shared_pool()
129 pub fn map_data(addr: usize, size: NonZeroUsize) -> Result<()> { in map_data() argument
141 pub fn map_data_noflush(addr: usize, size: NonZeroUsize) -> Result<()> { in map_data_noflush() argument
151 pub fn map_image_footer() -> Result<Range<usize>> { in map_image_footer()
161 pub fn map_rodata(addr: usize, size: NonZeroUsize) -> Result<()> { in map_rodata() argument
174 pub unsafe fn map_rodata_outside_main_memory(addr: usize, size: NonZeroUsize) -> Result<()> { in map_rodata_outside_main_memory() argument
177 let end = addr + usize::from(size); in map_rodata_outside_main_memory()
186 pub fn map_device(addr: usize, size: NonZeroUsize) -> Result<()> { in map_device() argument
189 let range = addr..(addr + usize::from(size)); in map_device()
[all …]
/packages/modules/Virtualization/guest/authfs/src/fsverity/
Deditor.rs68 debug_assert!(usize::MAX as u64 == u64::MAX, "Only 64-bit arch is supported"); in debug_assert_usize_is_u64()
85 pub fn get_fsverity_digest_size(&self) -> usize { in get_fsverity_digest_size() argument
99 ) -> io::Result<usize> { in read_backing_chunk_unverified() argument
108 ) -> io::Result<usize> { in read_backing_chunk_verified() argument
111 if merkle_tree_locked.is_index_valid(chunk_index as usize) { in read_backing_chunk_verified()
116 if !merkle_tree_locked.is_consistent(chunk_index as usize, &hash) { in read_backing_chunk_verified()
128 offset_from_alignment: usize, in new_hash_for_incomplete_write() argument
129 output_chunk_index: usize, in new_hash_for_incomplete_write() argument
135 let mut orig_data = [0u8; CHUNK_SIZE as usize]; in new_hash_for_incomplete_write()
159 offset_from_alignment: usize, in new_chunk_hash() argument
[all …]
Dbuilder.rs23 const HASH_SIZE: usize = SHA256_HASH_SIZE;
24 const HASH_PER_PAGE: usize = CHUNK_SIZE as usize / HASH_SIZE;
76 pub fn resize(&mut self, new_file_size: usize) { in resize() argument
79 self.leaves.resize(leaves_size as usize, HASH_OF_4096_ZEROS); in resize()
85 pub fn update_hash(&mut self, index: usize, hash: &Sha256Hash, size_at_least: u64) { in update_hash() argument
100 pub fn is_index_valid(&self, index: usize) -> bool { in is_index_valid()
105 pub fn is_consistent(&self, index: usize, hash: &Sha256Hash) -> bool { in is_consistent() argument
209 let hash = sha256(&vec![1u8; CHUNK_SIZE as usize]); in merkle_tree_non_sequential()
248 tree.resize(CHUNK_SIZE as usize * 2 - 100); in merkle_tree_shrink_leaves()
261 for (index, chunk) in test_data.chunks(CHUNK_SIZE as usize).enumerate() { in generate_fsverity_digest_sequentially()
[all …]
Dverifier.rs25 const ZEROS: [u8; CHUNK_SIZE as usize] = [0u8; CHUNK_SIZE as usize];
29 fn hash_with_padding(chunk: &[u8], pad_to: usize) -> HashBuffer { in hash_with_padding()
48 let chunk_hash = hash_with_padding(chunk, CHUNK_SIZE as usize); in verity_check()
65 Ok(hash_with_padding(&merkle_chunk, CHUNK_SIZE as usize)) in verity_check()
79 ) -> Result<impl Iterator<Item = Result<([u8; 4096], usize), FsverityError>> + '_, FsverityError> { in fsverity_walk() argument
102 let hash_offset_in_chunk = (global_hash_offset % CHUNK_SIZE) as usize;
131 let mut buf = [0u8; CHUNK_SIZE as usize]; in new()
152 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
191 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
197 let read_size = (end - start) as usize; in read_chunk()
[all …]
/packages/modules/Virtualization/libs/libvm_payload/src/
Dlib.rs45 const MAX_ECDSA_P256_SIGNATURE_SIZE: usize = 72;
46 const RP_DATA_SIZE: usize = 32;
182 identifier_size: usize, in AVmPayload_getVmInstanceSecret() argument
184 size: usize, in AVmPayload_getVmInstanceSecret() argument
199 fn try_get_vm_instance_secret(identifier: &[u8], size: usize) -> Result<Vec<u8>> { in try_get_vm_instance_secret()
223 pub unsafe extern "C" fn AVmPayload_getDiceAttestationChain(data: *mut u8, size: usize) -> usize { in AVmPayload_getDiceAttestationChain() argument
252 pub unsafe extern "C" fn AVmPayload_getDiceAttestationCdi(data: *mut u8, size: usize) -> usize { in AVmPayload_getDiceAttestationCdi() argument
285 challenge_size: usize, in AVmPayload_requestAttestation() argument
312 challenge_size: usize, in AVmPayload_requestAttestationForTesting() argument
338 challenge_size: usize, in request_attestation() argument
[all …]
/packages/modules/Virtualization/libs/dice/open_dice/src/
Ddice.rs34 pub const HASH_SIZE: usize = DICE_HASH_SIZE as usize;
36 pub const HIDDEN_SIZE: usize = DICE_HIDDEN_SIZE as usize;
38 const INLINE_CONFIG_SIZE: usize = DICE_INLINE_CONFIG_SIZE as usize;
40 pub const CDI_SIZE: usize = DICE_CDI_SIZE as usize;
42 pub const PRIVATE_KEY_SEED_SIZE: usize = DICE_PRIVATE_KEY_SEED_SIZE as usize;
44 pub const PRIVATE_KEY_SIZE: usize = DICE_PRIVATE_KEY_BUFFER_SIZE as usize;
46 pub const ID_SIZE: usize = DICE_ID_SIZE as usize;
92 pub fn public_key_size(&self) -> usize { in public_key_size() argument
101 pub fn signature_size(&self) -> usize { in signature_size() argument
110 pub fn private_key_size(&self) -> usize { in private_key_size() argument
[all …]
/packages/modules/Virtualization/libs/libvmbase/src/arch/aarch64/
Dlayout.rs24 pub const MMIO_START: usize = 0x0;
26 pub const MMIO_END: usize = PVMFW_START;
28 pub const MMIO_RANGE: Range<usize> = MMIO_START..MMIO_END;
31 pub const PVMFW_START: usize = 0x7fc00000;
34 pub const MEM_START: usize = 0x8000_0000;
37 pub const FDT_MAX_SIZE: usize = 2 << 20;
40 pub const MAX_VIRT_ADDR: usize = 1 << 40;
45 pub const UART_ADDRESSES: [usize; 4] = [0x3f8, 0x2f8, 0x3e8, 0x2e8];
48 pub const UART_PAGE_ADDR: usize = 0;
Dpage_table.rs60 const TCR_EL1_TG0_MASK: usize = 0x3; in default()
62 const TCR_EL1_TG0_SIZE_4KB: usize = 0b00; in default()
64 const TCR_EL1_T0SZ_MASK: usize = 0x3f; in default()
66 const TCR_EL1_T0SZ_39_VA_BITS: usize = 64 - 39; in default()
79 pub const ASID: usize = 1;
82 const ROOT_LEVEL: usize = 1;
145 F: Fn(&MemoryRegion, &mut Descriptor, usize) -> result::Result<(), ()>, in modify_range()
154 F: Fn(&MemoryRegion, &Descriptor, usize) -> result::Result<(), ()>, in walk_range()
156 let mut callback = |mr: &MemoryRegion, d: &Descriptor, l: usize| f(mr, d, l); in walk_range()
Dplatform.rs34 const MAX_CONSOLES: usize = 4;
38 static ADDRESSES: [Once<usize>; MAX_CONSOLES] =
42 pub const DEFAULT_CONSOLE_INDEX: usize = 0;
45 pub const DEFAULT_EMERGENCY_CONSOLE_INDEX: usize = DEFAULT_CONSOLE_INDEX;
56 pub unsafe fn init_all_uart(base_addresses: &[usize]) { in init_all_uart() argument
108 pub fn uart(id: usize) -> Option<&'static SpinMutex<Uart>> { in uart()
121 pub unsafe fn emergency_uart(id: usize) -> Option<Uart> { in emergency_uart()
Dexceptions.rs70 Unknown(usize),
74 const EXT_DABT_32BIT: usize = 0x96000010;
75 const TRANSL_FAULT_BASE_32BIT: usize = 0x96000004;
76 const TRANSL_FAULT_ISS_MASK_32BIT: usize = !0x143;
77 const PERM_FAULT_BASE_32BIT: usize = 0x9600004C;
78 const PERM_FAULT_ISS_MASK_32BIT: usize = !0x103;
81 impl From<usize> for Esr {
82 fn from(esr: usize) -> Self { in from()
/packages/modules/Virtualization/guest/pvmfw/src/
Dconfig.rs55 InvalidSize(usize),
59 EntryOutOfBounds(Entry, Range<usize>, Range<usize>),
92 pub fn total_size(&self) -> usize { in total_size() argument
93 self.total_size as usize in total_size()
96 pub fn body_lowest_bound(&self) -> Result<usize> { in body_lowest_bound() argument
108 pub fn entry_count(&self) -> Result<usize> { in entry_count() argument
121 Ok(last_entry as usize + 1) in entry_count()
136 const COUNT: usize = Self::_VARIANT_COUNT as usize;
175 start: usize,
180 pub fn new(start: usize, size: usize) -> Option<Self> { in new() argument
[all …]
Dgpt.rs40 BlockOutsidePartition(usize),
58 indices: RangeInclusive<usize>,
73 pub fn indices(&self) -> RangeInclusive<usize> { in indices() argument
77 pub fn read_block(&mut self, index: usize, blk: &mut [u8]) -> Result<()> { in read_block() argument
82 pub fn write_block(&mut self, index: usize, blk: &[u8]) -> Result<()> { in write_block() argument
87 fn block_index(&self, index: usize) -> Option<usize> { in block_index() argument
98 entries_count: usize,
102 pub const LBA_SIZE: usize = SECTOR_SIZE;
111 let entries_count = usize::try_from(header.entries_count()).unwrap(); in new()
147 fn read_block(&mut self, index: usize, blk: &mut [u8]) -> Result<()> { in read_block() argument
[all …]
Dfdt.rs60 InvalidCpuCount(usize),
114 impl From<DeviceTreeInteger> for usize { implementation
143 pub fn read_kernel_range_from(fdt: &Fdt) -> libfdt::Result<Option<Range<usize>>> { in read_kernel_range_from() argument
146 let addr = usize::from(addr); in read_kernel_range_from()
147 let size = usize::from(size); in read_kernel_range_from()
168 pub fn read_initrd_range_from(fdt: &Fdt) -> libfdt::Result<Option<Range<usize>>> { in read_initrd_range_from() argument
170 Ok(Some(usize::from(start)..usize::from(end))) in read_initrd_range_from()
230 alignment: usize, in read_and_validate_memory_range() argument
231 ) -> Result<Range<usize>, RebootReason> { in read_and_validate_memory_range() argument
270 fn patch_memory_range(fdt: &mut Fdt, memory_range: &Range<usize>) -> libfdt::Result<()> { in patch_memory_range()
[all …]
/packages/modules/Virtualization/build/microdroid/initrd/src/
Dmain.rs24 const FOOTER_ALIGNMENT: usize = 4;
28 const INITRD_FOOTER_LEN: usize = 2 * std::mem::size_of::<u32>() + BOOTCONFIG_MAGIC.len();
61 fn copyfile2file(file_in: &mut File, file_out: &mut File, n: usize) -> Result<()> { in copyfile2file()
63 let mut copied: usize = 0; in copyfile2file()
78 let initrd_bc_size: usize = initrd_bc.metadata()?.len().try_into()?; in detach_bootconfig()
89 let bc_size: usize = u32::from_le_bytes(size_buf) as usize; in detach_bootconfig()
91 let initrd_size: usize = initrd_bc_size - bc_size - INITRD_FOOTER_LEN; in detach_bootconfig()
104 let initrd_size: usize = initrd_file.metadata()?.len().try_into()?; in attach_bootconfig()
105 let mut bootconfig_size: usize = 0; in attach_bootconfig()
112 bootconfig_size += bootconfig_file.metadata()?.len() as usize; in attach_bootconfig()
[all …]
/packages/modules/Virtualization/guest/authfs/src/
Dcommon.rs27 remaining: usize,
29 alignment: usize,
33 pub fn new(remaining: usize, offset: u64, alignment: usize) -> Self { in new() argument
39 type Item = (u64, usize);
47 self.alignment - (self.offset % self.alignment as u64) as usize, in next()
60 fn collect_chunk_read_iter(remaining: usize, offset: u64) -> Vec<(u64, usize)> { in collect_chunk_read_iter() argument
Dfile.rs20 pub type ChunkBuffer = [u8; CHUNK_SIZE as usize];
42 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize>; in read_chunk() argument
53 fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize>; in write_at() argument
87 let file_size = usize::try_from(file_size).unwrap(); in new()
89 let mut chunk_buffer = [0; CHUNK_SIZE as usize]; in new()
106 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
107 if let Some(chunk) = &self.buffer.chunks(CHUNK_SIZE as usize).nth(chunk_index as usize) { in read_chunk()
/packages/modules/Virtualization/libs/apkverify/src/
Dhashtree.rs33 input_size: usize, in from() argument
35 block_size: usize, in from() argument
67 input_size: usize, in generate_hash_tree() argument
69 block_size: usize, in generate_hash_tree() argument
117 block_size: usize, in hash_one_block() argument
128 type Range = std::ops::Range<usize>;
131 fn calc_hash_levels(input_size: usize, block_size: usize, digest_size: usize) -> Vec<Range> { in calc_hash_levels() argument
170 fn round_to_multiple(n: usize, unit: usize) -> usize { in round_to_multiple() argument
209 let size = std::fs::metadata(&input_name)?.len() as usize; in compare_with_golden_output()
/packages/modules/Bluetooth/system/rust/src/gatt/
Dmtu.rs22 IncomingResponse(usize),
24 IncomingRequest(usize),
31 previous_mtu: Cell<usize>,
34 stable_mtu: SharedMutex<usize>,
36 pending_exchange: Cell<Option<OwnedMutexGuard<usize>>>,
40 const DEFAULT_ATT_MTU: usize = 23;
54 pub fn snapshot_or_default(&self) -> usize { in snapshot_or_default() argument
60 pub fn snapshot(&self) -> impl Future<Output = Option<usize>> { in snapshot()
86 fn on_incoming_response(&self, mtu: usize) -> Result<()> { in on_incoming_response()
98 fn on_incoming_request(&self, mtu: usize) { in on_incoming_request() argument
[all …]
/packages/modules/Bluetooth/offload/hal/
Dffi.rs30 event_received: unsafe extern "C" fn(*mut c_void, *const u8, usize),
31 acl_received: unsafe extern "C" fn(*mut c_void, *const u8, usize),
32 sco_received: unsafe extern "C" fn(*mut c_void, *const u8, usize),
33 iso_received: unsafe extern "C" fn(*mut c_void, *const u8, usize),
45 send_command: unsafe extern "C" fn(handle: *mut c_void, data: *const u8, len: usize),
46 send_acl: unsafe extern "C" fn(handle: *mut c_void, data: *const u8, len: usize),
47 send_sco: unsafe extern "C" fn(handle: *mut c_void, data: *const u8, len: usize),
48 send_iso: unsafe extern "C" fn(handle: *mut c_void, data: *const u8, len: usize),
221 len: usize, in event_received() argument
241 len: usize, in acl_received() argument
[all …]
/packages/modules/Virtualization/libs/libhypervisor_backends/src/
Dmem.rs16 pub const SIZE_4KB: usize = 4 << 10;
22 pub const fn unchecked_align_down(addr: usize, alignment: usize) -> usize { in unchecked_align_down() argument
28 pub const fn page_4kb_of(addr: usize) -> usize { in page_4kb_of() argument
/packages/modules/Virtualization/libs/libvmbase/src/arch/
Daarch64.rs31 let mut r: usize;
53 let value: usize = $val;
90 let addr: usize = $addr;
107 let asid: usize = $asid;
108 let addr: usize = $addr;
124 pub fn min_dcache_line_size() -> usize { in min_dcache_line_size()
125 const DMINLINE_SHIFT: usize = 16; in min_dcache_line_size()
126 const DMINLINE_MASK: usize = 0xf; in min_dcache_line_size()
/packages/modules/Bluetooth/offload/leaudio/hci/
Darbiter.rs23 max_buf_len: usize,
37 in_transit: HashMap<u16, usize>,
46 pub fn new(sink: Arc<dyn Module>, max_buf_len: usize, max_buf_count: usize) -> Self { in new() argument
56 pub fn max_buf_len(&self) -> usize { in max_buf_len() argument
88 pub fn set_completed(&self, handle: u16, num: usize) { in set_completed() argument
104 state.queues[origin as usize].push_back((handle, data)); in push()
112 max_buf_count: usize, in thread_loop() argument
134 fn pull(state: &mut MutexGuard<'_, State>, max_buf_count: usize) -> Option<Vec<u8>> { in pull()

12345678