/DragonOS/kernel/src/bpf/helper/ |
H A D | mod.rs | 5 use crate::bpf::map::{BpfCallBackFn, BpfMap}; 22 unsafe fn raw_map_lookup_elem(map: *mut c_void, key: *const c_void) -> *const c_void { in raw_map_lookup_elem() 23 let map = Arc::from_raw(map as *const BpfMap); in raw_map_lookup_elem() localVariable 24 let key_size = map.key_size(); in raw_map_lookup_elem() 26 let value = map_lookup_elem(&map, key); in raw_map_lookup_elem() 29 let _ = Arc::into_raw(map); in raw_map_lookup_elem() 36 pub fn map_lookup_elem(map: &Arc<BpfMap>, key: &[u8]) -> Result<Option<*const u8>> { in map_lookup_elem() 37 let mut binding = map.inner_map().lock(); in map_lookup_elem() 50 map: *mut c_void, in raw_perf_event_output() 56 let map = Arc::from_raw(map as *const BpfMap); in raw_perf_event_output() localVariable [all …]
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | irq.rs | 27 map: RwLock<HashMap<Arc<DeviceId>, Arc<dyn VirtIODevice>>>, field 33 map: RwLock::new(HashMap::new()), in new() 48 let mut map = self.map.write_irqsave(); in register_device() localVariable 50 if map.contains_key(device.dev_id()) { in register_device() 54 map.insert(device.dev_id().clone(), device); in register_device() 68 let mut map = self.map.write_irqsave(); in unregister_device() localVariable 69 map.remove(dev_id); in unregister_device() 81 let map = self.map.read_irqsave(); in lookup_device() localVariable 82 map.get(dev_id).cloned() in lookup_device()
|
/DragonOS/kernel/src/bpf/ |
H A D | mod.rs | 2 pub mod map; module 25 bpf_cmd::BPF_MAP_CREATE => map::bpf_map_create(attr), in bpf() 26 bpf_cmd::BPF_MAP_UPDATE_ELEM => map::bpf_map_update_elem(attr), in bpf() 27 bpf_cmd::BPF_MAP_LOOKUP_ELEM => map::bpf_lookup_elem(attr), in bpf() 28 bpf_cmd::BPF_MAP_GET_NEXT_KEY => map::bpf_map_get_next_key(attr), in bpf() 29 bpf_cmd::BPF_MAP_DELETE_ELEM => map::bpf_map_delete_elem(attr), in bpf() 30 bpf_cmd::BPF_MAP_LOOKUP_AND_DELETE_ELEM => map::bpf_map_lookup_and_delete_elem(attr), in bpf() 31 bpf_cmd::BPF_MAP_LOOKUP_BATCH => map::bpf_map_lookup_batch(attr), in bpf() 32 bpf_cmd::BPF_MAP_FREEZE => map::bpf_map_freeze(attr), in bpf()
|
/DragonOS/docs/kernel/trace/ |
H A D | eBPF.md | 125 bpf_cmd::BPF_MAP_CREATE => map::bpf_map_create(attr), 126 bpf_cmd::BPF_MAP_UPDATE_ELEM => map::bpf_map_update_elem(attr), 127 bpf_cmd::BPF_MAP_LOOKUP_ELEM => map::bpf_lookup_elem(attr), 128 bpf_cmd::BPF_MAP_GET_NEXT_KEY => map::bpf_map_get_next_key(attr), 129 bpf_cmd::BPF_MAP_DELETE_ELEM => map::bpf_map_delete_elem(attr), 130 bpf_cmd::BPF_MAP_LOOKUP_AND_DELETE_ELEM => map::bpf_map_lookup_and_delete_elem(attr), 131 bpf_cmd::BPF_MAP_LOOKUP_BATCH => map::bpf_map_lookup_batch(attr), 132 bpf_cmd::BPF_MAP_FREEZE => map::bpf_map_freeze(attr), 164 error!("bpf map type {:?} not implemented", map_meta.map_type); 173 /// Lookup an element in the map. [all …]
|
/DragonOS/kernel/src/bpf/map/ |
H A D | mod.rs | 8 use crate::bpf::map::array_map::{ArrayMap, PerCpuArrayMap, PerfEventArrayMap}; 9 use crate::bpf::map::hash_map::PerCpuHashMap; 10 use crate::bpf::map::util::{BpfMapGetNextKeyArg, BpfMapMeta, BpfMapUpdateArg}; 113 pub fn new(map: Box<dyn BpfMapCommonOps>, meta: BpfMapMeta) -> Self { in new() 116 inner_map: SpinLock::new(map), in new() 195 let map: Box<dyn BpfMapCommonOps> = match map_meta.map_type { in bpf_map_create() localVariable 243 let bpf_map = BpfMap::new(map, map_meta); in bpf_map_create() 246 let fd = fd_table.write().alloc_fd(file, None).map(|x| x as usize)?; in bpf_map_create() 257 let map = get_map_file(arg.map_fd as i32)?; in bpf_map_update_elem() localVariable 258 let meta = &map.meta; in bpf_map_update_elem() [all …]
|
H A D | queue.rs | 2 use crate::bpf::map::util::{BpfMapMeta, BpfMapUpdateElemFlags}; 86 QueueMap::new(attr).map(StackMap) in new() 127 Ok(self.peek().map(|v| v.as_slice())) in lookup_elem() 151 .map(|v| value.copy_from_slice(v)) in peek_elem()
|
H A D | hash_map.rs | 2 use crate::bpf::map::util::{round_up, BpfMapUpdateElemFlags}; 3 use crate::bpf::map::{BpfCallBackFn, BpfMapCommonOps, BpfMapMeta}; 42 let value = self.data.get(key).map(|v| v.as_slice()); in lookup_elem() 73 .map(|v| v.as_slice()) in lookup_and_delete_elem()
|
H A D | lru.rs | 2 use crate::bpf::map::util::BpfMapMeta; 41 let value = self.data.get(key).map(|v| v.as_slice()); in lookup_elem() 71 .map(|v| v.as_slice()) in lookup_and_delete_elem()
|
/DragonOS/user/apps/test_filemap/ |
H A D | main.c | 30 void *map = mmap(NULL, 11, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in main() local 31 if (map == MAP_FAILED) in main() 37 printf("mmap address: %p\n", map); in main() 43 char *fileContent = (char *)map; in main() 50 if (munmap(map, 11) == -1) in main()
|
/DragonOS/kernel/src/driver/tty/virtual_terminal/ |
H A D | console_map.rs | 117 pub map: &'static [u16], field 122 let map = match map_type { in new() localVariable 129 Self { map_type, map } in new() 133 self.map[c as usize] in translate()
|
/DragonOS/kernel/src/arch/riscv64/mm/ |
H A D | mod.rs | 290 let mut map = [0; 16]; localVariable 291 map[VmFlags::VM_NONE.bits()] = MMArch::PAGE_NONE; 292 map[VmFlags::VM_READ.bits()] = MMArch::PAGE_READONLY; 293 map[VmFlags::VM_WRITE.bits()] = MMArch::PAGE_COPY; 294 map[VmFlags::VM_WRITE.bits() | VmFlags::VM_READ.bits()] = MMArch::PAGE_COPY; 295 map[VmFlags::VM_EXEC.bits()] = MMArch::PAGE_READONLY_EXEC; 296 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_READ.bits()] = MMArch::PAGE_READONLY_EXEC; 297 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_WRITE.bits()] = MMArch::PAGE_COPY_EXEC; 298 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_WRITE.bits() | VmFlags::VM_READ.bits()] = 300 map[VmFlags::VM_SHARED.bits()] = MMArch::PAGE_NONE; [all …]
|
/DragonOS/kernel/src/driver/base/map/ |
H A D | mod.rs | 65 if let Some(map) = domain in kobj_map() 72 map.insert( in kobj_map() 86 if let Some(map) = domain in kobj_unmap() 94 if map.get(rm_dev_t).is_some() { in kobj_unmap() 95 map.remove(rm_dev_t); in kobj_unmap() 107 if let Some(map) = domain.0.lock().0.get((dev_t.major().data() % 255) as usize) { in kobj_lookup() 108 match map.get(&dev_t) { in kobj_lookup()
|
/DragonOS/kernel/src/libs/ |
H A D | cpumask.rs | 38 .map(|index| ProcessorId::new(index as u32)) in first() 45 .map(|index| ProcessorId::new(index as u32)) in first_zero() 52 .map(|index| ProcessorId::new(index as u32)) in last() 59 .map(|index| ProcessorId::new(index as u32)) in next_index() 66 .map(|index| ProcessorId::new(index as u32)) in next_zero_index()
|
H A D | rbtree.rs | 495 self.inner.next().map(|(k, _)| k) in next() 540 self.inner.next().map(|(_, v)| v) in next() 588 self.inner.next().map(|(_, v)| v) in next() 1627 let map: RBTree<_, _> = vec.into_iter().collect(); in test_keys() localVariable 1628 let keys: Vec<_> = map.keys().cloned().collect(); in test_keys() 1639 let map: RBTree<_, _> = vec.into_iter().collect(); in test_values() localVariable 1640 let values: Vec<_> = map.values().cloned().collect(); in test_values() 1651 let mut map: RBTree<_, _> = vec.into_iter().collect(); in test_values_mut() localVariable 1652 for value in map.values_mut() { in test_values_mut() 1655 let values: Vec<_> = map.values().cloned().collect(); in test_values_mut() [all …]
|
/DragonOS/kernel/src/arch/x86_64/mm/ |
H A D | mod.rs | 384 let mut map = [unsafe { EntryFlags::from_data(0) }; 16]; localVariable 386 map[VmFlags::VM_NONE.bits()] = EntryFlags::from_data(MMArch::PAGE_NONE); 387 map[VmFlags::VM_READ.bits()] = EntryFlags::from_data(MMArch::PAGE_READONLY); 388 map[VmFlags::VM_WRITE.bits()] = EntryFlags::from_data(MMArch::PAGE_COPY); 389 map[VmFlags::VM_WRITE.bits() | VmFlags::VM_READ.bits()] = 391 map[VmFlags::VM_EXEC.bits()] = EntryFlags::from_data(MMArch::PAGE_READONLY_EXEC); 392 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_READ.bits()] = 394 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_WRITE.bits()] = 396 map[VmFlags::VM_EXEC.bits() | VmFlags::VM_WRITE.bits() | VmFlags::VM_READ.bits()] = 398 map[VmFlags::VM_SHARED.bits()] = EntryFlags::from_data(MMArch::PAGE_NONE); [all …]
|
/DragonOS/user/apps/test_ebpf/syscall_ebpf/syscall_ebpf-ebpf/src/ |
H A D | main.rs | 5 use aya_ebpf::macros::map; 37 #[map] //
|
/DragonOS/kernel/src/driver/base/ |
H A D | mod.rs | 11 pub mod map; module
|
/DragonOS/kernel/src/namespaces/ |
H A D | ucount.rs | 61 .map(|_| AtomicU32::new(0)) in new() 64 .map(|_| AtomicU32::new(0)) in new() 85 .map(|_| AtomicU32::new(0)) in alloc_ucounts() 88 .map(|_| AtomicU32::new(0)) in alloc_ucounts()
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | asm_parser.rs | 59 let sign = optional(one_of("-+".chars())).map(|x| match x { in integer() 65 .map(|x: String| u64::from_str_radix(&x, 16).unwrap() as i64); in integer() 66 let dec = many1(digit()).map(|x: String| x.parse::<i64>().unwrap()); in integer() 67 (sign, attempt(hex).or(dec)).map(|(s, x)| s * x) in integer() 77 .map(|x: String| x.parse::<i64>().unwrap()) in register() 85 let register_operand = register().map(Operand::Register); in operand() 86 let immediate = integer().map(Operand::Integer); in operand() 88 .map(|t| Operand::Memory(t.0, t.1.unwrap_or(0))); in operand() 98 (ident().skip(spaces()), operands, spaces()).map(|t| Instruction { in instruction()
|
/DragonOS/kernel/src/driver/block/cache/ |
H A D | cached_block_device.rs | 336 map: HashMap<BlockId, CacheBlockAddr>, field 342 map: HashMap::new(), in new() 348 self.map.insert(lba_id, caddr)?; in insert() 355 Some(*self.map.get(&lba_id)?) in find() 360 self.map.remove(&lba_id); in remove()
|
/DragonOS/kernel/src/driver/firmware/efi/ |
H A D | memmap.rs | 49 return self.vaddr.map(|v| v + self.size); in map_end_vaddr() 117 let mut vaddr = EarlyIoRemap::map( in do_efi_memmap_init() 122 .map(|(vaddr, _)| vaddr)?; in do_efi_memmap_init()
|
/DragonOS/kernel/crates/rbpf/tests/ |
H A D | disassembler.rs | 19 .map(|ins| ins.desc) 372 .map(|ins| ins.desc) in test_offset_overflow()
|
/DragonOS/kernel/src/debug/kprobe/ |
H A D | mod.rs | 83 .map(|list| list.len()) in break_list_len() 90 .map(|list| list.len()) in debug_list_len() 153 let existed_point = KPROBE_POINT_LIST.lock().get(&address).map(Clone::clone); in register_kprobe()
|
/DragonOS/kernel/src/exception/ |
H A D | irqdomain.rs | 203 let r = domain.ops.map(domain, hwirq, irq); in domain_associate() 517 map: HashMap::new(), in new() 563 self.revmap_read_irqsave().map.len() as u32 in map_count() 581 map: HashMap<HardwareIrqNumber, Arc<IrqData>>, field 588 self.map.insert(hwirq, irq_data); in insert() 593 self.map.remove(&hwirq); in remove() 598 self.map.get(&hwirq).cloned() in lookup() 665 fn map( in map() method
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | mod.rs | 539 .map(|xapic| xapic.version()) in version() 551 .map(|xapic| xapic.support_eoi_broadcast_suppression()) in support_eoi_broadcast_suppression() 563 .map(|xapic| xapic.max_lvt_entry()) in max_lvt_entry() 575 .map(|xapic| xapic.id()) in id() 595 .map(|xapic| xapic.read_lvt(reg)) in read_lvt()
|