Home
last modified time | relevance | path

Searched refs:offset (Results 1 – 25 of 81) sorted by relevance

1234

/DragonOS/kernel/src/mm/allocator/
H A Dbump.rs19 offset: usize, field
30 pub fn new(offset: usize) -> Self { in new()
32 offset, in new()
38 pub fn offset(&self) -> usize { in offset() method
39 return self.offset; in offset()
49 let mut offset = self.offset(); in remain_areas() localVariable
69 if offset >= area_end { in remain_areas()
74 if offset < area_base { in remain_areas()
75 offset = area_base; in remain_areas()
76 } else if offset < area_end { in remain_areas()
[all …]
/DragonOS/user/apps/test-for-robustfutex/src/
H A Dmain.rs37 pub fn get_addr(&self, offset: isize) -> *mut u32 { in get_addr()
38 return unsafe { self.addr.offset(offset) }; in get_addr()
41 pub fn get_val(&self, offset: isize) -> u32 { in get_val()
42 return unsafe { self.addr.offset(offset).read() }; in get_val()
45 pub fn set_val(&self, val: u32, offset: isize) { in set_val()
47 self.addr.offset(offset).write(val); in set_val()
65 pub fn get_val(&self, offset: isize) -> i32 { in get_val()
66 return unsafe { self.addr.offset(offset).read() }; in get_val()
69 pub fn set_val(&self, val: i32, offset: isize) { in set_val()
71 self.addr.offset(offset).write(val); in set_val()
[all …]
/DragonOS/kernel/src/syscall/
H A Duser_access.rs189 pub fn read_from_user<T>(&self, offset: usize) -> Result<&[T], SystemError> { in read_from_user()
190 return self.convert_with_offset(self.buffer, offset); in read_from_user()
197 pub fn read_one_from_user<T>(&self, offset: usize) -> Result<&T, SystemError> { in read_one_from_user()
198 return self.convert_one_with_offset(self.buffer, offset); in read_one_from_user()
209 offset: usize, in copy_from_user()
211 let data = self.convert_with_offset(self.buffer, offset)?; in copy_from_user()
224 offset: usize, in copy_one_from_user()
226 let data = self.convert_one_with_offset::<T>(self.buffer, offset)?; in copy_one_from_user()
236 pub fn buffer<T>(&self, offset: usize) -> Result<&[T], SystemError> { in buffer()
237 self.convert_with_offset::<T>(self.buffer, offset) in buffer()
[all …]
/DragonOS/kernel/src/time/
H A Dtimekeeping.rs161 pub fn timekeeping_bigadjust(&self, error: i64, interval: i64, offset: i64) -> (i64, i64, i32) { in timekeeping_bigadjust()
164 let mut offset = offset; in timekeeping_bigadjust() localVariable
174 offset = -offset; in timekeeping_bigadjust()
183 offset <<= adj; in timekeeping_bigadjust()
186 return (interval, offset, mult); in timekeeping_bigadjust()
190 pub fn timekeeping_adjust(&self, offset: i64) -> i64 { in timekeeping_adjust()
193 let mut offset = offset; in timekeeping_adjust() localVariable
206 (interval, offset, adj) = self.timekeeping_bigadjust(error, interval, offset); in timekeeping_adjust()
210 return offset; in timekeeping_adjust()
216 offset = -offset; in timekeeping_adjust()
[all …]
/DragonOS/kernel/src/filesystem/kernfs/
H A Dcallback.rs21 offset: usize, in read()
28 offset: usize, in write()
68 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read()
71 return private_data.callback_read(buf, offset); in callback_read()
76 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write()
79 return private_data.callback_write(buf, offset); in callback_write()
93 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read()
96 return private_data.callback_read(buf, offset); in callback_read()
102 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write()
105 return private_data.callback_write(buf, offset); in callback_write()
/DragonOS/kernel/src/filesystem/vfs/
H A Dfile.rs168 pub fn add_page(&self, offset: usize, page: &Arc<Page>) { in add_page()
170 let mut cursor = guard.cursor_mut(offset as u64); in add_page()
174 pub fn get_page(&self, offset: usize) -> Option<Arc<Page>> { in get_page()
176 let mut cursor = guard.cursor_mut(offset as u64); in get_page()
181 pub fn remove_page(&self, offset: usize) { in remove_page()
183 let mut cursor = guard.cursor_mut(offset as u64); in remove_page()
201 offset: AtomicUsize, field
229 offset: AtomicUsize::new(0), in new()
250 self.offset.load(core::sync::atomic::Ordering::SeqCst), in read()
266 self.offset.load(core::sync::atomic::Ordering::SeqCst), in write()
[all …]
/DragonOS/kernel/src/arch/x86_64/pci/
H A Dpci.rs23 fn read_config_early(bus: u8, slot: u8, func: u8, offset: u8) -> u8 { in read_config_early()
31 | offset as u32, in read_config_early()
34 let value = unsafe { CurrentPortIOArch::in8(PORT_PCI_CONFIG_DATA + (offset & 3) as u16) }; in read_config_early()
40 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32 { in read_config()
45 | (offset & 0xfc) as u32 in read_config()
55 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32) { in write_config()
59 | (offset & 0xfc) as u32 in write_config()
/DragonOS/kernel/src/driver/firmware/efi/
H A Dmemmap.rs61 offset: usize, field
66 Self { inner, offset: 0 } in new()
74 if self.offset + size_of::<Self::Item>() > self.inner.size { in next()
83 let vaddr = self.inner.vaddr? + self.offset; in next()
84 self.offset += size_of::<Self::Item>(); in next()
111 let offset = paddr.data() - page_align_down(paddr.data()); in do_efi_memmap_init() localVariable
112 let map_size = data.mmap_size.unwrap() as usize + offset; in do_efi_memmap_init()
124 vaddr += offset; in do_efi_memmap_init()
/DragonOS/kernel/crates/kprobe/src/arch/
H A Dmod.rs74 offset: usize, field
91 offset: usize, in new()
99 offset, in new()
128 self.symbol_addr + self.offset in probe_addr()
135 offset: usize, field
152 .field("offset", &self.offset) in fmt()
203 offset: value.offset, in from()
/DragonOS/kernel/src/filesystem/sysfs/
H A Dfile.rs60 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read()
65 if offset > 0 { in callback_read()
66 if len <= offset { in callback_read()
69 let len = len - offset; in callback_read()
70 buf.copy_within(offset..offset + len, 0); in callback_read()
77 return bin_attribute.read(kobj, buf, offset); in callback_read()
83 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write()
91 return bin_attribute.write(kobj, buf, offset); in callback_write()
298 offset: usize, in read()
300 return data.callback_read(buf, offset); in read()
[all …]
H A Dmod.rs69 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read()
72 let len = file.callback_read(buf, offset)?; in callback_read()
83 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write()
86 return file.callback_write(buf, offset); in callback_write()
/DragonOS/kernel/src/filesystem/fat/
H A Dentry.rs85 offset: u64, in read()
87 if offset >= self.size() { in read()
92 let start_cluster_number: u64 = offset / fs.bytes_per_cluster(); in read()
102 let bytes_remain: u64 = self.size() - offset; in read()
105 let mut in_cluster_offset: u64 = offset % fs.bytes_per_cluster(); in read()
132 let offset = fs.cluster_bytes_offset(current_cluster) + in_cluster_offset; in read() localVariable
135 .read_at_bytes(&mut buf[start..start + end_len], offset as usize)?; in read()
160 offset: u64, in write()
162 self.ensure_len(fs, offset, buf.len() as u64)?; in write()
165 let start_cluster_num = offset / fs.bytes_per_cluster(); in write()
[all …]
/DragonOS/kernel/src/arch/riscv64/driver/
H A Dof.rs17 let offset = fdt_paddr.data() & crate::arch::MMArch::PAGE_OFFSET_MASK; in map_fdt() localVariable
18 let map_size = page_align_up(fdt_size + offset); in map_fdt()
34 let vaddr = mmio_guard.vaddr() + offset; in map_fdt()
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/
H A Dframebuffer_console.rs136 let mut offset; in bit_put_string() localVariable
158 offset = char_offset * byte_width; in bit_put_string()
162 image.data[offset..offset + byte_width] in bit_put_string()
165 offset += image_line_byte; in bit_put_string()
438 let offset = vc_data.cols * (bottom - count); in con_scroll() localVariable
440 vc_data.screen_buf[offset..(offset + (vc_data.cols * count))].iter_mut() in con_scroll()
459 let mut offset = start; in con_scroll() localVariable
462 while offset < end { in con_scroll()
463 let c = data[offset]; in con_scroll()
469 let count = offset - start; in con_scroll()
[all …]
/DragonOS/kernel/src/driver/tty/tty_ldisc/
H A Dntty.rs183 let mut offset = 0; in receive_buf_common() localVariable
213 self.receive_buf(tty.clone(), &buf[offset..], Some(&flags[offset..]), n); in receive_buf_common()
215 self.receive_buf(tty.clone(), &buf[offset..], flags, n); in receive_buf_common()
219 offset += n; in receive_buf_common()
292 let offset = n; in receive_buf_real_raw() localVariable
297 self.read_buf[head..(head + n)].copy_from_slice(&buf[offset..(offset + n)]); in receive_buf_real_raw()
351 let mut offset = 0; in receive_buf_standard() localVariable
353 if offset >= buf.len() { in receive_buf_standard()
356 let mut c = buf[offset]; in receive_buf_standard()
357 offset += 1; in receive_buf_standard()
[all …]
/DragonOS/kernel/src/libs/
H A Dvec_cursor.rs134 SeekFrom::SeekSet(offset) => offset, in seek()
135 SeekFrom::SeekCurrent(offset) => self.pos as i64 + offset, in seek()
137 SeekFrom::SeekEnd(offset) => self.data.len() as i64 + offset, in seek()
/DragonOS/kernel/src/arch/
H A Dmod.rs24 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32; in read_config()
29 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32); in write_config()
/DragonOS/kernel/src/mm/
H A Dearly_ioremap.rs50 let offset = phys.data() - page_align_down(phys.data()); in map_not_aligned() localVariable
51 size += offset; in map_not_aligned()
52 phys -= offset; in map_not_aligned()
55 return Ok(map_vaddr + offset); in map_not_aligned()
/DragonOS/kernel/src/perf/
H A Dbpf.rs32 offset: usize, field
229 offset: 0, in new()
233 pub fn do_mmap(&self, _start: usize, len: usize, offset: usize) -> Result<()> { in do_mmap()
252 data.offset = offset; in do_mmap()
279 fn mmap(&self, start: usize, len: usize, offset: usize) -> Result<()> { in mmap()
280 self.do_mmap(start, len, offset) in mmap()
/DragonOS/kernel/src/driver/base/block/
H A Dblock_device.rs416 fn write_at_bytes(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError> { in write_at_bytes()
421 let iter = BlockIter::new_multiblock(offset, offset + len, self.blk_size_log2()); in write_at_bytes()
425 let buf_begin = range.origin_begin() - offset; // 本次读操作的起始位置/已经读了这么多字节 in write_at_bytes()
426 let buf_end = range.origin_end() - offset; in write_at_bytes()
451 offset: usize, in read_at_bytes()
459 let iter = BlockIter::new_multiblock(offset, offset + len, self.blk_size_log2()); in read_at_bytes()
464 let buf_begin = range.origin_begin() - offset; // 本次读操作的起始位置/已经读了这么多字节 in read_at_bytes()
465 let buf_end = range.origin_end() - offset; in read_at_bytes()
/DragonOS/kernel/src/debug/kprobe/
H A Dargs.rs14 pub offset: usize, field
53 kprobe_info.offset, in try_from()
H A Dtest.rs47 offset: 0, in kprobe_test()
67 offset: 0, in kprobe_test()
/DragonOS/kernel/crates/rbpf/tests/
H A Dmisc.rs240 let mut data = mbuff.as_ptr().offset(8) as *mut u64; in test_vm_mbuff()
241 let mut data_end = mbuff.as_ptr().offset(24) as *mut u64; in test_vm_mbuff()
274 let mut data = mbuff.as_ptr().offset(8) as *mut u64; in test_vm_mbuff_with_rust_api()
275 let mut data_end = mbuff.as_ptr().offset(24) as *mut u64; in test_vm_mbuff_with_rust_api()
298 let mut data = mbuff.as_ptr().offset(8) as *mut u64; in test_jit_mbuff()
299 let mut data_end = mbuff.as_ptr().offset(24) as *mut u64; in test_jit_mbuff()
/DragonOS/kernel/src/driver/virtio/
H A Dtransport_pci.rs156 (capability.offset + CAP_BAR_OFFSET).into(), in new()
158 offset: pci_root_0().read_config( in new()
160 (capability.offset + CAP_BAR_OFFSET_OFFSET).into(), in new()
164 (capability.offset + CAP_LENGTH_OFFSET).into(), in new()
176 (capability.offset + CAP_NOTIFY_OFF_MULTIPLIER_OFFSET).into(), in new()
426 offset: u32, field
526 if struct_info.offset + struct_info.length > bar_size in get_bar_region()
535 + struct_info.offset as usize; in get_bar_region()
/DragonOS/kernel/src/namespaces/
H A Dmod.rs88 let offset = field_ptr - dummy_ptr as usize; localVariable
89 Arc::from_raw(($ptr as *const u8).wrapping_sub(offset) as *mut $struct)

1234