/DragonOS/kernel/src/libs/lib_ui/font/ |
H A D | mod.rs | 17 size: Size, field 27 size: Size, in new() 32 size, in new() 33 bytes_per_char: (size.width + 7) / 8 * size.height, in new() 38 self.size.width as u32 in width() 43 self.size.height as u32 in height() 71 pub size: Size, field 77 let size = Size { in new() localVariable 81 Self { data, size } in new() 84 pub const fn size(&self) -> Size { in size() method [all …]
|
/DragonOS/kernel/src/mm/ |
H A D | memblock.rs | 56 pub fn add_block(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in add_block() 57 let r = self.add_range(base, size, MemoryAreaAttr::empty()); in add_block() 67 size: usize, in add_range() 70 if size == 0 { in add_range() 78 let block = PhysMemoryArea::new(base, size, MemoryAreaAttr::empty()); in add_range() 111 let end = block.base + block.size; in do_add_block() 121 inner.initial_memory_regions[i].base + inner.initial_memory_regions[i].size; in do_add_block() 175 size: usize, in do_insert_area() 182 inner.initial_memory_regions[index] = PhysMemoryArea::new(base, size, flags); in do_insert_area() 201 let next_size = inner.initial_memory_regions[(i + 1) as usize].size; in do_merge_blocks() [all …]
|
H A D | c_adapter.rs | 20 pub unsafe extern "C" fn kzalloc(size: usize, _gfp: u64) -> usize { in kzalloc() 22 return do_kmalloc(size, true); in kzalloc() 26 pub unsafe extern "C" fn kmalloc(size: usize, _gfp: u64) -> usize { in kmalloc() 29 return do_kmalloc(size, true); in kmalloc() 32 fn do_kmalloc(size: usize, _zero: bool) -> usize { in do_kmalloc() 33 let space: Vec<u8> = vec![0u8; size]; in do_kmalloc() 35 assert!(space.len() == size); in do_kmalloc() 87 size: u32, in rs_mmio_create() 93 let r = mmio_pool().create_mmio(size as usize); in rs_mmio_create() 99 *res_length = space_guard.size() as u64; in rs_mmio_create()
|
H A D | early_ioremap.rs | 45 mut size: usize, in map_not_aligned() 51 size += offset; in map_not_aligned() 54 let (map_vaddr, _) = Self::map(phys, size, read_only)?; in map_not_aligned() 78 size: usize, in map() 89 let slot_count = PageFrameCount::from_bytes(page_align_up(size)) in map() 132 slot_guard[slot_idx].size = map_size as u32; in map() 166 let vaddr_end = vaddr_start + slot.size as usize; in unmap() 179 let count = PageFrameCount::from_bytes(slot_guard[idx].size as usize).unwrap(); in unmap() 204 size: u32, field 212 size: 0,
|
H A D | mod.rs | 405 pub size: usize, field 413 size: 0, 417 pub fn new(base: PhysAddr, size: usize, flags: MemoryAreaAttr) -> Self { in new() 418 Self { base, size, flags } in new() 430 return PhysAddr::new((self.base.data() + self.size) & !(MMArch::PAGE_SIZE - 1)); in area_end_aligned() 707 size: usize, field 713 pub fn new(start: VirtAddr, size: usize) -> Self { in new() 714 VirtRegion { start, size } in new() 726 return self.start().add(self.size); in end() 736 let size = end.data() - start.data(); in between() localVariable [all …]
|
H A D | slab.h | 12 extern void *kmalloc(unsigned long size, gfp_t gfp); 21 extern void *kzalloc(size_t size, gfp_t gfp);
|
H A D | mmio_buddy.rs | 486 pub fn create_mmio(&self, size: usize) -> Result<MMIOSpaceGuard, SystemError> { in create_mmio() 487 if size > PAGE_1G_SIZE || size == 0 { in create_mmio() 492 let mut size_exp: u32 = 63 - size.leading_zeros(); in create_mmio() 495 let mut new_size = size; in create_mmio() 624 size: usize, field 629 pub unsafe fn from_raw(vaddr: VirtAddr, size: usize, mapped: bool) -> Self { in from_raw() 632 size & (MMArch::PAGE_SIZE - 1) == 0, in from_raw() 635 assert!(size.is_power_of_two(), "MMIO space size must be power of 2"); in from_raw() 637 vaddr.check_aligned(size), in from_raw() 642 && vaddr.data() + size <= MMArch::MMIO_TOP.data(), in from_raw() [all …]
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | sc.rs | 51 pub(crate) size: usize, field 71 ($size:expr) => {{ 72 let obj_per_page = cmin((P::SIZE - OBJECT_PAGE_METADATA_OVERHEAD) / $size, 8 * 64); 74 size: $size, 92 pub const fn new(size: usize) -> SCAllocator<'a, P> { in new() 93 new_sc_allocator!(size) in new() 97 pub fn new(size: usize) -> SCAllocator<'a, P> { in new() 98 new_sc_allocator!(size) in new() 102 pub fn size(&self) -> usize { in size() method 103 self.size in size() [all …]
|
H A D | zone.rs | 142 free += slab_page.free_obj_count() * scallocator.size(); in free_space() 146 scallocator.empty_slabs.elements * (scallocator.obj_per_page * scallocator.size()); in free_space() 160 match ZoneAllocator::get_slab(layout.size()) { in allocate() 179 match ZoneAllocator::get_slab(layout.size()) { in deallocate() 194 match ZoneAllocator::get_slab(layout.size()) { in refill()
|
/DragonOS/kernel/src/driver/open_firmware/ |
H A D | fdt.rs | 193 let (size, _) = read_cell(reg.value, base_index, size_cells); in early_init_scan_memory() 195 if size == 0 { in early_init_scan_memory() 199 debug!("Found memory: base={:#x}, size={:#x}", base, size); in early_init_scan_memory() 200 self.early_init_dt_add_memory(base, size); in early_init_scan_memory() 214 pub fn early_init_dt_add_memory(&self, base: u64, size: u64) { in early_init_dt_add_memory() 222 let mut size = size as usize; in early_init_dt_add_memory() localVariable 224 if size < (MMArch::PAGE_SIZE - (base & (!MMArch::PAGE_MASK))) { in early_init_dt_add_memory() 225 warn!("Ignoring memory block {:#x}-{:#x}", base, base + size); in early_init_dt_add_memory() 229 size -= MMArch::PAGE_SIZE - (base & (!MMArch::PAGE_MASK)); in early_init_dt_add_memory() 233 size = page_align_down(size); in early_init_dt_add_memory() [all …]
|
/DragonOS/kernel/src/arch/x86_64/include/asm/ |
H A D | asm.h | 142 void *memset(void *dst, unsigned char C, ul size) in memset() argument 161 : "a"(tmp), "q"(size), "0"(size / 8), "1"(dst) in memset() 274 static inline uint64_t copy_from_user(void *dst, void *src, uint64_t size) in copy_from_user() argument 277 if (!verify_area((uint64_t)src, size)) in copy_from_user() 289 : "=&c"(size), "=&D"(tmp0), "=&S"(tmp1) in copy_from_user() 290 : "r"(size & 7), "0"(size >> 3), "1"(dst), "2"(src) in copy_from_user() 292 return size; in copy_from_user() 303 static inline uint64_t copy_to_user(void *dst, void *src, uint64_t size) in copy_to_user() argument 305 if (verify_area((uint64_t)src, size)) in copy_to_user() 321 memcpy(dst, src, size); in copy_to_user() [all …]
|
/DragonOS/kernel/src/common/ |
H A D | compiler.h | 49 static __always_inline void __read_once_size(void *dst, const volatile void *src, int size) in __read_once_size() argument 51 switch (size) in __read_once_size() 67 __builtin_memcpy((void *)dst, (const void *)src, size); in __read_once_size() 80 static __always_inline void __write_once_size(volatile void *dst, void *src, int size) in __write_once_size() argument 82 switch (size) in __write_once_size() 98 __builtin_memcpy((void *)dst, (const void *)src, size); in __write_once_size()
|
/DragonOS/kernel/src/arch/x86_64/init/ |
H A D | multiboot2.rs | 120 scinfo.red_size = red.size; in early_init_framebuffer_info() 122 scinfo.green_size = green.size; in early_init_framebuffer_info() 124 scinfo.blue_size = blue.size; in early_init_framebuffer_info() 152 let size = region.size() as usize; in early_init_memory_blocks() localVariable 154 total_mem_size += size; in early_init_memory_blocks() 158 usable_mem_size += size; in early_init_memory_blocks() 160 .add_block(start, size) in early_init_memory_blocks() 165 size, in early_init_memory_blocks() 173 .reserve_block(start, size) in early_init_memory_blocks() 178 size, in early_init_memory_blocks() [all …]
|
/DragonOS/kernel/src/arch/x86_64/init/pvh/ |
H A D | mod.rs | 80 let size = entry.size as usize; in early_init_memory_blocks() localVariable 83 total_mem_size += size; in early_init_memory_blocks() 86 usable_mem_size += size; in early_init_memory_blocks() 88 .add_block(start, size) in early_init_memory_blocks() 93 size, in early_init_memory_blocks() 100 .reserve_block(start, size) in early_init_memory_blocks() 105 size, in early_init_memory_blocks()
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | transport_mmio.rs | 38 let size = reg.size.unwrap_or(0); in new() localVariable 41 let size = page_align_up(size + page_offset); in new() localVariable 50 let mmio_guard = mmio_pool().create_mmio(size)?; in new() 51 unsafe { mmio_guard.map_phys(PhysAddr::new(paddr), size) }?; in new() 130 size: u32, in queue_set() 136 .queue_set(queue, size, descriptors, driver_area, device_area) in queue_set()
|
/DragonOS/kernel/src/perf/ |
H A D | bpf.rs | 37 size: usize, field 48 size: 0, in empty() 59 fn init(ptr: *mut u8, size: usize, phys_addr: PhysAddr) -> Self { in init() 60 assert_eq!(size % PAGE_SIZE, 0); in init() 61 assert!(size / PAGE_SIZE >= 2); in init() 66 perf_event_mmap_page.data_size = (size - PAGE_SIZE) as u64; in init() 75 size, in init() 76 data_region_size: size - PAGE_SIZE, in init() 180 size: size_of::<SampleHeader>() as u16 + data.len() as u16, in write_sample() 182 size: data.len() as u32, in write_sample() [all …]
|
H A D | util.rs | 39 pub size: u32, field 70 size: attr.size, in try_from() 103 pub size: u32, field
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | assembler.rs | 106 for &(suffix, size) in &mem_sizes { in make_instruction_map() 110 ebpf::BPF_ABS | ebpf::BPF_LD | size, in make_instruction_map() 115 ebpf::BPF_IND | ebpf::BPF_LD | size, in make_instruction_map() 120 ebpf::BPF_MEM | ebpf::BPF_LDX | size, in make_instruction_map() 125 ebpf::BPF_MEM | ebpf::BPF_ST | size, in make_instruction_map() 130 ebpf::BPF_MEM | ebpf::BPF_STX | size, in make_instruction_map() 145 for &size in &[16, 32, 64] { in make_instruction_map() 146 entry(&format!("be{size}"), Endian(size), ebpf::BE); in make_instruction_map() 147 entry(&format!("le{size}"), Endian(size), ebpf::LE); in make_instruction_map() 207 (Endian(size), Register(dst), Nil, Nil) => insn(opc, dst, 0, 0, size), in encode()
|
/DragonOS/kernel/src/driver/firmware/efi/ |
H A D | init.rs | 94 page_align_up(info.size as usize), in efi_init() 110 let size = (md.page_count << (MMArch::PAGE_SHIFT as u64)) as usize; in efi_find_mirror() localVariable 113 mem_block_manager().mark_mirror(start, size).unwrap(); in efi_find_mirror() 114 mirror_size += size; in efi_find_mirror() 117 total_size += size; in efi_find_mirror() 266 let size = (page_count << (MMArch::PAGE_SHIFT as u64)) as usize; in reserve_memory_regions() localVariable 270 open_firmware_fdt_driver().early_init_dt_add_memory(phys_start as u64, size as u64); in reserve_memory_regions() 278 .mark_nomap(PhysAddr::new(phys_start), size) in reserve_memory_regions() 285 .reserve_block(PhysAddr::new(phys_start), size) in reserve_memory_regions()
|
H A D | memmap.rs | 21 pub(super) size: usize, field 39 size: 0, 49 return self.vaddr.map(|v| v + self.size); in map_end_vaddr() 74 if self.offset + size_of::<Self::Item>() > self.inner.size { in next() 139 inner_guard.mmap.size = data.mmap_size.unwrap() as usize; in do_efi_memmap_init()
|
/DragonOS/kernel/src/filesystem/overlayfs/ |
H A D | copy_up.rs | 21 let mut buffer = vec![0u8; metadata.size as usize]; in copy_up() 23 lower_inode.read_at(0, metadata.size as usize, &mut buffer, lock.lock())?; in copy_up() 25 new_upper_inode.write_at(0, metadata.size as usize, &buffer, lock.lock())?; in copy_up()
|
/DragonOS/kernel/src/driver/acpi/ |
H A D | mod.rs | 124 let size = core::mem::size_of::<acpi::rsdp::Rsdp>(); in rsdp_paddr() localVariable 128 size, in rsdp_paddr() 131 unsafe { RSDP_TMP_BOX.as_mut().unwrap()[0..size].copy_from_slice(tmp_data) }; in rsdp_paddr() 188 size: usize, in map_physical_region() 191 let size_fix = page_align_up(size + offset); in map_physical_region() 207 size, in map_physical_region() 208 mmio_guard.size(), in map_physical_region()
|
/DragonOS/kernel/src/arch/riscv64/mm/ |
H A D | init.rs | 108 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in riscv_mm_init() 185 let size = info.size as usize; in remap_at_low_address() localVariable 187 for i in 0..(size / MMArch::PAGE_SIZE) { in remap_at_low_address() 207 let size = info.size as usize; in unmap_at_low_address() localVariable 209 for i in 0..(size / MMArch::PAGE_SIZE) { in unmap_at_low_address()
|
/DragonOS/kernel/src/arch/riscv64/pci/ |
H A D | pci_host_ecam.rs | 21 let size = reg.size.unwrap_or(0); in pci_host_ecam_driver_init() localVariable 46 size, in pci_host_ecam_driver_init()
|
/DragonOS/kernel/src/driver/block/cache/ |
H A D | cached_block_device.rs | 254 if addr > self.frame_selector.size() { in read() 378 fn size(&self) -> usize; in size() method 387 size: usize, field 396 size: 0, in new() 405 self.size += 1; in index_append() 419 self.size < self.threshold in can_append() 422 fn size(&self) -> usize { in size() method 423 self.size in size()
|