/DragonOS-0.1.8/kernel/src/driver/disk/ahci/ |
D | hba.rs | 22 pub const HBA_PORT_CMD_CR: u32 = 1 << 15; 23 pub const HBA_PORT_CMD_FR: u32 = 1 << 14; 24 pub const HBA_PORT_CMD_FRE: u32 = 1 << 4; 25 pub const HBA_PORT_CMD_ST: u32 = 1; 27 pub const HBA_PORT_IS_ERR: u32 = 1 << 30 | 1 << 29 | 1 << 28 | 1 << 27; 28 pub const HBA_SSTS_PRESENT: u32 = 0x3; 29 pub const HBA_SIG_ATA: u32 = 0x00000101; 30 pub const HBA_SIG_ATAPI: u32 = 0xEB140101; 31 pub const HBA_SIG_PM: u32 = 0x96690101; 32 pub const HBA_SIG_SEMB: u32 = 0xC33C0101; [all …]
|
D | ahcidisk.rs | 70 volatile_write!(port.is, u32::MAX); // Clear pending interrupt bits in read_at() 72 let slot = port.find_cmdslot().unwrap_or(u32::MAX); in read_at() 74 if slot == u32::MAX { in read_at() 91 (size_of::<FisRegH2D>() / size_of::<u32>()) as u8 in read_at() 149 ((tmp_count << 9) - 1) as u32 in read_at() 177 const SPIN_LIMIT: u32 = 10000; in read_at() 229 volatile_write!(port.is, u32::MAX); // Clear pending interrupt bits in write_at() 231 let slot = port.find_cmdslot().unwrap_or(u32::MAX); in write_at() 233 if slot == u32::MAX { in write_at() 252 (size_of::<FisRegH2D>() / size_of::<u32>()) as u8 in write_at() [all …]
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/ |
D | msi.rs | 5 pub fn ia64_pci_get_arch_msi_message_address(processor: u16) -> u32 { in ia64_pci_get_arch_msi_message_address() argument 6 0xfee00000 as u32 | ((processor as u32) << 12) in ia64_pci_get_arch_msi_message_address() 17 ) -> u32 { in ia64_pci_get_arch_msi_message_data() argument 19 TriggerMode::EdgeTrigger => vector as u32, in ia64_pci_get_arch_msi_message_data() 20 TriggerMode::AssertHigh => vector as u32 | 1 << 15 | 1 << 14, in ia64_pci_get_arch_msi_message_data() 21 TriggerMode::AssertLow => vector as u32 | 1 << 15, in ia64_pci_get_arch_msi_message_data()
|
D | cpu.rs | 7 pub fn current_cpu_id() -> u32 { in current_cpu_id()
|
/DragonOS-0.1.8/kernel/src/time/ |
D | jiffies.rs | 16 pub const CLOCK_TICK_RATE: u32 = HZ as u32 * 100000; 17 pub const JIFFIES_SHIFT: u32 = 8; 18 pub const LATCH: u32 = ((CLOCK_TICK_RATE + (HZ as u32) / 2) / HZ as u32) as u32; 19 pub const ACTHZ: u32 = sh_div(CLOCK_TICK_RATE, LATCH, 8); 20 pub const NSEC_PER_JIFFY: u32 = ((NSEC_PER_SEC << 8) / ACTHZ) as u32; 21 pub const fn sh_div(nom: u32, den: u32, lsh: u32) -> u32 { in sh_div() argument
|
D | mod.rs | 25 pub const MSEC_PER_SEC: u32 = 1000; 27 pub const USEC_PER_MSEC: u32 = 1000; 29 pub const NSEC_PER_USEC: u32 = 1000; 31 pub const NSEC_PER_MSEC: u32 = 1000000; 33 pub const USEC_PER_SEC: u32 = 1000000; 35 pub const NSEC_PER_SEC: u32 = 1000000000; 280 impl ops::Mul<u32> for Duration { 283 fn mul(self, rhs: u32) -> Duration { in mul() 288 impl ops::MulAssign<u32> for Duration { 289 fn mul_assign(&mut self, rhs: u32) { in mul_assign() argument [all …]
|
D | timeconv.rs | 45 fn is_leap(year: u32) -> bool { in is_leap() 59 fn math_div(left: u32, right: u32) -> u32 { in math_div() argument 69 fn leaps_between(y1: u32, y2: u32) -> u32 { in leaps_between() argument
|
D | clocksource.rs | 47 pub const WATCHDOG_THRESHOLD: u32 = NSEC_PER_SEC >> 4; 220 fn log2(x: u32) -> u32 { in log2() argument 272 cs_data.max_idle_ns = ns as u32; in register() 551 pub mult: u32, 552 pub shift: u32, 553 pub max_idle_ns: u32, 564 mult: u32, in new() argument 565 shift: u32, in new() argument 566 max_idle_ns: u32, in new() argument 591 pub fn set_mult(&mut self, mult: u32) { in set_mult() argument [all …]
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/pci/ |
D | pci.rs | 15 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32 { in read_config() argument 17 let address = ((bus_device_function.bus as u32) << 16) in read_config() 18 | ((bus_device_function.device as u32) << 11) in read_config() 19 | ((bus_device_function.function as u32 & 7) << 8) in read_config() 20 | (offset & 0xfc) as u32 in read_config() 30 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32) { in write_config() argument 31 let address = ((bus_device_function.bus as u32) << 16) in write_config() 32 | ((bus_device_function.device as u32) << 11) in write_config() 33 | ((bus_device_function.function as u32 & 7) << 8) in write_config() 34 | (offset & 0xfc) as u32 in write_config()
|
/DragonOS-0.1.8/kernel/src/filesystem/fat/ |
D | bpb.rs | 53 pub hidden_sectors: u32, 56 pub total_sectors_32: u32, 83 pub volume_id: u32, 85 pub filesystem_type: u32, 93 pub fat_size_32: u32, 112 pub root_cluster: u32, 137 pub volume_id: u32, 273 let root_sectors = ((bpb.root_entries_cnt as u32 * 32) + (bpb.bytes_per_sector as u32 - 1)) in new() 274 / (bpb.bytes_per_sector as u32); in new() 278 bpb.fat_size_16 as u32 in new() [all …]
|
D | utils.rs | 4 pub const RESERVED_CLUSTERS: u32 = 2;
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | printk.rs | 16 pub const COLOR_WHITE: u32 = 0x00ffffff; 18 pub const COLOR_BLACK: u32 = 0x00000000; 20 pub const COLOR_RED: u32 = 0x00ff0000; 22 pub const COLOR_ORANGE: u32 = 0x00ff8000; 24 pub const COLOR_YELLOW: u32 = 0x00ffff00; 26 pub const COLOR_GREEN: u32 = 0x0000ff00; 28 pub const COLOR_BLUE: u32 = 0x000000ff; 30 pub const COLOR_INDIGO: u32 = 0x0000ffff; 32 pub const COLOR_PURPLE: u32 = 0x008000ff; 123 pub fn __write_string_color(&self, fr_color: u32, bk_color: u32, s: &str) { in __write_string_color() argument [all …]
|
D | rwlock.rs | 18 const READER: u32 = 1 << 2; 21 const UPGRADED: u32 = 1 << 1; 24 const WRITER: u32 = 1; 26 const READER_BIT: u32 = 2; 97 fn current_reader(&self) -> Result<u32, SystemError> { in current_reader() argument 98 const MAX_READERS: u32 = core::u32::MAX >> READER_BIT >> 1; //右移3位 in current_reader() 163 pub fn reader_count(&self) -> u32 { in reader_count() argument 171 pub fn writer_count(&self) -> u32 { in writer_count() argument
|
/DragonOS-0.1.8/kernel/src/filesystem/vfs/ |
D | fcntl.rs | 1 const F_LINUX_SPECIFIC_BASE: u32 = 1024; 8 #[repr(u32)] 62 pub const FD_CLOEXEC: u32 = 1;
|
/DragonOS-0.1.8/kernel/src/smp/ |
D | core.rs | 3 pub fn smp_get_processor_id() -> u32 { in smp_get_processor_id() 8 pub fn smp_send_reschedule(_cpu: u32) { in smp_send_reschedule() argument
|
/DragonOS-0.1.8/kernel/src/net/ |
D | syscall.rs | 102 optlen: *mut u32, in getsockopt() argument 105 let optval = optval as *mut u32; in getsockopt() 118 *optval = socket.metadata()?.send_buf_size as u32; in getsockopt() 119 *optlen = core::mem::size_of::<u32>() as u32; in getsockopt() 124 let optval = optval as *mut u32; in getsockopt() 127 *optval = socket.metadata()?.recv_buf_size as u32; in getsockopt() 128 *optlen = core::mem::size_of::<u32>() as u32; in getsockopt() 207 _flags: u32, in sendto() argument 236 _flags: u32, in recvfrom() argument 238 addrlen: *mut u32, in recvfrom() argument [all …]
|
/DragonOS-0.1.8/kernel/src/driver/virtio/ |
D | transport_pci.rs | 85 notify_off_multiplier: u32, 89 config_space: Option<NonNull<[u32]>>, 217 volwrite!(self.common_cfg, driver_feature, driver_features as u32); in write_driver_features() 222 (driver_features >> 32) as u32 in write_driver_features() 227 fn max_queue_size(&self) -> u32 { in max_queue_size() argument 255 fn set_guest_page_size(&mut self, _guest_page_size: u32) { in set_guest_page_size() argument 264 size: u32, in queue_set() argument 317 if size_of::<T>() > config_space.len() * size_of::<u32>() { in config_space() 327 let config_space_ptr = NonNull::new(config_space.as_ptr() as *mut u32).unwrap(); in config_space() 345 device_feature_select: Volatile<u32>, [all …]
|
/DragonOS-0.1.8/kernel/src/arch/ |
D | mod.rs | 13 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32; in read_config() argument 18 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32); in write_config() argument
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | mmio_buddy.rs | 19 const MMIO_BUDDY_MAX_EXP: u32 = PAGE_1G_SHIFT; 21 const MMIO_BUDDY_MIN_EXP: u32 = PAGE_4K_SHIFT; 23 const MMIO_BUDDY_REGION_COUNT: u32 = MMIO_BUDDY_MAX_EXP - MMIO_BUDDY_MIN_EXP + 1; 115 fn give_back_block(&self, vaddr: VirtAddr, exp: u32) -> Result<i32, SystemError> { in give_back_block() 138 exp: u32, in split_block() argument 161 exp: u32, in query_addr_region() argument 298 fn mmio_buddy_query_addr_region(&self, exp: u32) -> Result<MmioBuddyAddrRegion, MmioResult> { in mmio_buddy_query_addr_region() 325 fn calculate_block_vaddr(&self, vaddr: VirtAddr, exp: u32) -> VirtAddr { in calculate_block_vaddr() 344 exp: u32, in pop_buddy_block() argument 401 exp: u32, in merge_all_exp() argument [all …]
|
/DragonOS-0.1.8/kernel/src/driver/pci/ |
D | pci.rs | 329 command as u32, in set_command() 408 pub cardbus_cis_pointer: u32, // 指向卡信息结构,供在 CardBus 和 PCI 之间共享芯片的设备使用。 411 pub expansion_rom_base_address: u32, 415 pub reserved2: u32, 479 pub bar0: u32, 480 pub bar1: u32, 492 pub prefetchable_base_upper_32_bits: u32, 493 pub prefetchable_limit_upper_32_bits: u32, 499 pub expansion_rom_base_address: u32, 538 pub cardbus_socket_ex_ca_base_address: u32, [all …]
|
/DragonOS-0.1.8/kernel/src/sched/ |
D | core.rs | 20 pub fn cpu_executing(cpu_id: u32) -> &'static mut process_control_block { in cpu_executing() 31 pub fn get_cpu_loads(cpu_id: u32) -> u32 { in get_cpu_loads() argument 39 return (len_rt + len_cfs) as u32; in get_cpu_loads() 192 pcb.migrate_to = target as u32; in sched_migrate_process()
|
/DragonOS-0.1.8/kernel/src/filesystem/ |
D | mbr.rs | 14 pub starting_lba: u32, // 起始逻辑扇区 15 pub total_sectors: u32, // 分区占用的磁盘扇区数
|
/DragonOS-0.1.8/kernel/src/syscall/ |
D | mod.rs | 383 fn do_put_string(s: *const u8, front_color: u32, back_color: u32) -> usize; in do_put_string() argument 411 Self::put_string(args[0] as *const u8, args[1] as u32, args[2] as u32) in handle() 421 let open_flags: FileMode = FileMode::from_bits_truncate(flags as u32); in handle() 476 let whence = args[2] as u32; in handle() 671 let flags = args[2] as u32; in handle() 756 if verify_area(virt_optlen, core::mem::size_of::<u32>() as usize).is_err() { in handle() 766 Self::getsockopt(args[0], args[1], args[2], optval, optlen as *mut u32) in handle() 798 let flags = args[3] as u32; in handle() 819 let flags = args[3] as u32; in handle() 833 if verify_area(virt_addrlen, core::mem::size_of::<u32>() as usize).is_err() { in handle() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/base/device/ |
D | mod.rs | 95 pub struct IdTable(&'static str, u32); 103 pub fn new(name: &'static str, id: u32) -> IdTable { in new() 148 impl From<u32> for DeviceState { 149 fn from(state: u32) -> Self { in from() 159 impl From<DeviceState> for u32 { implementation
|
/DragonOS-0.1.8/kernel/src/process/ |
D | abi.rs | 54 impl TryFrom<u32> for AtType { 57 fn try_from(value: u32) -> Result<Self, Self::Error> { in try_from()
|