Home
last modified time | relevance | path

Searched refs:u8 (Results 1 – 25 of 60) sorted by relevance

123

/DragonOS-0.1.8/kernel/src/libs/
Dkeyboard_parser.rs6 pub const NUM_SCAN_CODES: u8 = 0x80;
8 pub const TYPE1_KEYCODE_MAP_TABLE_COLS: u8 = 2;
11 pub const TYPE1_KEYCODE_FLAG_BREAK: u8 = 0x80; // 用于判断按键是否被按下
14 #[repr(u8)]
18 NoneFlag = 0 as u8,
19 PauseBreak = 1 as u8,
20 PrintScreenPress = 2 as u8,
21 PrintScreenRelease = 4 as u8,
22 OtherKey = 8 as u8, // 除了上面两个按键以外的功能按键(不包括下面的第三类按键)
46 pub fn parse(&mut self, scancode: u8) -> TypeOneFSMState { in parse()
[all …]
Dvec_cursor.rs13 data: Vec<u8>,
20 pub fn new(data: Vec<u8>) -> Self { in new()
35 pub fn get_mut(&mut self) -> &mut Vec<u8> { in get_mut() argument
40 pub fn get_ref(&self) -> &Vec<u8> { in get_ref() argument
45 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8() argument
101 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact()
157 pub fn write_u8(&mut self, value: u8) -> Result<u8, SystemError> { in write_u8() argument
174 self.data[self.pos] = (value & 0xff) as u8; in write_u16()
176 self.data[self.pos] = ((value >> 8) & 0xff) as u8; in write_u16()
189 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
[all …]
/DragonOS-0.1.8/kernel/src/driver/disk/ahci/
Dhba.rs11 pub const ATA_CMD_READ_DMA_EXT: u8 = 0x25; // 读操作,并且退出
12 pub const ATA_CMD_WRITE_DMA_EXT: u8 = 0x35; // 写操作,并且退出
14 pub const ATA_CMD_IDENTIFY: u8 = 0xEC;
16 pub const ATA_CMD_IDENTIFY_PACKET: u8 = 0xA1;
18 pub const ATA_CMD_PACKET: u8 = 0xA0;
19 pub const ATA_DEV_BUSY: u8 = 0x80;
20 pub const ATA_DEV_DRQ: u8 = 0x08;
81 pub _rsv: [u8; 116], // 0x2C - 0x9F, Reserved
82 pub vendor: [u8; 96], // 0xA0 - 0xFF, Vendor specific registers
100 pub cfis: [u8; 64], // Command FIS
[all …]
Dahcidisk.rs31 pub ctrl_num: u8,
32 pub port_num: u8,
57 buf: &mut [u8], in read_at() argument
90 (1 << 5) - 1 as u8, in read_at()
91 (size_of::<FisRegH2D>() / size_of::<u32>()) as u8 in read_at()
98 let mut buf_ptr = buf as *mut [u8] as *mut usize as usize; in read_at()
108 let mut x: Vec<u8> = Vec::with_capacity(buf.len()); in read_at()
155 ((&mut cmdtbl.cfis) as *mut [u8] as *mut usize as *mut FisRegH2D) in read_at()
159 volatile_write!(cmdfis.fis_type, FisType::RegH2D as u8); in read_at()
163 volatile_write!(cmdfis.lba0, (lba_id_start & 0xFF) as u8); in read_at()
[all …]
/DragonOS-0.1.8/kernel/src/mm/allocator/
Dkernel_allocator.rs17 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8; in local_alloc() argument
18 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8; in local_alloc_zeroed() argument
19 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() argument
25 unsafe fn alloc_in_buddy(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { in alloc_in_buddy() argument
40 virt_addr.data() as *mut u8, in alloc_in_buddy()
47 unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy() argument
58 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8 { in local_alloc() argument
61 .map(|x| x.as_mut_ptr() as *mut u8) in local_alloc()
62 .unwrap_or(core::ptr::null_mut() as *mut u8); in local_alloc()
65 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8 { in local_alloc_zeroed() argument
[all …]
Dbuddy.rs97 core::ptr::write_bytes(MMArch::phys_2_virt(*f)?.data() as *mut u8, 0, A::PAGE_SIZE); in new()
108 MMArch::phys_2_virt(curr_page)?.data() as *mut u8, in new()
114 PageList::new(0, free_area[Self::order2index((MAX_ORDER - 1) as u8)]); in new()
116 free_area[Self::order2index((MAX_ORDER - 1) as u8)] = curr_page; in new()
138 let page_list_paddr: PhysAddr = free_area[Self::order2index(i as u8)]; in new()
156 let mut page_list_paddr: PhysAddr = free_area[Self::order2index(i as u8)]; in new()
212 let page_list_paddr: PhysAddr = free_area[Self::order2index(i as u8)]; in new()
270 fn order2index(order: u8) -> usize { in order2index()
279 fn pop_front(&mut self, order: u8) -> Option<PhysAddr> { in pop_front()
280 let mut alloc_in_specific_order = |spec_order: u8| { in pop_front()
[all …]
Dslab.rs45 pub fn allocate(&mut self, _layout: Layout) -> Option<*mut u8> { in allocate() argument
47 Some(block) => return Some(block.addr() as *mut u8), in allocate()
52 pub fn free(&mut self, ptr: *mut u8) { in free() argument
/DragonOS-0.1.8/kernel/src/driver/timers/rtc/
Drtc.rs39 let status_register_b: u8 = read_cmos(0x0B); // 读取状态寄存器B in get()
53 self.year = read_cmos(CMOSTimeSelector::Year as u8) as i32; in get()
54 self.month = read_cmos(CMOSTimeSelector::Month as u8) as i32; in get()
55 self.day = read_cmos(CMOSTimeSelector::Day as u8) as i32; in get()
56 self.hour = read_cmos(CMOSTimeSelector::Hour as u8) as i32; in get()
57 self.minute = read_cmos(CMOSTimeSelector::Minute as u8) as i32; in get()
58 self.second = read_cmos(CMOSTimeSelector::Second as u8) as i32; in get()
60 if self.second == read_cmos(CMOSTimeSelector::Second as u8) as i32 { in get()
93 fn read_cmos(addr: u8) -> u8 { in read_cmos() argument
101 #[repr(u8)]
/DragonOS-0.1.8/kernel/src/driver/pci/
Dpci.rs112 class_code: u8, in get_pci_device_structure_mut() argument
113 subclass: u8, in get_pci_device_structure_mut() argument
131 class_code: u8, in get_pci_device_structure() argument
132 subclass: u8, in get_pci_device_structure() argument
145 const BAR0_OFFSET: u8 = 0x10;
147 const STATUS_COMMAND_OFFSET: u8 = 0x04;
149 pub const PCI_CAP_ID_VNDR: u8 = 0x09;
150 pub const PCI_CAP_ID_MSI: u8 = 0x05;
151 pub const PCI_CAP_ID_MSIX: u8 = 0x11;
224 Unrecognised(u8),
[all …]
Dpci_irq.rs53 cap_offset: u8,
56 msix_table_bar: u8,
58 pending_table_bar: u8,
61 cap_offset: u8,
107 pub struct IRQ: u8{
129 let msix_table_bar = (data & 0x01) as u8; in irq_init()
133 let pending_table_bar = (data & 0x01) as u8; in irq_init()
187 fn irq_enable(&mut self, enable: bool) -> Result<u8, PciError> { in irq_enable() argument
209 fn msix_enable(&mut self, enable: bool) -> Result<u8, PciError> { in msix_enable() argument
240 fn msi_enable(&mut self, enable: bool) -> Result<u8, PciError> { in msi_enable() argument
[all …]
/DragonOS-0.1.8/kernel/src/syscall/
Duser_access.rs27 let p = dest.data() as *mut u8; in clear_user()
33 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user()
36 let p = dest.data() as *mut u8; in copy_to_user()
43 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() argument
46 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() constant
70 user: *const u8, in check_and_clone_cstr() argument
111 pub fn check_and_clone_cstr_array(user: *const *const u8) -> Result<Vec<String>, SystemError> { in check_and_clone_cstr_array()
119 let str_ptr: *const u8; in check_and_clone_cstr_array() constant
123 let mut dst = core::mem::transmute::<[usize; 1], [u8; size_of::<usize>()]>(dst); in check_and_clone_cstr_array()
125 let dst = core::mem::transmute::<[u8; size_of::<usize>()], [usize; 1]>(dst); in check_and_clone_cstr_array()
[all …]
/DragonOS-0.1.8/kernel/src/driver/tty/
Dmod.rs53 stdin_rx: mpsc::Receiver<u8>,
54 stdin_tx: mpsc::Sender<u8>,
56 output_rx: mpsc::Receiver<u8>,
57 output_tx: mpsc::Sender<u8>,
84 let (stdin_tx, stdin_rx) = mpsc::channel::<u8>(Self::STDIN_BUF_SIZE); in new()
85 let (output_tx, output_rx) = mpsc::channel::<u8>(Self::OUTPUT_BUF_SIZE); in new()
105 pub fn input(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in input() argument
122 pub fn output(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in output() argument
133 pub fn stdout(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stdout() argument
144 pub fn stderr(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stderr() argument
[all …]
/DragonOS-0.1.8/kernel/src/filesystem/
Dmbr.rs8 pub flags: u8, // 引导标志符,标记此分区为活动分区
9 pub starting_head: u8, // 起始磁头号
11 pub part_type: u8, // 分区类型ID
12 pub ending_head: u8, // 结束磁头号
37 pub reserved: [u8; 446],
/DragonOS-0.1.8/kernel/src/process/
Dpid.rs3 #[repr(u8)]
16 *self as u8 == *other as u8 in eq()
Dexec.rs24 fn probe(self: &'static Self, param: &ExecParam, buf: &[u8]) -> Result<(), ExecError>; in probe()
29 head_buf: &[u8], in load() argument
202 pub auxv: BTreeMap<u8, usize>,
248 self.push_slice(ustack, &[null::<u8>(), null::<u8>()])?; in push_at()
254 self.push_slice(ustack, &[null::<u8>()])?; in push_at()
258 self.push_slice(ustack, &[null::<u8>()])?; in push_at()
/DragonOS-0.1.8/kernel/src/driver/virtio/
Dvirtio_impl.rs24 ) -> (virtio_drivers::PhysAddr, NonNull<u8>) { in dma_alloc() argument
33 core::ptr::write_bytes(virt.data() as *mut u8, 0, count.data() * MMArch::PAGE_SIZE); in dma_alloc()
54 vaddr: NonNull<u8>, in dma_dealloc() argument
62 let vaddr = VirtAddr::new(vaddr.as_ptr() as *mut u8 as usize); in dma_dealloc()
78 unsafe fn mmio_phys_to_virt(_paddr: virtio_drivers::PhysAddr, _size: usize) -> NonNull<u8> { in mmio_phys_to_virt() argument
85 buffer: NonNull<[u8]>, in share() argument
88 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
96 _buffer: NonNull<[u8]>, in unshare() argument
Dtransport_pci.rs39 const CAP_BAR_OFFSET: u8 = 4;
41 const CAP_BAR_OFFSET_OFFSET: u8 = 8;
43 const CAP_LENGTH_OFFSET: u8 = 12;
45 const CAP_NOTIFY_OFF_MULTIPLIER_OFFSET: u8 = 16;
48 const VIRTIO_PCI_CAP_COMMON_CFG: u8 = 1;
50 const VIRTIO_PCI_CAP_NOTIFY_CFG: u8 = 2;
52 const VIRTIO_PCI_CAP_ISR_CFG: u8 = 3;
54 const VIRTIO_PCI_CAP_DEVICE_CFG: u8 = 4;
87 isr_status: NonNull<Volatile<u8>>,
119 let cap_len = capability.private_header as u8; in new()
[all …]
/DragonOS-0.1.8/kernel/src/filesystem/fat/
Dbpb.rs17 pub jmp_boot: [u8; 3],
20 pub oem_name: [u8; 8],
26 pub sector_per_cluster: u8,
32 pub num_fats: u8,
41 pub media: u8,
76 pub drive_num: u8,
78 pub reserved1: u8,
80 pub boot_sig: u8,
123 pub reserved0: [u8; 12],
127 pub drive_num: u8,
[all …]
Dentry.rs23 value: u8,
84 buf: &mut [u8], in read() argument
161 buf: &[u8], in write() argument
328 let zeroes: Vec<u8> = vec![0u8; (range_end - range_start) as usize]; in zero_range()
723 short_name: &[u8; 11], in create_dir_entries()
906 pub const READ_ONLY: u8 = 1 << 0;
907 pub const HIDDEN: u8 = 1 << 1;
908 pub const SYSTEM: u8 = 1 << 2;
909 pub const VOLUME_ID: u8 = 1 << 3;
910 pub const DIRECTORY: u8 = 1 << 4;
[all …]
/DragonOS-0.1.8/kernel/src/net/
Dmod.rs72 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint); in read()
80 fn write(&self, buf: &[u8], to: Option<Endpoint>) -> Result<usize, SystemError>; in write() argument
197 _optval: &[u8], in setsockopt() argument
212 #[repr(u8)]
224 Unknown(u8),
247 let x: u8 = value.into(); in from()
252 impl From<u8> for Protocol {
253 fn from(value: u8) -> Self { in from()
270 impl Into<u8> for Protocol {
271 fn into(self) -> u8 { in into() argument
/DragonOS-0.1.8/kernel/src/driver/uart/
Duart.rs90 reg_data: u8,
91 reg_interrupt_enable: u8,
92 reg_ii_fifo: u8, // Interrupt Identification and FIFO control registers
93 reg_line_config: u8,
94 reg_modem_config: u8,
95 reg_line_status: u8,
96 reg_modem_statue: u8,
97 reg_scartch: u8,
293 io_out8(port + 0, (divisor & 0xff) as u8); // Set divisor (lo byte) in uart_init()
294 io_out8(port + 1, ((divisor >> 8) & 0xff) as u8); // (hi byte) in uart_init()
[all …]
/DragonOS-0.1.8/kernel/src/io/
Ddevice.rs20 const BLK_SIZE_LOG2_LIMIT: u8 = 12; // 设定块设备的块大小不能超过 1 << 12.
35 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError>; in read_at()
42 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError>; in write_at()
64 buf: &mut [u8], in read_at() argument
78 buf: &[u8], in write_at() argument
86 fn blk_size_log2(&self) -> u8; in blk_size_log2() argument
109 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError> { in read_at()
145 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError> { in write_at()
192 pub blk_size_log2: u8,
204 pub blk_size_log2: u8,
[all …]
/DragonOS-0.1.8/kernel/src/arch/
Dmod.rs13 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32; in read_config()
18 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32); in write_config() argument
/DragonOS-0.1.8/kernel/src/driver/acpi/
Dacpi.rs9 pub bus_begin: u8,
10 pub bus_end: u8,
/DragonOS-0.1.8/kernel/src/arch/x86_64/interrupt/
Dipi.rs10 #[repr(u8)]
50 pub fn shorthand(&self) -> u8 { in shorthand() argument
81 return x86::apic::ApicId::XApic(id as u8); in into()
90 let ipi_vec = ArchIpiKind::from(kind) as u8; in send_ipi()

123