Home
last modified time | relevance | path

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

12

/DragonOS-0.1.5/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.rs30 pub ctrl_num: u8,
31 pub port_num: u8,
56 buf: &mut [u8], in read_at() argument
89 (1 << 5) - 1 as u8, in read_at()
90 (size_of::<FisRegH2D>() / size_of::<u32>()) as u8 in read_at()
97 let mut buf_ptr = buf as *mut [u8] as *mut usize as usize; in read_at()
132 ((&mut cmdtbl.cfis) as *mut [u8] as *mut usize as *mut FisRegH2D) in read_at()
136 volatile_write!(cmdfis.fis_type, FisType::RegH2D as u8); in read_at()
140 volatile_write!(cmdfis.lba0, (lba_id_start & 0xFF) as u8); in read_at()
141 volatile_write!(cmdfis.lba1, ((lba_id_start >> 8) & 0xFF) as u8); in read_at()
[all …]
Dmod.rs77 Box::leak(Box::new([0u8; (1 << 20) as usize])) as *mut u8 as usize; in ahci_rust_init()
130 i as u8, in ahci_rust_init()
131 j as u8, in ahci_rust_init()
182 pub fn _port(ctrl_num: u8, port_num: u8) -> &'static mut HbaPort { in _port() argument
198 buf[i] = i as u8; in __test_ahci()
/DragonOS-0.1.5/kernel/src/mm/
Dallocator.rs8 unsafe fn local_alloc(&self, layout: Layout, gfp: gfp_t) -> *mut u8; in local_alloc() argument
9 unsafe fn local_alloc_zeroed(&self, layout: Layout, gfp: gfp_t) -> *mut u8; in local_alloc_zeroed() argument
10 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() argument
17 unsafe fn local_alloc(&self, layout: Layout, gfp: gfp_t) -> *mut u8 { in local_alloc() argument
21 return kmalloc(layout.size() as u64, gfp) as *mut u8; in local_alloc()
24 unsafe fn local_alloc_zeroed(&self, layout: Layout, gfp: gfp_t) -> *mut u8 { in local_alloc_zeroed() argument
28 return kmalloc(layout.size() as u64, gfp | __GFP_ZERO) as *mut u8; in local_alloc_zeroed()
31 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc() argument
38 unsafe fn alloc(&self, layout: Layout) -> *mut u8 { in alloc() argument
42 unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { in alloc_zeroed() argument
[all …]
/DragonOS-0.1.5/kernel/src/driver/timers/rtc/
Drtc.rs37 let status_register_b: u8 = read_cmos(0x0B); // 读取状态寄存器B in get()
51 self.year = read_cmos(CMOSTimeSelector::Year as u8) as i32; in get()
52 self.month = read_cmos(CMOSTimeSelector::Month as u8) as i32; in get()
53 self.day = read_cmos(CMOSTimeSelector::Day as u8) as i32; in get()
54 self.hour = read_cmos(CMOSTimeSelector::Hour as u8) as i32; in get()
55 self.minute = read_cmos(CMOSTimeSelector::Minute as u8) as i32; in get()
56 self.second = read_cmos(CMOSTimeSelector::Second as u8) as i32; in get()
58 if self.second == read_cmos(CMOSTimeSelector::Second as u8) as i32 { in get()
91 fn read_cmos(addr: u8) -> u8 { in read_cmos() argument
99 #[repr(u8)]
/DragonOS-0.1.5/kernel/src/driver/uart/
Duart.rs64 reg_data: u8,
65 reg_interrupt_enable: u8,
66 reg_ii_fifo: u8, // Interrupt Identification and FIFO control registers
67 reg_line_config: u8,
68 reg_modem_config: u8,
69 reg_line_status: u8,
70 reg_modem_statue: u8,
71 reg_scartch: u8,
109 io_out8(port + 0, (divisor & 0xff) as u8); // Set divisor (lo byte) in uart_init()
110 io_out8(port + 1, ((divisor >> 8) & 0xff) as u8); // (hi byte) in uart_init()
[all …]
/DragonOS-0.1.5/kernel/src/libs/
Dvec_cursor.rs16 data: Vec<u8>,
23 pub fn new(data: Vec<u8>) -> Self { in new()
38 pub fn get_mut(&mut self) -> &mut Vec<u8> { in get_mut() argument
43 pub fn get_ref(&self) -> &Vec<u8> { in get_ref() argument
48 pub fn read_u8(&mut self) -> Result<u8, i32> { in read_u8() argument
104 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), i32> { in read_exact()
160 pub fn write_u8(&mut self, value: u8) -> Result<u8, i32> { in write_u8() argument
177 self.data[self.pos] = (value & 0xff) as u8; in write_u16()
179 self.data[self.pos] = ((value >> 8) & 0xff) as u8; in write_u16()
192 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
[all …]
/DragonOS-0.1.5/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.5/kernel/src/driver/pci/
Dpci.rs12 const BAR0_OFFSET: u8 = 0x10;
14 const STATUS_COMMAND_OFFSET: u8 = 0x04;
16 pub const PCI_CAP_ID_VNDR: u8 = 0x09;
78 pub fn capabilities_offset(device_function: DeviceFunction) -> Option<u8> { in capabilities_offset() argument
96 temp as u8 & 0xFC in capabilities_offset()
108 pub bus: u8,
110 pub device: u8,
112 pub function: u8,
159 impl From<MemoryBarType> for u8 { implementation
169 impl TryFrom<u8> for MemoryBarType {
[all …]
/DragonOS-0.1.5/kernel/src/process/
Dpid.rs5 #[repr(u8)]
18 *self as u8 == *other as u8 in eq()
/DragonOS-0.1.5/kernel/src/arch/x86_64/
Dcpu.rs5 pub fn current_cpu_id() -> u8 { in current_cpu_id()
15 return ((cpuid_res >> 24) & 0xff) as u8; in current_cpu_id()
/DragonOS-0.1.5/kernel/src/driver/virtio/
Dvirtio.rs116 let mut bus: u8 = 0; in virtio_device_search()
117 let mut device: u8 = 0; in virtio_device_search()
118 let mut function: u8 = 0; in virtio_device_search()
119 let bus_ptr = &mut bus as *mut u8; in virtio_device_search()
120 let device_ptr = &mut device as *mut u8; in virtio_device_search()
121 let function_ptr = &mut function as *mut u8; in virtio_device_search()
Dtransport_pci.rs37 const CAP_BAR_OFFSET: u8 = 4;
39 const CAP_BAR_OFFSET_OFFSET: u8 = 8;
41 const CAP_LENGTH_OFFSET: u8 = 12;
43 const CAP_NOTIFY_OFF_MULTIPLIER_OFFSET: u8 = 16;
46 const VIRTIO_PCI_CAP_COMMON_CFG: u8 = 1;
48 const VIRTIO_PCI_CAP_NOTIFY_CFG: u8 = 2;
50 const VIRTIO_PCI_CAP_ISR_CFG: u8 = 3;
52 const VIRTIO_PCI_CAP_DEVICE_CFG: u8 = 4;
85 isr_status: NonNull<Volatile<u8>>,
128 let cap_len = capability.private_header as u8; in new()
[all …]
Dvirtio_impl.rs57 fn share(buffer: NonNull<[u8]>, _direction: BufferDirection) -> PhysAddr { in share() argument
58 let vaddr = buffer.as_ptr() as *mut u8 as usize; in share()
63 fn unshare(_paddr: PhysAddr, _buffer: NonNull<[u8]>, _direction: BufferDirection) { in unshare() argument
/DragonOS-0.1.5/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.rs27 value: u8,
85 pub fn read(&self, fs: &Arc<FATFileSystem>, buf: &mut [u8], offset: u64) -> Result<usize, i32> { in read() argument
160 buf: &[u8], in write() argument
319 let zeroes: Vec<u8> = vec![0u8; (range_end - range_start) as usize]; in zero_range()
707 short_name: &[u8; 11], in create_dir_entries()
886 pub const READ_ONLY: u8 = 1 << 0;
887 pub const HIDDEN: u8 = 1 << 1;
888 pub const SYSTEM: u8 = 1 << 2;
889 pub const VOLUME_ID: u8 = 1 << 3;
890 pub const DIRECTORY: u8 = 1 << 4;
[all …]
Dutils.rs8 pub fn decode_u8_ascii(value: u8) -> char { in decode_u8_ascii()
/DragonOS-0.1.5/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, i32>; in read_at()
42 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, i32>; in write_at()
60 fn read_at(&self, lba_id_start: BlockId, count: usize, buf: &mut [u8]) -> Result<usize, i32>; in read_at()
69 fn write_at(&self, lba_id_start: BlockId, count: usize, buf: &[u8]) -> Result<usize, i32>; in write_at()
76 fn blk_size_log2(&self) -> u8; in blk_size_log2() argument
99 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, i32> { in read_at()
135 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, i32> { in write_at()
182 pub blk_size_log2: u8,
194 pub blk_size_log2: u8,
[all …]
/DragonOS-0.1.5/kernel/src/filesystem/vfs/
Dmod.rs80 pub flags: u8,
84 pub const WRITE_MASK: u8 = (1u8 << 0);
85 pub const READ_MASK: u8 = (1u8 << 1);
86 pub const ERR_MASK: u8 = (1u8 << 2);
121 buf: &mut [u8], in read_at() argument
138 buf: &[u8], in write_at() argument
515 d_type: u8, // entry的类型
516 d_name: u8, // 文件entry的名字(是一个零长数组), 本字段仅用于占位
Dfile.rs121 pub fn read(&mut self, len: usize, buf: &mut [u8]) -> Result<usize, i32> { in read()
143 pub fn write(&mut self, len: usize, buf: &[u8]) -> Result<usize, i32> { in write()
244 let name_bytes: &[u8] = name.as_bytes(); in readdir()
250 dirent.d_type = sub_inode.metadata().unwrap().file_type.get_file_type_num() as u8; in readdir()
253 let ptr = &mut dirent.d_name as *mut u8; in readdir()
254 let buf: &mut [u8] = in readdir()
255 ::core::slice::from_raw_parts_mut::<'static, u8>(ptr, name_bytes.len()); in readdir()
Dsyscall.rs78 let buf: &mut [u8] = in sys_read()
79 unsafe { core::slice::from_raw_parts_mut::<'static, u8>(buf_vaddr as *mut u8, len) }; in sys_read()
107 let buf: &[u8] = in sys_write()
108 unsafe { core::slice::from_raw_parts::<'static, u8>(buf_vaddr as *mut u8, len) }; in sys_write()
/DragonOS-0.1.5/kernel/src/filesystem/procfs/
Dmod.rs33 #[repr(u8)]
42 impl From<u8> for ProcFileType {
43 fn from(value: u8) -> Self { in from()
77 data: Vec<u8>,
96 data: Vec<u8>,
109 fn trim_string(&self, data: &mut Vec<u8>) { in trim_string() argument
110 data.drain_filter(|x: &mut u8| *x == 0); in trim_string()
131 let pdata: &mut Vec<u8> = &mut pdata.data; in open_status()
133 let tmp_name: Vec<u8> = "Unknown".as_bytes().to_vec(); in open_status()
191 return Ok((pdata.len() * size_of::<u8>()) as i64); in open_status()
[all …]
/DragonOS-0.1.5/kernel/src/driver/keyboard/
Dps2_keyboard.rs82 buf: &mut [u8], in read_at() argument
90 &mut buf[0..len] as *mut [u8] as *mut i8, in read_at()
102 _buf: &[u8], in write_at() argument
/DragonOS-0.1.5/kernel/src/filesystem/devfs/
Dnull_dev.rs118 buf: &mut [u8], in read_at() argument
137 buf: &[u8], in write_at() argument
Dzero_dev.rs118 buf: &mut [u8], in read_at() argument
137 buf: &[u8], in write_at() argument

12