/DragonOS/kernel/src/bpf/ |
H A D | mod.rs | 14 pub fn sys_bpf(cmd: u32, attr: *mut u8, size: u32) -> Result<usize> { in sys_bpf() 15 let buf = UserBufferReader::new(attr, size as usize, true)?; in sys_bpf() 16 let attr = buf.read_one_from_user::<bpf_attr>(0)?; in sys_bpf() localVariable 18 bpf(cmd, attr) in sys_bpf() 22 pub fn bpf(cmd: bpf_cmd, attr: &bpf_attr) -> Result<usize> { in bpf() 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() [all …]
|
/DragonOS/kernel/src/filesystem/sysfs/ |
H A D | file.rs | 108 attr: &'static dyn Attribute, in create_file() 111 return self.add_file_with_mode(&inode, attr, attr.mode()); in create_file() 118 attr: &'static dyn Attribute, in add_file_with_mode() 139 let sys_support = sysfs_ops.support(attr); in add_file_with_mode() 154 let sys_priv = SysFSKernPrivateData::File(SysKernFilePriv::new(&kobj, Some(attr), None)); in add_file_with_mode() 156 attr.name().to_string(), in add_file_with_mode() 165 self.warn_duplicate(parent, attr.name()); in add_file_with_mode() 181 pub fn remove_file(&self, kobj: &Arc<dyn KObject>, attr: &'static dyn Attribute) { in remove_file() 185 let r = parent.remove(attr.name()); in remove_file() 189 attr.name(), in remove_file() [all …]
|
H A D | mod.rs | 113 attr: &'static dyn Attribute, in is_visible() 115 return Some(attr.mode()); in is_visible() 168 fn support(&self, attr: &dyn Attribute) -> SysFSOpsSupport { in support() 169 return attr.support(); in support() 172 fn support_battr(&self, attr: &Arc<dyn BinAttribute>) -> SysFSOpsSupport { in support_battr() 173 return attr.support(); in support_battr() 179 attr: &dyn Attribute, in show() 186 attr: &dyn Attribute, in store()
|
H A D | group.rs | 175 for attr in group.attrs() { in group_create_files() 176 let mut mode = attr.mode(); in group_create_files() 180 parent.remove(attr.name()).ok(); in group_create_files() 182 if let Some(mt) = group.is_visible(kobj.clone(), *attr) { in group_create_files() 193 name = attr.name(), in group_create_files() 199 e = sysfs_instance().add_file_with_mode(&parent, *attr, mode); in group_create_files()
|
/DragonOS/kernel/src/perf/ |
H A D | util.rs | 50 attr: &perf_event_attr, in try_from() 56 let ty = perf_type_id::from_u32(attr.type_).ok_or(SystemError::EINVAL)?; in try_from() 57 let config = perf_sw_ids::from_u32(attr.config as u32).ok_or(SystemError::EINVAL)?; in try_from() 59 let name_ptr = unsafe { attr.__bindgen_anon_3.config1 } as *const u8; in try_from() 65 let sample_ty = perf_event_sample_format::from_u32(attr.sample_type as u32); in try_from() 69 offset: unsafe { attr.__bindgen_anon_4.config2 }, in try_from() 70 size: attr.size, in try_from()
|
H A D | mod.rs | 246 attr: *const u8, in sys_perf_event_open() 253 attr as *const perf_event_attr, in sys_perf_event_open() 257 let attr = buf.read_one_from_user(0)?; in sys_perf_event_open() localVariable 258 perf_event_open(attr, pid, cpu, group_fd, flags) in sys_perf_event_open() 263 attr: &perf_event_attr, in perf_event_open() 269 let args = PerfProbeArgs::try_from(attr, pid, cpu, group_fd, flags)?; in perf_event_open()
|
/DragonOS/kernel/src/bpf/map/ |
H A D | queue.rs | 43 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 44 if attr.value_size == 0 || attr.max_entries == 0 || attr.key_size != 0 { in new() 47 let data = Vec::with_capacity(attr.max_entries as usize); in new() 49 max_entries: attr.max_entries, in new() 85 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 86 QueueMap::new(attr).map(StackMap) in new()
|
H A D | array_map.rs | 69 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 70 if attr.value_size == 0 || attr.max_entries == 0 || attr.key_size != 4 { in new() 73 let elem_size = round_up(attr.value_size as usize, 8); in new() 74 let data = ArrayMapData::new(elem_size as u32, attr.max_entries); in new() 76 max_entries: attr.max_entries, in new() 177 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 181 let array_map = ArrayMap::new(attr)?; in new() 235 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 237 if attr.key_size != 4 || attr.value_size != 4 || attr.max_entries != num_cpus { in new()
|
H A D | hash_map.rs | 26 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 27 if attr.value_size == 0 || attr.max_entries == 0 { in new() 30 let value_size = round_up(attr.value_size as usize, 8); in new() 32 _max_entries: attr.max_entries, in new() 33 _key_size: attr.key_size, in new() 114 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 118 let array_map = BpfHashMap::new(attr)?; in new()
|
H A D | lru.rs | 26 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 27 if attr.value_size == 0 || attr.max_entries == 0 { in new() 31 _max_entries: attr.max_entries, in new() 33 NonZero::new(attr.max_entries as usize).ok_or(SystemError::EINVAL)?, in new() 111 pub fn new(attr: &BpfMapMeta) -> Result<Self> { in new() 115 let array_map = LruMap::new(attr)?; in new()
|
H A D | mod.rs | 192 pub fn bpf_map_create(attr: &bpf_attr) -> Result<usize> { in bpf_map_create() 193 let map_meta = BpfMapMeta::try_from(attr)?; in bpf_map_create() 254 pub fn bpf_map_update_elem(attr: &bpf_attr) -> Result<usize> { in bpf_map_update_elem() 255 let arg = BpfMapUpdateArg::from(attr); in bpf_map_update_elem() 272 pub fn bpf_map_freeze(attr: &bpf_attr) -> Result<usize> { in bpf_map_freeze() 273 let arg = BpfMapUpdateArg::from(attr); in bpf_map_freeze() 284 pub fn bpf_lookup_elem(attr: &bpf_attr) -> Result<usize> { in bpf_lookup_elem() 285 let arg = BpfMapUpdateArg::from(attr); in bpf_lookup_elem() 313 pub fn bpf_map_get_next_key(attr: &bpf_attr) -> Result<usize> { in bpf_map_get_next_key() 314 let arg = BpfMapGetNextKeyArg::from(attr); in bpf_map_get_next_key() [all …]
|
/DragonOS/kernel/src/bpf/prog/ |
H A D | util.rs | 46 fn from(attr: &bpf_attr) -> Self { in from() 48 let u = &attr.__bindgen_anon_3; in from() 84 fn try_from(attr: &bpf_attr) -> Result<Self, Self::Error> { in try_from() 85 let u = unsafe { &attr.__bindgen_anon_3 }; in try_from()
|
H A D | mod.rs | 113 pub fn bpf_prog_load(attr: &bpf_attr) -> Result<usize> { in bpf_prog_load() 114 let args = BpfProgMeta::try_from(attr)?; in bpf_prog_load() 116 let log_info = BpfProgVerifierInfo::from(attr); in bpf_prog_load()
|
/DragonOS/kernel/src/driver/base/ |
H A D | kobject.rs | 138 fn support(&self, attr: &dyn Attribute) -> SysFSOpsSupport { in support() 139 return attr.support(); in support() 145 attr: &dyn Attribute, in show() 148 let r = attr.show(kobj, buf).map_err(|e| { in show() 162 attr: &dyn Attribute, in store() 165 let r = attr.store(kobj, buf).map_err(|e| { in store()
|
/DragonOS/docs/kernel/trace/ |
H A D | eBPF.md | 122 pub fn bpf(cmd: bpf_cmd, attr: &bpf_attr) -> Result<usize> { 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), 134 bpf_cmd::BPF_PROG_LOAD => prog::bpf_prog_load(attr),
|
/DragonOS/kernel/src/misc/ |
H A D | ksysfs.rs | 60 attr: &'static dyn Attribute, in is_visible() 62 Some(attr.mode()) in is_visible()
|
/DragonOS/kernel/src/driver/pci/ |
H A D | mod.rs | 1 pub mod attr; module
|
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/ |
H A D | mod.rs | 266 attr: &'static dyn Attribute, in is_visible() 268 return Some(attr.mode()); in is_visible() 462 let mut attr = Self::empty(); in get_attr() localVariable 465 attr.insert(Self::UNDERLINE); in get_attr() 468 attr.intersects(Self::REVERSE); in get_attr() 471 attr.insert(Self::BOLD); in get_attr() 474 attr in get_attr()
|
H A D | framebuffer_console.rs | 125 attr: FbConAttr, in bit_put_string() 154 if !attr.is_empty() { in bit_put_string() 155 attr.update_attr(&mut dst, src, vc_data) in bit_put_string() 460 let mut attr = 1; in con_scroll() localVariable 465 if attr != c & 0xff00 { in con_scroll() 467 attr = c & 0xff00; in con_scroll() 627 let attr = FbConAttr::get_attr(data[0], fb_info.color_depth()); in put_string() localVariable 647 self.bit_put_string(vc_data, data, attr, cnt, cellsize, &mut image); in put_string() 675 let attr = FbConAttr::get_attr(c, fb_info.color_depth()); in cursor() localVariable 685 if !attr.is_empty() { in cursor() [all …]
|
/DragonOS/kernel/src/driver/tty/virtual_terminal/ |
H A D | virtual_console.rs | 137 pub attr: u8, field 201 attr: Default::default(), in new() 1536 let mut attr = self.attr; in console_write_normal() localVariable 1566 attr = self.invert_attr(); in console_write_normal() 1591 tc |= ((attr as u32) << 8) & (!himask as u32); in console_write_normal() 1664 let mut attr = self.screen_buf[start] & 0xff00; in do_update_region() localVariable 1670 if attr != (self.screen_buf[start] & 0xff00) && size > 0 { in do_update_region() 1681 attr = self.screen_buf[start] & 0xff00; in do_update_region() 1738 return self.attr ^ 0x08; in invert_attr() 1742 return (self.attr & 0x11) | ((self.attr & 0xe0) >> 4) | ((self.attr & 0x0e) << 4); in invert_attr() [all …]
|
/DragonOS/kernel/src/driver/base/device/ |
H A D | mod.rs | 453 attr: &dyn Attribute, in store() 456 return attr.store(kobj, buf); in store() 462 attr: &dyn Attribute, in show() 465 return attr.show(kobj, buf); in show() 808 attr: &'static dyn Attribute, in create_file() 811 attr.mode().contains(ModeType::S_IRUGO) in create_file() 812 && (!attr.support().contains(SysFSOpsSupport::ATTR_SHOW)), in create_file() 816 attr.name() in create_file() 820 attr.mode().contains(ModeType::S_IWUGO) in create_file() 821 && (!attr.support().contains(SysFSOpsSupport::ATTR_STORE)), in create_file() [all …]
|
H A D | driver.rs | 291 attr: &'static dyn Attribute, in create_attr_file() 294 return sysfs_instance().create_file(&kobj, attr); in create_attr_file() 305 pub fn remove_attr_file(&self, driver: &Arc<dyn Driver>, attr: &'static dyn Attribute) { in remove_attr_file() 307 sysfs_instance().remove_file(&kobj, attr); in remove_attr_file()
|
H A D | bus.rs | 408 attr: &'static dyn Attribute, in create_file() 411 return sysfs_instance().create_file(&bus_kobj, attr); in create_file() 414 fn remove_file(&self, bus: &Arc<dyn Bus>, attr: &'static dyn Attribute) { in remove_file() 416 sysfs_instance().remove_file(&bus_kobj, attr); in remove_file() 724 attr: &dyn Attribute, in show() 727 attr.show(kobj, buf) in show() 734 attr: &dyn Attribute, in store() 737 attr.store(kobj, buf) in store()
|
/DragonOS/kernel/src/driver/acpi/ |
H A D | sysfs.rs | 114 let attr = AttrAcpiTable::new(&header)?; in acpi_tables_sysfs_init() localVariable 115 acpi_table_attr_list().write().push(attr); in acpi_tables_sysfs_init() 168 for attr in acpi_table_attr_list().read().iter() { in new() 169 if attr.name == r.name { in new() 170 r.instance = attr.instance; in new()
|
/DragonOS/kernel/src/driver/base/platform/ |
H A D | subsys.rs | 166 fn is_visible(&self, _kobj: Arc<dyn KObject>, attr: &dyn Attribute) -> Option<ModeType> { in is_visible() 167 return Some(attr.mode()); in is_visible()
|