/DragonOS/kernel/src/include/bindings/ |
H A D | linux_bpf.rs | 32 pub fn set_bit(&mut self, index: usize, val: bool) { in set_bit() 42 if val { in set_bit() 53 let mut val = 0; in get() localVariable 61 val |= 1 << index; in get() 64 val in get() 67 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { in set() 73 let val_bit_is_set = val & mask == mask; in set() 203 pub fn set_dst_reg(&mut self, val: __u8) { in set_dst_reg() 205 let val: u8 = ::core::mem::transmute(val); in set_dst_reg() localVariable 206 self._bitfield_1.set(0usize, 4u8, val as u64) in set_dst_reg() [all …]
|
/DragonOS/kernel/src/common/ |
H A D | atomic.h | 17 #define atomic_set(atomic, val) (((atomic)->value) = (val)) // 设置原子变量的初始值 argument 30 inline void atomic_add(atomic_t *ato, long val) in atomic_add() argument 34 : "m"(val) in atomic_add() 44 inline void atomic_sub(atomic_t *ato, long val) in atomic_sub() argument 48 : "m"(val) in atomic_sub()
|
H A D | compiler.h | 136 #define WRITE_ONCE(x, val) \ argument 142 } __u = {.val = (val)}; \
|
/DragonOS/kernel/src/libs/futex/ |
H A D | syscall.rs | 18 val: u32, in do_futex() 48 return Futex::futex_wait(uaddr, flags, val, timeout, FUTEX_BITSET_MATCH_ANY); in do_futex() 51 return Futex::futex_wait(uaddr, flags, val, timeout, val3); in do_futex() 54 return Futex::futex_wake(uaddr, flags, val, FUTEX_BITSET_MATCH_ANY); in do_futex() 57 return Futex::futex_wake(uaddr, flags, val, val3); in do_futex() 64 val as i32, in do_futex() 75 val as i32, in do_futex() 86 val as i32, in do_futex()
|
/DragonOS/kernel/src/driver/rtc/ |
H A D | mod.rs | 142 fn from(val: RtcTime) -> Self { in from() 144 val.year_real() as u32, in from() 145 (val.month + 1) as u32, in from() 146 (val.mday) as u32, in from() 147 val.hour as u32, in from() 148 val.minute as u32, in from() 149 val.second as u32, in from()
|
/DragonOS/docs/kernel/core_api/ |
H A D | atomic.md | 11 ### `inline void atomic_add(atomic_t *ato, long val)` 23 **val** 27 ### `inline void atomic_sub(atomic_t *ato, long val)` argument 39 **val**
|
/DragonOS/kernel/src/libs/ |
H A D | volatile.rs | 17 ($data: expr, $val: expr, $flag: expr) => { 21 true => core::ptr::read_volatile(core::ptr::addr_of!($data)) | $val, 22 false => core::ptr::read_volatile(core::ptr::addr_of!($data)) & (!$val), 33 ($data: expr, $bits: expr, $val: expr) => { 35 volatile_set_bit!($data, ($val) & ($bits), true);
|
H A D | int_like.rs | 81 pub fn store(&self, val: $new_type_name, order: ::core::sync::atomic::Ordering) { 82 self.container.store(val.into(), order) 87 val: $new_type_name, 90 $new_type_name::from(self.container.swap(val.into(), order)) 129 val: $new_type_name, 132 $new_type_name::from(self.container.fetch_add(val.into(), order))
|
/DragonOS/kernel/src/time/ |
H A D | mod.rs | 129 fn from(val: PosixTimeSpec) -> Self { in from() 130 Duration::from_micros(val.tv_sec as u64 * 1000000 + val.tv_nsec as u64 / 1000) in from() 474 fn from(val: Duration) -> Self { in from() 475 ::core::time::Duration::from_micros(val.total_micros()) in from() 481 fn from(val: smoltcp::time::Instant) -> Self { in from() 482 Instant::from_micros(val.micros()) in from() 487 fn from(val: Instant) -> Self { in from() 488 smoltcp::time::Instant::from_millis(val.millis()) in from() 494 fn from(val: smoltcp::time::Duration) -> Self { in from() 495 Duration::from_micros(val.micros()) in from() [all …]
|
/DragonOS/kernel/src/driver/firmware/efi/ |
H A D | fdt.rs | 163 let val = if prop.value.len() == 4 { in do_get_fdt_prop() localVariable 171 target.systable = Some(val); in do_get_fdt_prop() 174 target.mmap_base = Some(val); in do_get_fdt_prop() 177 target.mmap_size = Some(val); in do_get_fdt_prop() 180 target.mmap_desc_size = Some(val); in do_get_fdt_prop() 183 target.mmap_desc_version = Some(val); in do_get_fdt_prop()
|
H A D | tables.rs | 61 let val = slice[i]; in report_systable_header() localVariable 63 if (val & 0xff) == 0 { in report_systable_header() 66 tmp_buf[i] = (val & 0xff) as u8; in report_systable_header()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | xapic.rs | 96 fn from(val: XApicOffset) -> Self { in from() 97 val as u32 in from() 221 let val = x86::msr::rdmsr(x86::msr::APIC_BASE); in init_current_cpu() localVariable 222 if val & 0x800 != 0x800 { in init_current_cpu() 227 let val = self.read(XApicOffset::LOCAL_APIC_OFFSET_Local_APIC_SVR); in init_current_cpu() localVariable 229 self.write(XApicOffset::LOCAL_APIC_OFFSET_Local_APIC_SVR, val | ENABLE); in init_current_cpu() 231 let val = self.read(XApicOffset::LOCAL_APIC_OFFSET_Local_APIC_SVR); in init_current_cpu() localVariable 232 if val & ENABLE == 0 { in init_current_cpu() 240 if val & 0x1000 != 0 { in init_current_cpu()
|
H A D | x2apic.rs | 35 let val = if self.support_eoi_broadcast_suppression() { in init_current_cpu() localVariable 41 wrmsr(IA32_X2APIC_SIVR, val); in init_current_cpu()
|
H A D | ioapic.rs | 172 let mut val = unsafe { self.read(REG_TABLE + 2 * rte_index) }; in enable() localVariable 173 val &= !RedirectionEntry::DISABLED.bits(); in enable() 174 unsafe { self.write(REG_TABLE + 2 * rte_index, val) }; in enable() 179 let mut val = unsafe { self.read(reg) }; in disable() localVariable 180 val |= RedirectionEntry::DISABLED.bits(); in disable() 181 unsafe { self.write(reg, val) }; in disable()
|
/DragonOS/kernel/src/filesystem/ |
H A D | eventfd.rs | 135 let mut val = lock_efd.count; in read_at() localVariable 140 val = 1; in read_at() 144 let val_bytes = val.to_ne_bytes(); in read_at() 172 let val = u64::from_ne_bytes(buf[..8].try_into().unwrap()); in write_at() localVariable 173 if val == u64::MAX { in write_at() 178 if u64::MAX - eventfd.count > val { in write_at() 191 eventfd.count += val; in write_at()
|
/DragonOS/kernel/src/arch/riscv64/syscall/ |
H A D | mod.rs | 15 ($val:expr, $regs:expr, $show:expr) => {{ 16 let ret = $val;
|
/DragonOS/kernel/src/sched/ |
H A D | pelt.rs | 120 fn decay_load(mut val: u64, n: u64) -> u64 { in decay_load() 128 val >>= local_n / LOAD_AVG_PERIOD; in decay_load() 132 ((val as i128 * RUNNABLE_AVG_Y_N_INV[local_n as usize] as i128) >> 32) as u64 in decay_load()
|
/DragonOS/kernel/src/arch/x86_64/syscall/ |
H A D | mod.rs | 50 ($val:expr, $regs:expr, $show:expr) => {{ 51 let ret = $val;
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | ipi.rs | 80 fn from(val: ArchIpiTarget) -> Self { in from() 81 if let ArchIpiTarget::Specified(id) = val { in from() 113 fn from(val: ArchIpiTarget) -> Self { in from() 114 match val { in from()
|
/DragonOS/user/apps/test-for-robustfutex/src/ |
H A D | main.rs | 45 pub fn set_val(&self, val: u32, offset: isize) { in set_val() 47 self.addr.offset(offset).write(val); in set_val() 69 pub fn set_val(&self, val: i32, offset: isize) { in set_val() 71 self.addr.offset(offset).write(val); in set_val()
|
/DragonOS/kernel/src/driver/base/device/ |
H A D | dd.rs | 610 let val = dev.state_synced(); in show() localVariable 611 let val = if val { 1 } else { 0 }; in show() localVariable 612 return sysfs_emit_str(buf, format!("{}\n", val).as_str()); in show()
|
/DragonOS/kernel/src/process/ |
H A D | exec.rs | 74 fn from(val: ExecError) -> Self { in from() 75 match val { in from()
|
/DragonOS/kernel/src/arch/x86_64/init/pvh/ |
H A D | param.rs | 177 fn from(val: u32) -> Self { in from() 178 match val { in from()
|
/DragonOS/kernel/src/arch/x86_64/ipc/ |
H A D | signal.rs | 96 fn from(val: Signal) -> Self { in from() 97 val as usize in from() 113 fn from(val: Signal) -> Self { in from() 115 bits: (1 << (val as usize - 1) as u64), in from()
|
/DragonOS/kernel/src/driver/disk/ahci/ |
H A D | hba.rs | 152 let val: u32 = volatile_read!(self.cmd) | HBA_PORT_CMD_FRE | HBA_PORT_CMD_ST; in start() localVariable 153 volatile_write!(self.cmd, val); in start()
|