Home
last modified time | relevance | path

Searched refs:value (Results 1 – 25 of 98) sorted by relevance

1234

/DragonOS/kernel/src/common/
H A Datomic.h16 #define atomic_read(atomic) ((atomic)->value) // 读取原子变量
17 #define atomic_set(atomic, val) (((atomic)->value) = (val)) // 设置原子变量的初始值
21 volatile long value; member
33 : "=m"(ato->value) in atomic_add()
47 : "=m"(ato->value) in atomic_sub()
60 : "=m"(ato->value) in atomic_inc()
61 : "m"(ato->value) in atomic_inc()
73 : "=m"(ato->value) in atomic_dec()
74 : "m"(ato->value) in atomic_dec()
86 : "=m"(ato->value) in atomic_set_mask()
[all …]
H A Dhid.h101 int value; // hid对象的值 member
132 uint32_t value; // 暂存当前的值 member
153 int value; member
159 int value; member
/DragonOS/kernel/src/bpf/helper/
H A Dmod.rs26 let value = map_lookup_elem(&map, key); in raw_map_lookup_elem() localVariable
30 match value { in raw_map_lookup_elem()
31 Ok(Some(value)) => value as *const c_void, in raw_map_lookup_elem()
38 let value = binding.lookup_elem(key); in map_lookup_elem() localVariable
39 match value { in map_lookup_elem()
40 Ok(Some(value)) => Ok(Some(value.as_ptr())), in map_lookup_elem()
121 value: *const c_void, in raw_map_update_elem()
129 let value = core::slice::from_raw_parts(value as *const u8, value_size); in raw_map_update_elem() localVariable
130 let res = map_update_elem(&map, key, value, flags); in raw_map_update_elem()
138 pub fn map_update_elem(map: &Arc<BpfMap>, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in map_update_elem()
[all …]
/DragonOS/kernel/src/libs/
H A Dvolatile.rs8 ($data: expr, $value: expr) => {
9 unsafe { core::ptr::write_volatile(core::ptr::addr_of_mut!($data), $value) }
75 pub fn new(value: T) -> Self { in new()
76 Self(value) in new()
93 pub fn new(value: T) -> Self { in new()
94 Self(value) in new()
119 unsafe fn vwrite(self, value: T); in vwrite()
123 unsafe fn vwrite(self, value: T) { in vwrite()
124 (self as *mut T).write_volatile(value) in vwrite()
129 unsafe fn vwrite(self, value: T) { in vwrite()
[all …]
H A Dlazy_init.rs32 value: UnsafeCell<MaybeUninit<T>>, field
42 value: UnsafeCell::new(MaybeUninit::uninit()), in new()
68 pub fn init(&self, value: T) { in init()
79 (*self.value.get()).as_mut_ptr().write(value); in init()
111 return &*(*self.value.get()).as_ptr(); in get_unchecked()
116 return &mut *(*self.value.get()).as_mut_ptr(); in get_mut_unchecked()
138 if let Some(value) = self.try_get() { in fmt()
139 return write!(f, "Lazy({:?})", value); in fmt()
150 (*self.value.get()).as_mut_ptr().drop_in_place(); in drop()
H A Dvec_cursor.rs151 pub fn write_u8(&mut self, value: u8) -> Result<u8, SystemError> { in write_u8()
156 self.data[self.pos] = value; in write_u8()
159 return Ok(value); in write_u8()
163 pub fn write_u16(&mut self, value: u16) -> Result<u16, SystemError> { in write_u16()
168 self.data[self.pos] = (value & 0xff) as u8; in write_u16()
170 self.data[self.pos] = ((value >> 8) & 0xff) as u8; in write_u16()
173 return Ok(value); in write_u16()
177 pub fn write_u32(&mut self, value: u32) -> Result<u32, SystemError> { in write_u32()
183 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
187 return Ok(value); in write_u32()
[all …]
/DragonOS/kernel/src/bpf/map/
H A Dqueue.rs20 fn push(&mut self, value: BpfQueueValue, flags: BpfMapUpdateElemFlags) -> Result<()>; in push()
56 fn push(&mut self, value: BpfQueueValue, flags: BpfMapUpdateElemFlags) -> Result<()> { in push()
65 self.data.push(value); in push()
104 fn push(&mut self, value: BpfQueueValue, flags: BpfMapUpdateElemFlags) -> Result<()> { in push()
113 self.data.push(value); in push()
130 fn update_elem(&mut self, _key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem()
132 self.push(value.to_vec(), flag) in update_elem()
135 fn lookup_and_delete_elem(&mut self, _key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem()
137 value.copy_from_slice(&v); in lookup_and_delete_elem()
143 fn push_elem(&mut self, value: &[u8], flags: u64) -> Result<()> { in push_elem()
[all …]
H A Dutil.rs19 fn try_from(value: &bpf_attr) -> Result<Self, Self::Error> { in try_from()
20 let u = unsafe { &value.__bindgen_anon_1 }; in try_from()
45 pub value: u64, field
50 fn from(value: &bpf_attr) -> Self { in from()
52 let u = &value.__bindgen_anon_2; in from()
56 value: u.__bindgen_anon_1.value, in from()
70 fn from(value: &bpf_attr) -> Self { in from()
72 let u = &value.__bindgen_anon_2; in from()
H A Dlru.rs41 let value = self.data.get(key).map(|v| v.as_slice()); in lookup_elem() localVariable
42 Ok(value) in lookup_elem()
44 fn update_elem(&mut self, key: &[u8], value: &[u8], _flags: u64) -> Result<()> { in update_elem()
45 self.data.put(key.to_vec(), value.to_vec()); in update_elem()
57 for (key, value) in self.data.iter() { in for_each_elem()
58 let res = cb(key, value, ctx); in for_each_elem()
67 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem()
73 value.copy_from_slice(v); in lookup_and_delete_elem()
127 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem()
128 self.per_cpu_maps.get_mut().update_elem(key, value, flags) in update_elem()
[all …]
H A Dhash_map.rs42 let value = self.data.get(key).map(|v| v.as_slice()); in lookup_elem() localVariable
43 Ok(value) in lookup_elem()
45 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem()
47 self.data.insert(key.to_vec(), value.to_vec()); in update_elem()
59 for (key, value) in self.data.iter() { in for_each_elem()
60 let res = cb(key, value, ctx); in for_each_elem()
69 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem()
75 value.copy_from_slice(v); in lookup_and_delete_elem()
129 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem()
130 self.per_cpu_maps.get_mut().update_elem(key, value, flags) in update_elem()
[all …]
H A Darray_map.rs94 fn update_elem(&mut self, key: &[u8], value: &[u8], _flags: u64) -> Result<()> { in update_elem()
102 if value.len() > self.data.elem_size as usize { in update_elem()
106 old_value[..value.len()].copy_from_slice(value); in update_elem()
120 let value = self.data.index(i); in for_each_elem() localVariable
122 let res = cb(&key, value, ctx); in for_each_elem()
193 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem()
194 self.per_cpu_data.get_mut().update_elem(key, value, flags) in update_elem()
248 let value = self.fds.index(cpu_id); in lookup_elem() localVariable
249 Ok(Some(value)) in lookup_elem()
251 fn update_elem(&mut self, key: &[u8], value: &[u8], _flags: u64) -> Result<()> { in update_elem()
[all …]
/DragonOS/kernel/src/init/
H A Dcmdline.rs77 value: [0; KernelCmdlineEarlyKV::VALUE_MAX_LEN], in build_early_kv()
91 value: self.default_bool, in build()
98 value: None, in build()
127 KernelCmdlineParameter::Arg(v) => Some(v.value()), in value_bool()
137 .value in value_str()
171 value: bool, field
179 pub fn value(&self) -> bool { in value() method
180 volatile_read!(self.value) in value()
186 value: Option<CString>, field
194 value: [u8; Self::VALUE_MAX_LEN], field
[all …]
/DragonOS/docs/kernel/locking/
H A Drwlock.md133 let value = *guard;
137 "Reader1: the value is {value}
144 let value = *guard;
148 "Reader2: the value is {value}
159 "Writers: the value is {guard}
164 let value=*read_guard;
165 println!("After downgraded to read_guard: {value}");
170 let value = *guard;
174 "Upgrader1 before upgrade: the value is {value}
182 "Upgrader1 after upgrade: the value is {temp}
[all …]
/DragonOS/kernel/crates/kprobe/src/arch/
H A Dmod.rs198 fn from(value: KprobeBuilder) -> Self { in from()
199 let fault_handler = value.fault_handler.unwrap_or(ProbeHandler::new(|_| {})); in from()
201 symbol: value.symbol, in from()
202 symbol_addr: value.symbol_addr, in from()
203 offset: value.offset, in from()
204 pre_handler: value.pre_handler, in from()
205 post_handler: value.post_handler, in from()
206 event_callback: value.event_callback, in from()
208 enable: value.enable, in from()
/DragonOS/kernel/src/filesystem/fat/
H A Dutils.rs9 pub(super) fn decode_u8_ascii(value: u8) -> char { in decode_u8_ascii()
10 if value <= 0x7f { in decode_u8_ascii()
11 return value as char; in decode_u8_ascii()
/DragonOS/kernel/src/net/
H A Dmod.rs105 fn from(value: smoltcp::wire::IpProtocol) -> Self { in from()
106 let x: u8 = value.into(); in from()
112 fn from(value: u8) -> Self { in from()
113 match value { in from()
124 _ => Protocol::Unknown(value), in from()
130 fn from(value: Protocol) -> Self { in from()
131 match value { in from()
/DragonOS/kernel/src/arch/x86_64/include/asm/
H A Dasm.h231 void io_out8(unsigned short port, unsigned char value) in io_out8() argument
236 : "a"(value), "d"(port) in io_out8()
241 void io_out32(unsigned short port, unsigned int value) in io_out32() argument
246 : "a"(value), "d"(port) in io_out32()
333 static __always_inline void __write8b(uint64_t vaddr, uint64_t value) in __write8b() argument
335 asm volatile("movq %%rdx, 0(%%rax)" ::"a"(vaddr), "d"(value) in __write8b()
346 static __always_inline void __write4b(uint64_t vaddr, uint32_t value) in __write4b() argument
348 asm volatile("movl %%edx, 0(%%rax)" ::"a"(vaddr), "d"(value) in __write4b()
/DragonOS/kernel/src/driver/firmware/efi/
H A Dfdt.rs65 fn from(value: FdtPropType) -> Self { in from()
66 match value { in from()
79 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from()
80 match value { in try_from()
163 let val = if prop.value.len() == 4 { in do_get_fdt_prop()
164 u32::from_be_bytes(prop.value[0..4].try_into().unwrap()) as u64 in do_get_fdt_prop()
166 u64::from_be_bytes(prop.value[0..8].try_into().unwrap()) in do_get_fdt_prop()
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/
H A Dvmx_asm_wrapper.rs27 pub fn vmx_vmwrite(vmcs_field: u32, value: u64) -> Result<(), SystemError> { in vmx_vmwrite()
28 match unsafe { x86::bits64::vmx::vmwrite(vmcs_field, value) } { in vmx_vmwrite()
41 Ok(value) => Ok(value), in vmx_vmread()
/DragonOS/kernel/src/driver/timers/hpet/
H A Dmod.rs45 pub unsafe fn write_main_counter_value(&mut self, value: u64) { in write_main_counter_value()
47 volwrite!(p, main_counter_value, value); in write_main_counter_value()
56 pub unsafe fn write_general_config(&mut self, value: u64) { in write_general_config()
58 volwrite!(p, general_config, value); in write_general_config()
/DragonOS/kernel/src/process/
H A Dresource.rs66 fn try_from(value: i32) -> Result<Self, Self::Error> { in try_from()
67 match value { in try_from()
135 fn try_from(value: usize) -> Result<Self, Self::Error> { in try_from()
136 <Self as FromPrimitive>::from_usize(value).ok_or(SystemError::EINVAL) in try_from()
/DragonOS/kernel/crates/bitmap/src/
H A Dtraits.rs8 fn set(bits: &mut Self, index: usize, value: bool) -> bool; in set()
9 fn set_value(bits: &mut Self, value: Self); in set_value()
38 fn set(bits: &mut Self, index: usize, value: bool) -> bool {
41 if value {
50 fn set_value(bits: &mut Self, value: Self) {
51 *bits = value;
233 fn set(&mut self, index: usize, value: bool) -> Option<bool>; in set()
236 fn set_all(&mut self, value: bool); in set_all()
/DragonOS/kernel/src/arch/riscv64/include/asm/
H A Dasm.h41 void io_out8(unsigned short port, unsigned char value) { in io_out8() argument
47 void io_out32(unsigned short port, unsigned int value) { in io_out32() argument
/DragonOS/kernel/src/smp/cpu/
H A Dmod.rs115 pub unsafe fn set_possible_cpu(&self, cpu: ProcessorId, value: bool) { in set_possible_cpu()
119 if let Some(prev) = p.possible_cpus.set(cpu, value) { in set_possible_cpu()
120 if prev != value { in set_possible_cpu()
121 if value { in set_possible_cpu()
145 pub unsafe fn set_present_cpu(&self, cpu: ProcessorId, value: bool) { in set_present_cpu()
149 if let Some(prev) = p.present_cpus.set(cpu, value) { in set_present_cpu()
150 if prev != value { in set_present_cpu()
151 if value { in set_present_cpu()
/DragonOS/user/apps/user-manage/src/parser/
H A Dparser.rs59 let value = args[idx].clone(); in parse() localVariable
60 options.insert(option, value); in parse()
123 let value = args[idx].clone(); in parse() localVariable
124 options.insert(option, value); in parse()

1234