/DragonOS/user/apps/user-manage/src/parser/ |
H A D | parser.rs | 21 let mut idx = 0; in parse() localVariable 23 if idx >= args.len() { in parse() 26 let option: CmdOption = args[idx].clone().into(); in parse() 30 if idx + 1 < args.len() { in parse() 33 format!("Invalid arg {} of option: {}", args[idx + 1], op), in parse() 40 if idx + 1 >= args.len() || idx + 2 >= args.len() || args[idx + 1] != "-G" { in parse() 46 idx += 2; in parse() 47 let groups = &args[idx]; in parse() 51 if idx + 1 >= args.len() { in parse() 58 idx += 1; in parse() [all …]
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | pages.rs | 18 fn is_allocated(&self, idx: usize) -> bool; in is_allocated() 19 fn set_bit(&self, idx: usize); in set_bit() 20 fn clear_bit(&self, idx: usize); in clear_bit() 46 for idx in 0..relevant_bits { in initialize() 47 self.clear_bit(idx); in initialize() 72 let idx: usize = base_idx * 64 + first_free; in first_fit() localVariable 73 let offset = idx * layout.size(); in first_fit() 86 return Some((idx, addr)); in first_fit() 95 fn is_allocated(&self, idx: usize) -> bool { in is_allocated() 96 let base_idx = idx / 64; in is_allocated() [all …]
|
H A D | zone.rs | 161 Slab::Base(idx) => self.small_slabs[idx].allocate(layout), in allocate() 180 Slab::Base(idx) => self.small_slabs[idx].deallocate(ptr, layout, slab_callback), in deallocate() 195 Slab::Base(idx) => { in refill() 196 self.small_slabs[idx].refill(new_page); in refill()
|
/DragonOS/kernel/src/mm/ |
H A D | early_ioremap.rs | 158 let mut idx = None; in unmap() localVariable 169 idx = Some(slot_idx); in unmap() 176 let idx = idx.ok_or(SystemError::EINVAL)?; in unmap() localVariable 178 let vaddr = Self::idx_to_virt(idx); in unmap() 179 let count = PageFrameCount::from_bytes(slot_guard[idx].size as usize).unwrap(); in unmap() 185 let slot_idx = idx + i; in unmap() 194 fn idx_to_virt(idx: usize) -> VirtAddr { in idx_to_virt() 195 MMArch::FIXMAP_START_VADDR + idx * MMArch::PAGE_SIZE in idx_to_virt()
|
H A D | memblock.rs | 280 let mut idx = 0; in isolate_range() localVariable 289 while idx < inner.initial_memory_regions_num { in isolate_range() 290 let range_base = inner.initial_memory_regions[idx].base; in isolate_range() 291 let range_end = range_base + inner.initial_memory_regions[idx].size; in isolate_range() 297 idx = idx.checked_add(1).unwrap_or(0); in isolate_range() 303 inner.initial_memory_regions[idx].base = base; in isolate_range() 304 inner.initial_memory_regions[idx].size -= base - range_base; in isolate_range() 307 idx, in isolate_range() 310 inner.initial_memory_regions[idx].flags, in isolate_range() 314 inner.initial_memory_regions[idx].base = end; in isolate_range() [all …]
|
/DragonOS/kernel/src/driver/scsi/ |
H A D | mod.rs | 54 let idx = inner.id_bmp.first_false_index()?; in alloc_id() localVariable 55 inner.id_bmp.set(idx, true); in alloc_id() 56 let name = Self::format_name(idx); in alloc_id() 57 inner.devname[idx] = Some(name.clone()); in alloc_id()
|
/DragonOS/kernel/src/driver/base/block/ |
H A D | manager.rs | 122 let idx = gendisk.idx(); in register_gendisk() localVariable 129 meta_inner.gendisks.insert(idx, gendisk.clone()); in register_gendisk() 131 meta_inner.gendisks.remove(&idx); in register_gendisk() 167 for idx in meta.gendisks.keys() { in print_gendisks() 168 if idx == &GenDisk::ENTIRE_DISK_IDX { in print_gendisks() 171 disks.push(format!("/dev/{}{}", dev.dev_name(), idx)); in print_gendisks()
|
H A D | gendisk.rs | 17 idx: Option<u32>, field 27 idx: Option<u32>, in new() 35 idx, in new() 133 pub fn idx(&self) -> u32 { in idx() method 134 self.idx.unwrap_or(Self::ENTIRE_DISK_IDX) in idx()
|
/DragonOS/kernel/src/driver/tty/virtual_terminal/ |
H A D | virtual_console.rs | 292 for (idx, color) in self.palette.iter_mut().enumerate() { in reset_palette() 293 color.red = DEFAULT_RED[idx]; in reset_palette() 294 color.green = DEFAULT_GREEN[idx]; in reset_palette() 295 color.blue = DEFAULT_BLUE[idx]; in reset_palette() 1066 let (idx, color) = self.t416_color(i); in csi_m() 1067 i = idx; in csi_m() 1098 let (idx, color) = self.t416_color(i); in csi_m() 1099 i = idx; in csi_m() 1233 fn t416_color(&mut self, mut idx: usize) -> (usize, Option<Color>) { in t416_color() 1234 idx += 1; in t416_color() [all …]
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | mod.rs | 41 Some(idx) => vm_list.remove(idx), in remove_vm()
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | ebpf.rs | 554 pub fn get_insn(prog: &[u8], idx: usize) -> Insn { in get_insn() 558 if (idx + 1) * INSN_SIZE > prog.len() { in get_insn() 561 idx, in get_insn() 566 opc: prog[INSN_SIZE * idx], in get_insn() 567 dst: prog[INSN_SIZE * idx + 1] & 0x0f, in get_insn() 568 src: (prog[INSN_SIZE * idx + 1] & 0xf0) >> 4, in get_insn() 569 off: LittleEndian::read_i16(&prog[(INSN_SIZE * idx + 2)..]), in get_insn() 570 imm: LittleEndian::read_i32(&prog[(INSN_SIZE * idx + 4)..]), in get_insn()
|
/DragonOS/kernel/src/driver/tty/ |
H A D | tty_driver.rs | 303 let idx: usize; in init_tty_device() localVariable 308 idx = i; in init_tty_device() 310 idx = self.ida.lock().alloc().ok_or(SystemError::EBUSY)?; in init_tty_device() 313 let tty = TtyCore::new(self.self_ref(), idx); in init_tty_device() 331 IdTable::new(self.tty_line_name(idx), Some(*core.device_number())), in init_tty_device()
|
/DragonOS/user/apps/user-manage/src/executor/ |
H A D | executor.rs | 380 if let Some(idx) = users.iter().position(|&r| r == info.username) { in update_group_file() 384 users.remove(idx); in update_group_file() 390 users[idx] = &name; in update_group_file() 450 if let Some(idx) = users.iter().position(|&r| r == info.username) { in update_gshadow_file() 454 users.remove(idx); in update_gshadow_file() 458 users[idx] = &name; in update_gshadow_file()
|
/DragonOS/kernel/src/driver/block/ |
H A D | virtio_blk.rs | 127 let idx = inner.id_bmp.first_false_index()?; in alloc_id() localVariable 128 inner.id_bmp.set(idx, true); in alloc_id() 129 let name = Self::format_name(idx); in alloc_id() 130 inner.devname[idx] = Some(name.clone()); in alloc_id()
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | mod.rs | 160 for (idx, val) in tab.iter().enumerate() { in fast_imageblit() 161 color_tab[idx] = (*val & eorx) ^ bgx; in fast_imageblit() 357 for (idx, color) in cmap.iter().enumerate() { in set_color_map() 359 .fb_set_color_register(idx as u16, color.red, color.green, color.blue) in set_color_map()
|
/DragonOS/kernel/src/filesystem/fat/ |
H A D | entry.rs | 2232 idx: u8, field 2260 idx: start_index, in new() 2275 match self.idx { in next() 2284 self.idx -= 1; in next() 2294 self.idx -= 1; in next()
|
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/ |
H A D | framebuffer_console.rs | 383 let idx = color_table[i]; in con_set_palette() localVariable 384 let col = palette.get_mut(idx as usize).unwrap(); in con_set_palette()
|
/DragonOS/kernel/src/driver/tty/tty_ldisc/ |
H A D | ntty.rs | 34 fn ntty_buf_mask(idx: usize) -> usize { in ntty_buf_mask() 35 return idx & (NTTY_BUFSIZE - 1); in ntty_buf_mask()
|