/DragonOS/kernel/src/arch/x86_64/driver/ |
H A D | tsc.rs | 19 static mut TSC_KHZ: u64 = 0; 20 static mut CPU_KHZ: u64 = 0; 23 const DEFAULT_THRESHOLD: u64 = 0x20000; 103 fn calibrate_cpu_by_pit_hpet_ptimer() -> Result<u64, SystemError> { in calibrate_cpu_by_pit_hpet_ptimer() 110 let mut tsc_pit_min = u64::MAX; in calibrate_cpu_by_pit_hpet_ptimer() 111 let mut tsc_ref_min = u64::MAX; in calibrate_cpu_by_pit_hpet_ptimer() 134 let tsc_pit_khz = Self::pit_calibrate_tsc(latch, ms, loopmin).unwrap_or(u64::MAX); in calibrate_cpu_by_pit_hpet_ptimer() 151 if tsc1 == u64::MAX || tsc2 == u64::MAX { in calibrate_cpu_by_pit_hpet_ptimer() 180 if i == 1 && tsc_pit_min == u64::MAX { in calibrate_cpu_by_pit_hpet_ptimer() 187 if tsc_pit_min == u64::MAX { in calibrate_cpu_by_pit_hpet_ptimer() [all …]
|
/DragonOS/kernel/src/driver/timers/hpet/ |
H A D | mod.rs | 9 _reserved0: Volatile<u64>, 10 general_config: Volatile<u64>, 11 _reserved1: Volatile<u64>, 12 general_intr_status: Volatile<u64>, 13 _reserved2: [Volatile<u64>; 25], 14 main_counter_value: Volatile<u64>, 15 _reserved3: Volatile<u64>, 28 pub fn counter_clock_period(&self) -> u64 { in counter_clock_period() argument 31 period as u64 in counter_clock_period() 35 pub fn frequency(&self) -> u64 { in frequency() argument [all …]
|
/DragonOS/kernel/src/sched/ |
H A D | cputime.rs | 11 pub fn irq_time_read(cpu: usize) -> u64 { in irq_time_read() argument 31 pub total: u64, 32 pub tick_delta: u64, 33 pub irq_start_time: u64, 38 pub fn account_delta(&mut self, delta: u64) { in account_delta() argument 45 pub fn irqtime_tick_accounted(&mut self, max: u64) -> u64 { in irqtime_tick_accounted() argument 55 irq_time.irq_start_time = SchedClock::sched_clock_cpu(cpu) as u64; in irqtime_start() 64 let delta = SchedClock::sched_clock_cpu(cpu) as u64 - irq_time.irq_start_time; in irqtime_account_irq() 77 ticks: u64, in irqtime_account_process_tick() argument 79 let cputime = TICK_NESC as u64 * ticks; in irqtime_account_process_tick() [all …]
|
H A D | pelt.rs | 19 pub const LOAD_AVG_PERIOD: u64 = 32; 26 pub last_update_time: u64, 28 pub load_sum: u64, 30 pub runnable_sum: u64, 32 pub util_sum: u64, 49 now: u64, in update_load_sum() argument 78 mut delta: u64, in accumulate_sum() argument 82 ) -> u64 { in accumulate_sum() argument 85 delta += self.period_contrib as u64; in accumulate_sum() 107 self.load_sum += (contrib * load) as u64; in accumulate_sum() [all …]
|
/DragonOS/kernel/src/arch/x86_64/init/ |
H A D | boot.rs | 7 const BOOT_ENTRY_TYPE_MULTIBOOT: u64 = 1; 8 const BOOT_ENTRY_TYPE_MULTIBOOT2: u64 = 2; 9 const BOOT_ENTRY_TYPE_LINUX_32: u64 = 3; 10 const BOOT_ENTRY_TYPE_LINUX_64: u64 = 4; 13 #[repr(u64)] 21 impl TryFrom<u64> for BootProtocol { 24 fn try_from(value: u64) -> Result<Self, Self::Error> { in try_from() 37 boot_entry_type: u64, in early_boot_init() argument 38 arg1: u64, in early_boot_init() argument 39 arg2: u64, in early_boot_init() argument
|
H A D | mod.rs | 48 mb2_info: u64, in kernel_main() argument 49 mb2_magic: u64, in kernel_main() argument 50 bsp_gdt_size: u64, in kernel_main() argument 51 bsp_idt_size: u64, in kernel_main() argument 52 boot_entry_type: u64, in kernel_main() argument 85 let stack_start = unsafe { *(head_stack_start as *const u64) } as usize; in early_setup_arch() constant 129 current_tss.set_rsp(x86::Ring::Ring0, stack_start as u64); in set_current_core_tss() 130 current_tss.set_ist(0, ist0 as u64); in set_current_core_tss()
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | host_mem.rs | 50 pub guest_phys_addr: u64, // 虚机内存区间起始物理地址 51 pub memory_size: u64, // 虚机内存区间大小 52 pub userspace_addr: u64, // 虚机内存区间对应的主机虚拟地址 57 pub base_gfn: u64, // 虚机内存区间起始物理页框号 58 pub npages: u64, // 虚机内存区间页数,即内存区间的大小 59 pub userspace_addr: u64, // 虚机内存区间对应的主机虚拟地址 87 fn __gfn_to_memslot(slots: KvmMemorySlots, gfn: u64) -> Option<KvmMemorySlot> { in __gfn_to_memslot() 99 fn __gfn_to_hva(slot: KvmMemorySlot, gfn: u64) -> u64 { in __gfn_to_hva() argument 100 return slot.userspace_addr + (gfn - slot.base_gfn) * (PAGE_SIZE as u64); in __gfn_to_hva() 104 gfn: u64, in __gfn_to_hva_many() argument [all …]
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | vmexit.rs | 68 interrupt_info as u64, in vmexit_vmx_instruction_executed() 71 …let rflags: u64 = vmx_vmread(VmcsFields::GUEST_RFLAGS as u32).unwrap() | 0x0001_0000; // set RF fl… in vmexit_vmx_instruction_executed() 132 pub r15: u64, 133 pub r14: u64, 134 pub r13: u64, 135 pub r12: u64, 136 pub r11: u64, 137 pub r10: u64, 138 pub r9: u64, 139 pub r8: u64, [all …]
|
H A D | mmu.rs | 57 fn(vcpu: &mut VmxVcpu, gpa: u64, error_code: u32, prefault: bool) -> Result<(), SystemError>; 60 pub root_hpa: u64, 64 pub get_cr3: Option<fn(&VmxVcpu) -> u64>, 65 pub set_eptp: Option<fn(u64) -> Result<(), SystemError>>, 86 fn tdp_get_cr3(_vcpu: &VmxVcpu) -> u64 { in tdp_get_cr3() argument 91 fn tdp_set_eptp(root_hpa: u64) -> Result<(), SystemError> { in tdp_set_eptp() 97 eptp |= root_hpa & (PAGE_MASK as u64); in tdp_set_eptp() 104 gpa: u64, in tdp_page_fault() argument 206 gpa: u64, in __direct_map() argument 210 _gfn: u64, in __direct_map() argument [all …]
|
H A D | vcpu.rs | 50 pub vmxon_region_physical_address: u64, // vmxon需要该地址 56 pub vmcs_region_physical_address: u64, // vmptrld, vmclear需要该地址 58 pub msr_bitmap_physical_address: u64, 108 unsafe { MMArch::virt_2_phys(vaddr).unwrap().data() as u64 } in alloc() 112 unsafe { MMArch::virt_2_phys(vaddr).unwrap().data() as u64 } in alloc() 116 unsafe { MMArch::virt_2_phys(vaddr).unwrap().data() as u64 } in alloc() 176 vmx_vmwrite(VmcsFields::GUEST_CR0 as u32, cr0.bits() as u64)?; in vmx_set_cr0() 220 vmx_vmwrite(VmcsFields::GUEST_CR0 as u32, cr0.bits() as u64)?; in vmcs_init_guest() 231 vmx_vmwrite(VmcsFields::GUEST_VMCS_LINK_PTR as u32, u64::MAX)?; in vmcs_init_guest() 254 self.vcpu_ctx.regs[VcpuRegIndex::Rsp as usize] as u64, in vmcs_init_guest() [all …]
|
/DragonOS/kernel/src/syscall/ |
H A D | misc.rs | 20 uptime: u64, 21 loads: [u64; 3], 22 totalram: u64, 23 freeram: u64, 24 sharedram: u64, 25 bufferram: u64, 26 totalswap: u64, 27 freeswap: u64, 30 totalhigh: u64, 31 freehigh: u64, [all …]
|
/DragonOS/kernel/crates/intertrait/src/ |
H A D | hasher.rs | 7 pub struct FastHasher(u64); 13 fn finish(&self) -> u64 { in finish() argument 19 while bytes.len() > size_of::<u64>() { in write() 20 let (u64_bytes, remaining) = bytes.split_at(size_of::<u64>()); in write() 21 self.0 ^= u64::from_ne_bytes(u64_bytes.try_into().unwrap()); in write() 26 .fold(0u64, |result, b| (result << 8) | *b as u64); in write()
|
/DragonOS/kernel/crates/crc/src/tables/ |
H A D | crc64.rs | 5 pub table: [u64; 256], 6 pub poly: u64, 10 pub const fn new(poly: u64, table: [u64; 256]) -> Self { in new() argument 16 type Target = [u64; 256];
|
/DragonOS/kernel/src/filesystem/fat/ |
H A D | fs.rs | 45 const FAT_MAX_NAMELEN: u64 = 255; 48 pub const MAX_FILE_SIZE: u64 = 0xffff_ffff; 55 pub cluster_num: u64, 56 pub parent_cluster: u64, 82 pub first_data_sector: u64, 258 offset: Option<u64>, 327 let root_dir_sectors: u64 = ((bpb.root_entries_cnt as u64 * 32) in new() 328 + (bpb.bytes_per_sector as u64 - 1)) in new() 329 / (bpb.bytes_per_sector as u64); in new() 333 bpb.fat_size_16 as u64 in new() [all …]
|
/DragonOS/user/apps/test_statx/src/ |
H A D | main.rs | 10 pub stx_attributes: u64, 16 pub stx_ino: u64, 17 pub stx_size: u64, 18 pub stx_blocks: u64, 19 pub stx_attributes_mask: u64, 28 pub stx_mnt_id: u64, 31 __statx_pad3: [u64; 12],
|
/DragonOS/kernel/src/driver/base/block/ |
H A D | disk_info.rs | 7 pub type SectorT = u64; 13 pub lba_start: u64, // 起始LBA号 14 pub sectors_num: u64, // 该分区的扇区数 24 lba_start: u64, in new() argument 25 sectors_num: u64, in new() argument 38 pub fn new_raw(start_sector: SectorT, lba_start: u64, sectors_num: u64, partno: u16) -> Self { in new_raw() argument
|
/DragonOS/kernel/src/time/ |
H A D | mod.rs | 46 pub const FSEC_PER_SEC: u64 = 1000000000000000; 49 pub const PIT_TICK_RATE: u64 = 1193182; 84 CurrentTimeArch::get_cycles() as u64 / khz, in now_cpu_time() 106 Duration::from_micros((sec * 1000000 + nsec / 1000) as u64) in sub() 130 Duration::from_micros(val.tv_sec as u64 * 1000000 + val.tv_nsec as u64 / 1000) in from() 182 let mut year: u64 = year0.into(); in mktime64() 183 let day: u64 = day.into(); in mktime64() 184 let hour: u64 = hour.into(); in mktime64() 185 let min: u64 = min.into(); in mktime64() 186 let sec: u64 = sec.into(); in mktime64() [all …]
|
H A D | timer.rs | 34 pub static ref TIMER_LIST: SpinLock<Vec<(u64, Arc<Timer>)>> = SpinLock::new(Vec::new()); 43 int_like!(Jiffies, u64); 47 pub fn timer_jiffies(&self) -> u64 { in timer_jiffies() argument 64 let ms = jiffies.data() / 1_000_000 * NSEC_PER_JIFFY as u64; in from() 81 let jiffies = ms.as_millis() as u64 * 1_000_000 / NSEC_PER_JIFFY as u64; in from() 119 pub fn new(timer_func: Box<dyn TimerFunction>, expire_jiffies: u64) -> Arc<Self> { in new() 210 pub expire_jiffies: u64, 287 pub fn next_n_ms_timer_jiffies(expire_ms: u64) -> u64 { in next_n_ms_timer_jiffies() argument 288 return TIMER_JIFFIES.load(Ordering::SeqCst) + expire_ms * 1000000 / NSEC_PER_JIFFY as u64; in next_n_ms_timer_jiffies() 291 pub fn next_n_us_timer_jiffies(expire_us: u64) -> u64 { in next_n_us_timer_jiffies() argument [all …]
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | zone.rs | 43 total: u64, 123 self.total -= (just_reclaimed * OBJECT_PAGE_SIZE) as u64; in try_reclaim_base_pages() 132 pub fn free_space(&mut self) -> u64 { in free_space() argument 157 free as u64 in free_space() 201 self.total += OBJECT_PAGE_SIZE as u64; in refill() 212 total: u64, 214 free: u64, 219 pub fn new(total: u64, free: u64) -> Self { in new() argument 223 pub fn total(&self) -> u64 { in total() argument 227 pub fn used(&self) -> u64 { in used() argument [all …]
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | trap.rs | 41 pub struct TrapNr: u64 { 114 unsafe extern "C" fn do_divide_error(regs: &'static TrapFrame, error_code: u64) { in do_divide_error() argument 128 unsafe extern "C" fn do_debug(regs: &'static TrapFrame, error_code: u64) { in do_debug() argument 142 unsafe extern "C" fn do_nmi(regs: &'static TrapFrame, error_code: u64) { in do_nmi() argument 156 unsafe extern "C" fn do_int3(regs: &'static TrapFrame, error_code: u64) { in do_int3() argument 170 unsafe extern "C" fn do_overflow(regs: &'static TrapFrame, error_code: u64) { in do_overflow() argument 184 unsafe extern "C" fn do_bounds(regs: &'static TrapFrame, error_code: u64) { in do_bounds() argument 198 unsafe extern "C" fn do_undefined_opcode(regs: &'static TrapFrame, error_code: u64) { in do_undefined_opcode() argument 212 unsafe extern "C" fn do_dev_not_avaliable(regs: &'static TrapFrame, error_code: u64) { in do_dev_not_avaliable() argument 226 unsafe extern "C" fn do_double_fault(regs: &'static TrapFrame, error_code: u64) { in do_double_fault() argument [all …]
|
/DragonOS/kernel/crates/crc/src/ |
H A D | crc64.rs | 41 pub fn crc64_be(mut crc: u64, buf: &[u8]) -> u64 { in crc64_be() argument 43 let t = ((crc >> 56) ^ (byte as u64)) & 0xff; in crc64_be() 57 pub fn crc64_rocksoft_generic(mut crc: u64, buf: &[u8]) -> u64 { in crc64_rocksoft_generic() argument
|
/DragonOS/kernel/src/mm/ |
H A D | c_adapter.rs | 20 pub unsafe extern "C" fn kzalloc(size: usize, _gfp: u64) -> usize { in kzalloc() 26 pub unsafe extern "C" fn kmalloc(size: usize, _gfp: u64) -> usize { in kmalloc() 88 _vm_flags: u64, in rs_mmio_create() argument 89 res_vaddr: *mut u64, in rs_mmio_create() argument 90 res_length: *mut u64, in rs_mmio_create() argument 98 *res_vaddr = space_guard.vaddr().data() as u64; in rs_mmio_create() 99 *res_length = space_guard.size() as u64; in rs_mmio_create() 115 pub unsafe extern "C" fn rs_mmio_release(vaddr: u64, length: u64) -> i32 { in rs_mmio_release() argument
|
/DragonOS/kernel/src/arch/x86_64/process/ |
H A D | kthread.rs | 33 frame.rbx = create_info as usize as u64; in __inner_create() 34 frame.ds = KERNEL_DS.bits() as u64; in __inner_create() 35 frame.es = KERNEL_DS.bits() as u64; in __inner_create() 36 frame.cs = KERNEL_CS.bits() as u64; in __inner_create() 37 frame.ss = KERNEL_DS.bits() as u64; in __inner_create() 42 frame.rip = kernel_thread_bootstrap_stage1 as usize as u64; in __inner_create()
|
/DragonOS/kernel/src/arch/x86_64/ |
H A D | fpu.rs | 12 word2: u64, 14 word3: u64, 18 mm: [u64; 16], 20 xmm: [u64; 32], 22 rest: [u64; 12],
|
/DragonOS/kernel/crates/klog_types/src/ |
H A D | lib.rs | 16 pub id: u64, 20 pub time: u64, 28 pub checksum: u64, 42 id: u64, in new() argument 46 time: u64, in new() argument 73 pub fn calculate_checksum(value: &Self) -> u64 { in calculate_checksum() argument 77 core::mem::size_of::<Self>() - core::mem::size_of::<u64>(), in calculate_checksum() 202 pub capacity: u64, 203 pub slots_offset: u64, 241 capacity: capacity as u64, in new() [all …]
|