Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 69) sorted by relevance

123

/DragonOS/kernel/src/mm/
H A Dno_init.rs110 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate()
111 assert!(count.data() == 1); in allocate()
114 return Some((paddr, count)); in allocate()
117 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount) { in free()
118 assert_eq!(count.data(), 1); in free()
143 pub unsafe fn pseudo_map_phys(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys()
146 pseudo_map_phys_with_flags(vaddr, paddr, count, flags); in pseudo_map_phys()
152 pub unsafe fn pseudo_map_phys_ro(vaddr: VirtAddr, paddr: PhysAddr, count: PageFrameCount) { in pseudo_map_phys_ro()
155 pseudo_map_phys_with_flags(vaddr, paddr, count, flags); in pseudo_map_phys_ro()
162 count: PageFrameCount, in pseudo_map_phys_with_flags()
[all …]
H A Dearly_ioremap.rs179 let count = PageFrameCount::from_bytes(slot_guard[idx].size as usize).unwrap(); in unmap() localVariable
182 unsafe { pseudo_unmap_phys(vaddr, count) }; in unmap()
184 for i in 0..count.data() { in unmap()
/DragonOS/kernel/src/filesystem/
H A Deventfd.rs39 count: u64, field
46 pub fn new(count: u64, flags: EventFdFlags, id: u32) -> Self { in new()
47 EventFd { count, flags, id } in new()
82 let count = self.eventfd.lock().count; in readable() localVariable
83 return count > 0; in readable()
121 while lock_efd.count == 0 { in read_at()
135 let mut val = lock_efd.count; in read_at()
139 eventfd.count -= 1; in read_at()
142 eventfd.count = 0; in read_at()
178 if u64::MAX - eventfd.count > val { in write_at()
[all …]
/DragonOS/kernel/src/mm/allocator/
H A Dpage_frame.rs177 pub const fn new(count: usize) -> Self { in new()
178 return Self(count); in new()
311 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)>; in allocate()
314 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount); in free()
329 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate()
330 return T::allocate(self, count); in allocate()
332 unsafe fn free(&mut self, address: PhysAddr, count: PageFrameCount) { in free()
333 return T::free(self, address, count); in free()
349 pub unsafe fn allocate_page_frames(count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate_page_frames()
350 let frame = unsafe { LockedFrameAllocator.allocate(count)? }; in allocate_page_frames()
[all …]
H A Dbump.rs102 unsafe fn ensure_early_mapping(&self, start_paddr: PhysAddr, count: PageFrameCount) { in ensure_early_mapping()
109 PhysPageFrame::new(start_paddr + count.bytes()), in ensure_early_mapping()
132 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate()
159 if offset + count.data() * MMA::PAGE_SIZE <= area_end { in allocate()
162 self.offset = offset + count.data() * MMA::PAGE_SIZE; in allocate()
164 let r = (PhysAddr(res_page_phys), count); in allocate()
H A Dbuddy.rs352 fn buddy_alloc(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in buddy_alloc()
353 assert!(count.data().is_power_of_two()); in buddy_alloc()
355 let mut order = log2(count.data()); in buddy_alloc()
356 if count.data() & ((1 << order) - 1) != 0 { in buddy_alloc()
579 unsafe fn allocate(&mut self, count: PageFrameCount) -> Option<(PhysAddr, PageFrameCount)> { in allocate()
580 return self.buddy_alloc(count); in allocate()
593 unsafe fn free(&mut self, base: PhysAddr, count: PageFrameCount) { in free()
595 if unlikely(!count.data().is_power_of_two()) { in free()
598 let mut order = log2(count.data()); in free()
599 if count.data() & ((1 << order) - 1) != 0 { in free()
H A Dkernel_allocator.rs34 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in alloc_in_buddy() localVariable
35 let page_frame_count = PageFrameCount::new(count); in alloc_in_buddy()
56 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in free_in_buddy() localVariable
57 let page_frame_count = PageFrameCount::new(count); in free_in_buddy()
/DragonOS/user/apps/test_signal/
H A Dmain.c26 int count = 0; variable
31 count++; in handler()
49 if (count > 0) in main()
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/
H A Dframebuffer_console.rs205 vc_data.font.count = font.char_count; in con_init()
213 if vc_data.font.count == 256 { in con_init()
305 count: usize, in con_putcs()
309 if count == 0 { in con_putcs()
317 count as u32, in con_putcs()
405 mut count: usize, in con_scroll()
416 if count > vc_data.rows { in con_scroll()
417 count = vc_data.rows; in con_scroll()
424 vc_data.screen_buf[start..end].rotate_left(count * vc_data.cols); in con_scroll()
430 top as i32 - count as i32, in con_scroll()
[all …]
/DragonOS/kernel/src/driver/base/block/
H A Dblock_device.rs309 count: usize, in read_at_sync()
323 count: usize, in write_at_sync()
356 count: usize, in read_at()
359 self.cache_read(lba_id_start, count, buf) in read_at()
367 count: usize, in write_at()
370 self.cache_write(lba_id_start, count, buf) in write_at()
378 count: usize, in cache_read()
381 let cache_response = BlockCache::read(lba_id_start, count, buf); in cache_read()
386 let ans = self.read_at_sync(lba_id_start, count, buf)?; in cache_read()
390 let ans = self.read_at_sync(lba_id_start, count, buf)?; in cache_read()
[all …]
/DragonOS/user/apps/test-blockcache/src/
H A Dmain.rs12 let mut count = 0; in main() localVariable
14 count += 1; in main()
17 if count > 10000 { in main()
/DragonOS/kernel/src/driver/block/cache/
H A Dcache_iter.rs44 count: usize, field
52 pub fn new(lba_id_start: BlockId, count: usize, block_size: usize) -> Self { in new()
55 count, in new()
66 if self.current < self.count { in next()
H A Dcached_block_device.rs63 count: usize, in read()
67 let block_iter = BlockIter::new(lba_id_start, count, BLOCK_SIZE); in read()
71 assert!(cache_block_addr.len() == block_iter.count()); in read()
76 return Ok(count); in read()
145 let count = f_data_vec.len(); in insert() localVariable
153 Ok(count) in insert()
183 count: usize, in immediate_write()
187 let block_iter = BlockIter::new(lba_id_start, count, BLOCK_SIZE); in immediate_write()
191 Ok(count) in immediate_write()
/DragonOS/kernel/src/driver/disk/ahci/
H A Dahcidisk.rs73 count: usize, // 读取lba的数量 in read_at()
78 let check_length = ((count - 1) >> 4) + 1; // prdt length in read_at()
79 if count * 512 > buf.len() || check_length > 8_usize { in read_at()
83 } else if count == 0 { in read_at()
138 let mut tmp_count = count; in read_at()
185 volatile_write!(cmdfis.countl, (count & 0xFF) as u8); in read_at()
186 volatile_write!(cmdfis.counth, ((count >> 8) & 0xFF) as u8); in read_at()
223 return Ok(count * 512); in read_at()
229 count: usize, in write_at()
234 let check_length = ((count - 1) >> 4) + 1; // prdt length in write_at()
[all …]
/DragonOS/kernel/src/syscall/
H A Dmisc.rs76 let mut count = 0; in get_random() localVariable
77 while count < len { in get_random()
79 let remain_len = len - count; in get_random()
84 count += 1; in get_random()
/DragonOS/kernel/src/driver/tty/
H A Dtty_port.rs81 fn receive_buf(&self, buf: &[u8], _flags: &[u8], count: usize) -> Result<usize, SystemError> { in receive_buf()
86 let ret = ld.receive_buf2(tty.clone(), buf, None, count); in receive_buf()
88 return ld.receive_buf(tty, buf, None, count); in receive_buf()
/DragonOS/user/apps/test-for-robustfutex/src/
H A Dmain.rs326 let count = unsafe { in test02() localVariable
336 if count == MAP_FAILED as *mut i32 { in test02()
351 count.offset(0).write(1); in test02()
352 count.offset(1).write(0); in test02()
353 println!("count1 val: {:?}", count.offset(0).read()); in test02()
354 println!("count2 val: {:?}", count.offset(1).read()); in test02()
358 let locks = Lock::new(count); in test02()
/DragonOS/kernel/src/driver/base/char/
H A Dmod.rs95 count: u32, in register_chardev_region()
98 Self::__register_chardev_region(from, count, name) in register_chardev_region()
109 count: u32, in alloc_chardev_region()
114 count, in alloc_chardev_region()
/DragonOS/kernel/src/libs/futex/
H A Dfutex.rs70 .count() in contains()
97 let mut count = 0; in wake_up() localVariable
117 count += 1; in wake_up()
118 if count >= nr_wake { in wake_up()
130 Ok(count as usize) in wake_up()
374 let count = bucket_mut.wake_up(key.clone(), Some(bitset), nr_wake)?; in futex_wake() localVariable
380 Ok(count) in futex_wake()
830 count: isize, field
838 count: 0, in new()
843 return self.count < 0; in is_end()
[all …]
/DragonOS/kernel/src/driver/tty/virtual_terminal/
H A Dvirtual_console.rs611 let count = nr * self.cols; in scroll() localVariable
613 for i in self.screen_buf[0..count].iter_mut() { in scroll()
616 self.screen_buf.rotate_left(count); in scroll()
1149 let count; in csi_J() localVariable
1155 count = self.screen_buf.len() - self.pos; in csi_J()
1160 count = self.pos; in csi_J()
1165 count = self.screen_buf.len(); in csi_J()
1171 count = self.screen_buf.len(); in csi_J()
1179 for i in self.screen_buf[start..(start + count)].iter_mut() { in csi_J()
1184 self.do_update_region(start, count) in csi_J()
[all …]
/DragonOS/user/apps/test_bind/
H A Dmain.c145 int count = 0; in test_all_ports() local
163 count++; in test_all_ports()
166 printf("count: %d\n", count); in test_all_ports()
/DragonOS/kernel/src/driver/net/
H A Ddma.rs25 let (paddr, count) = allocate_page_frames(page_num).expect("e1000e: alloc page failed"); in dma_alloc()
28 core::ptr::write_bytes(virt.data() as *mut u8, 0, count.data() * MMArch::PAGE_SIZE); in dma_alloc()
/DragonOS/kernel/src/namespaces/
H A Ducount.rs44 count: AtomicU32, field
59 count: AtomicU32::new(1), in new()
76 self.count in alloc_ucounts()
83 count: AtomicU32::new(1), in alloc_ucounts()
/DragonOS/kernel/src/driver/tty/tty_ldisc/
H A Dntty.rs176 mut count: usize, in receive_buf_common()
206 n = count.min(room); in receive_buf_common()
221 count -= n; in receive_buf_common()
240 count: usize, in receive_buf()
247 let look_ahead = self.lookahead_count.min(count); in receive_buf()
249 self.receive_buf_real_raw(buf, count); in receive_buf()
251 self.receive_buf_raw(buf, flags, count); in receive_buf()
259 if count > look_ahead { in receive_buf()
260 self.receive_buf_standard(tty.clone(), buf, flags, count - look_ahead, false); in receive_buf()
284 fn receive_buf_real_raw(&mut self, buf: &[u8], mut count: usize) { in receive_buf_real_raw()
[all …]
/DragonOS/kernel/src/driver/acpi/
H A Dsysfs.rs262 let mut count = buf.len(); in read() localVariable
263 if count > from.len() - offset { in read()
264 count = from.len() - offset; in read()
266 buf[0..count].copy_from_slice(&from[offset..offset + count]); in read()
267 return Ok(count); in read()

123