Home
last modified time | relevance | path

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

12345678

/DragonOS/kernel/src/driver/disk/ahci/
H A 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;
83 pub _rsv: [u8; 116], // 0x2C - 0x9F, Reserved
84 pub vendor: [u8; 96], // 0xA0 - 0xFF, Vendor specific registers
103 pub cfis: [u8; 64], // Command FIS
[all …]
H A Dahcidisk.rs43 pub ctrl_num: u8,
44 pub port_num: u8,
74 buf: &mut [u8], in read_at() argument
107 cmdheader.cfl = (size_of::<FisRegH2D>() / size_of::<u32>()) as u8; in read_at()
113 let mut buf_ptr = buf as *mut [u8] as *mut usize as usize; in read_at()
120 let x: Vec<u8> = vec![0; buf.len()]; in read_at()
170 ((&mut cmdtbl.cfis) as *mut [u8] as *mut usize as *mut FisRegH2D) in read_at()
174 volatile_write!(cmdfis.fis_type, FisType::RegH2D as u8); in read_at()
178 volatile_write!(cmdfis.lba0, (lba_id_start & 0xFF) as u8); in read_at()
179 volatile_write!(cmdfis.lba1, ((lba_id_start >> 8) & 0xFF) as u8); in read_at()
[all …]
/DragonOS/kernel/src/driver/pci/
H A Dpci.rs145 class_code: u8, in get_pci_device_structure_mut() argument
146 subclass: u8, in get_pci_device_structure_mut() argument
174 class_code: u8, in get_pci_device_structure() argument
175 subclass: u8, in get_pci_device_structure() argument
188 const BAR0_OFFSET: u8 = 0x10;
190 const STATUS_COMMAND_OFFSET: u8 = 0x04;
192 pub const PCI_CAP_ID_VNDR: u8 = 0x09;
193 pub const PCI_CAP_ID_MSI: u8 = 0x05;
194 pub const PCI_CAP_ID_MSIX: u8 = 0x11;
267 Unrecognised(u8),
[all …]
H A Decam.rs21 pub bus_begin: u8,
23 pub bus_end: u8,
31 bus_begin: u8, in new() argument
32 bus_end: u8, in new() argument
H A Dattr.rs50 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
60 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
81 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
91 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
112 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
122 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
143 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
153 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
/DragonOS/kernel/src/arch/x86_64/driver/apic/
H A Dioapic.rs58 pub const VECTOR_BASE: u8 = 32;
143 unsafe fn read(&mut self, reg: u8) -> u32 { in read()
155 unsafe fn write(&mut self, reg: u8, data: u32) { in write() argument
162 fn write_rte(&mut self, rte_index: u8, vector: u8, flags: RedirectionEntry, dest: u8) { in write_rte() argument
171 pub fn enable(&mut self, rte_index: u8) { in enable() argument
177 pub fn disable(&mut self, rte_index: u8) { in disable() argument
198 rte_index: u8, in install() argument
199 vector: u8, in install() argument
200 dest: u8, in install() argument
236 pub fn irq_vector(&mut self, irq: u8) -> u8 { in irq_vector() argument
[all …]
/DragonOS/kernel/src/syscall/
H A Duser_access.rs32 let p = dest.data() as *mut u8; in clear_user()
38 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user()
41 let p = dest.data() as *mut u8; in copy_to_user()
48 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() argument
51 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() constant
76 user: *const u8, in check_and_clone_cstr() argument
120 pub fn check_and_clone_cstr_array(user: *const *const u8) -> Result<Vec<CString>, SystemError> { in check_and_clone_cstr_array()
128 let str_ptr: *const u8; in check_and_clone_cstr_array() constant
132 let mut dst = core::mem::transmute::<[usize; 1], [u8; size_of::<usize>()]>(dst); in check_and_clone_cstr_array()
134 let dst = core::mem::transmute::<[u8; size_of::<usize>()], [usize; 1]>(dst); in check_and_clone_cstr_array()
[all …]
H A Dmod.rs90 Self::put_string(args[0] as *const u8, args[1] as u32, args[2] as u32) in handle() constant
94 let path = args[0] as *const u8; in handle() constant
103 let oldname: *const u8 = args[0] as *const u8; in handle() constant
104 let newname: *const u8 = args[1] as *const u8; in handle() constant
117 let oldname: *const u8 = args[1] as *const u8; in handle() constant
119 let newname: *const u8 = args[3] as *const u8; in handle() constant
125 let oldname: *const u8 = args[1] as *const u8; in handle() constant
127 let newname: *const u8 = args[3] as *const u8; in handle() constant
134 let path = args[1] as *const u8; in handle() constant
150 UserBufferWriter::new(buf_vaddr as *mut u8, len, from_user)?; in handle()
[all …]
/DragonOS/kernel/src/libs/
H A Dkeyboard_parser.rs4 pub const NUM_SCAN_CODES: u8 = 0x80;
6 pub const TYPE1_KEYCODE_MAP_TABLE_COLS: u8 = 2;
9 pub const TYPE1_KEYCODE_FLAG_BREAK: u8 = 0x80; // 用于判断按键是否被按下
12 #[repr(u8)]
42 pub fn parse(&mut self, scancode: u8) -> TypeOneFSMState { in parse()
54 PauseBreak(u8),
60 PrtscPress(u8),
61 PrtscRelease(u8),
66 fn parse(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in parse() argument
89 fn handle_start(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in handle_start() argument
[all …]
H A Dvec_cursor.rs14 data: Vec<u8>,
21 pub fn new(data: Vec<u8>) -> Self { in new()
36 pub fn get_mut(&mut self) -> &mut Vec<u8> { in get_mut() argument
41 pub fn get_ref(&self) -> &Vec<u8> { in get_ref() argument
46 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8() argument
102 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact()
151 pub fn write_u8(&mut self, value: u8) -> Result<u8, SystemError> { in write_u8() argument
168 self.data[self.pos] = (value & 0xff) as u8; in write_u16()
170 self.data[self.pos] = ((value >> 8) & 0xff) as u8; in write_u16()
183 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
[all …]
/DragonOS/kernel/src/mm/allocator/
H A Dkernel_allocator.rs24 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8; in local_alloc() argument
25 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8; in local_alloc_zeroed() argument
26 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() argument
32 unsafe fn alloc_in_buddy(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { in alloc_in_buddy() argument
47 virt_addr.data() as *mut u8, in alloc_in_buddy()
54 unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy() argument
65 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8 { in local_alloc() argument
79 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8 { in local_alloc_zeroed() argument
84 let ptr: *mut u8 = x.as_mut_ptr(); in local_alloc_zeroed()
97 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc() argument
[all …]
H A Dbuddy.rs95 core::ptr::write_bytes(MMArch::phys_2_virt(*f)?.data() as *mut u8, 0, A::PAGE_SIZE); in new()
143 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
154 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
170 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
217 fn order2index(order: u8) -> usize { in order2index()
226 fn pop_front(&mut self, order: u8) -> Option<PhysAddr> { in pop_front()
227 let mut alloc_in_specific_order = |spec_order: u8| { in pop_front()
245 self.buddy_free(page_list_addr, MMArch::PAGE_SHIFT as u8); in pop_front()
288 unsafe { self.buddy_free(page_list_addr, MMArch::PAGE_SHIFT as u8) }; in pop_front()
316 x = alloc_in_specific_order(current_order as u8); in pop_front()
[all …]
/DragonOS/kernel/src/driver/net/
H A Dsysfs.rs105 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
132 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
154 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
176 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
180 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
202 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
224 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
246 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
273 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
302 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
[all …]
/DragonOS/kernel/src/driver/video/fbdev/base/
H A Dfbsysfs.rs64 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
88 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
93 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
119 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
142 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
147 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
169 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
174 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
195 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
203 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
[all …]
/DragonOS/kernel/src/driver/virtio/
H A 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
82 unsafe fn mmio_phys_to_virt(paddr: virtio_drivers::PhysAddr, _size: usize) -> NonNull<u8> { in mmio_phys_to_virt() argument
89 buffer: NonNull<[u8]>, in share() argument
92 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
100 _buffer: NonNull<[u8]>, in unshare() argument
/DragonOS/kernel/src/filesystem/fat/
H A 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 …]
/DragonOS/kernel/crates/multiboot/src/
H A Dlib.rs40 pub drive: u8,
42 pub partition1: u8,
44 pub partition2: u8,
46 pub partition3: u8,
182 symbols: [u8; 16],
295 pub bpp: u8,
296 pub typ: u8,
387 pub red_field_position: u8,
388 pub red_mask_size: u8,
389 pub green_field_position: u8,
[all …]
/DragonOS/kernel/src/process/
H A Dpid.rs3 #[repr(u8)]
16 *self as u8 == *other as u8 in eq()
/DragonOS/kernel/src/driver/tty/tty_ldisc/
H A Dmod.rs31 buf: &mut [u8], in read() argument
40 buf: &[u8], in write() argument
58 buf: &[u8], in receive_buf() argument
59 flags: Option<&[u8]>, in receive_buf() argument
67 buf: &[u8], in receive_buf2() argument
68 flags: Option<&[u8]>, in receive_buf2() argument
84 pub fn from_line(line: u8) -> Self { in from_line()
/DragonOS/kernel/src/arch/x86_64/pci/
H A Dpci.rs23 fn read_config_early(bus: u8, slot: u8, func: u8, offset: u8) -> u8 { in read_config_early() argument
40 fn read_config(bus_device_function: &BusDeviceFunction, offset: u8) -> u32 { in read_config()
55 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32) { in write_config() argument
/DragonOS/kernel/src/filesystem/kernfs/
H A Dcallback.rs20 buf: &mut [u8], in read() argument
27 buf: &[u8], in write() argument
68 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument
76 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument
93 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument
102 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument
/DragonOS/kernel/src/driver/block/cache/
H A Dcache_block.rs21 data: Box<[u8]>,
27 pub fn new(data: Box<[u8]>, flag: CacheBlockFlag, lba_id: BlockId) -> Self { in new() argument
35 pub fn from_data(lba_id: BlockId, data: Vec<u8>) -> Self { in from_data()
43 pub fn data(&self, buf: &mut [u8]) -> Result<usize, BlockCacheError> { in data()
/DragonOS/kernel/src/driver/net/e1000e/
H A De1000e.rs28 const NETWORK_CLASS: u8 = 0x2;
29 const ETHERNET_SUBCLASS: u8 = 0x0;
53 const E1000E_BAR_REG_ALIGN: u8 = 64;
56 const E1000E_REG_SIZE: u8 = 4;
73 cso: u8,
74 cmd: u8,
75 status: u8,
76 css: u8,
77 special: u8,
87 error: u8,
[all …]
/DragonOS/kernel/src/filesystem/sysfs/
H A Dmod.rs69 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument
83 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument
133 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show()
137 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store()
148 _buf: &[u8], in write() argument
157 _buf: &mut [u8], in read() argument
180 buf: &mut [u8], in show() argument
187 buf: &[u8], in store() argument
192 pub struct SysFSOpsSupport: u8{
/DragonOS/kernel/src/net/
H A Dmod.rs33 pub struct ShutdownType: u8 {
71 #[repr(u8)]
83 Unknown(u8),
106 let x: u8 = value.into(); in from()
111 impl From<u8> for Protocol {
112 fn from(value: u8) -> Self { in from()
129 impl From<Protocol> for u8 { implementation

12345678