/DragonOS-0.1.9/kernel/src/arch/x86_64/kvm/vmx/ |
D | vmx_asm_wrapper.rs | 4 use system_error::SystemError; 7 pub fn vmxon(vmxon_pa: u64) -> Result<(), SystemError> { in vmxon() argument 12 Err(SystemError::EVMXONFailed) in vmxon() 18 pub fn vmxoff() -> Result<(), SystemError> { in vmxoff() 21 Err(_) => Err(SystemError::EVMXOFFFailed), in vmxoff() 26 pub fn vmx_vmwrite(vmcs_field: u32, value: u64) -> Result<(), SystemError> { in vmx_vmwrite() argument 32 Err(SystemError::EVMWRITEFailed) in vmx_vmwrite() 38 pub fn vmx_vmread(vmcs_field: u32) -> Result<u64, SystemError> { in vmx_vmread() argument 43 Err(SystemError::EVMREADFailed) in vmx_vmread() 48 pub fn vmx_vmptrld(vmcs_pa: u64) -> Result<(), SystemError> { in vmx_vmptrld() argument [all …]
|
/DragonOS-0.1.9/kernel/src/arch/riscv64/interrupt/ |
D | handle.rs | 3 use system_error::SystemError; 9 type ExceptionHandler = fn(&mut TrapFrame) -> Result<(), SystemError>; 67 fn default_handler(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in default_handler() argument 75 fn do_trap_insn_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_misaligned() argument 83 fn do_trap_insn_access_fault(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_access_fault() argument 91 fn do_trap_insn_illegal(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_illegal() argument 99 fn do_trap_break(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_break() argument 107 fn do_trap_load_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_load_misaligned() argument 115 fn do_trap_load_access_fault(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_load_access_fault() argument 123 fn do_trap_store_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_store_misaligned() argument [all …]
|
/DragonOS-0.1.9/kernel/src/driver/tty/tty_ldisc/ |
D | mod.rs | 4 use system_error::SystemError; 16 fn open(&self, tty: Arc<TtyCore>) -> Result<(), SystemError>; in open() argument 17 fn close(&self, tty: Arc<TtyCore>) -> Result<(), SystemError>; in close() argument 18 fn flush_buffer(&self, tty: Arc<TtyCore>) -> Result<(), SystemError>; in flush_buffer() argument 36 ) -> Result<usize, SystemError>; in read() argument 43 ) -> Result<usize, SystemError>; in write() argument 44 fn ioctl(&self, tty: Arc<TtyCore>, cmd: u32, arg: usize) -> Result<usize, SystemError>; in ioctl() argument 49 fn set_termios(&self, tty: Arc<TtyCore>, old: Option<Termios>) -> Result<(), SystemError>; in set_termios() argument 51 fn poll(&self, tty: Arc<TtyCore>) -> Result<usize, SystemError>; in poll() argument 52 fn hangup(&self, tty: Arc<TtyCore>) -> Result<(), SystemError>; in hangup() argument [all …]
|
/DragonOS-0.1.9/kernel/src/filesystem/vfs/ |
D | mod.rs | 12 use system_error::SystemError; 123 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 125 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in open() 132 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 134 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in close() 152 ) -> Result<usize, SystemError>; in read_at() argument 169 ) -> Result<usize, SystemError>; in write_at() argument 174 fn poll(&self, _private_data: &FilePrivateData) -> Result<usize, SystemError> { in poll() argument 176 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in poll() 183 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument [all …]
|
D | syscall.rs | 8 use system_error::SystemError; 255 ) -> Result<usize, SystemError> { in open() argument 265 ) -> Result<usize, SystemError> { in openat() argument 274 pub fn close(fd: usize) -> Result<usize, SystemError> { in close() argument 290 pub fn ioctl(fd: usize, cmd: u32, data: usize) -> Result<usize, SystemError> { in ioctl() argument 296 .ok_or(SystemError::EBADF)?; in ioctl() 312 pub fn read(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in read() argument 318 return Err(SystemError::EBADF); in read() 334 pub fn write(fd: i32, buf: &[u8]) -> Result<usize, SystemError> { in write() argument 340 .ok_or(SystemError::EBADF)?; in write() [all …]
|
D | core.rs | 4 use system_error::SystemError; 52 pub fn vfs_init() -> Result<(), SystemError> { in vfs_init() 95 ) -> Result<(), SystemError> { in do_migrate() argument 117 fn migrate_virtual_filesystem(new_fs: Arc<dyn FileSystem>) -> Result<(), SystemError> { in migrate_virtual_filesystem() argument 150 pub fn mount_root_fs() -> Result<(), SystemError> { in mount_root_fs() 159 let fatfs: Result<Arc<FATFileSystem>, SystemError> = FATFileSystem::new(partiton); in mount_root_fs() 183 pub fn do_mkdir(path: &str, _mode: FileMode) -> Result<u64, SystemError> { in do_mkdir() argument 186 return Err(SystemError::ENAMETOOLONG); in do_mkdir() 189 let inode: Result<Arc<dyn IndexNode>, SystemError> = ROOT_INODE().lookup(path); in do_mkdir() 194 if errno == SystemError::ENOENT { in do_mkdir() [all …]
|
D | mount.rs | 10 use system_error::SystemError; 113 fn is_mountpoint_root(&self) -> Result<bool, SystemError> { in is_mountpoint_root() argument 135 fn open(&self, data: &mut FilePrivateData, mode: &FileMode) -> Result<(), SystemError> { in open() argument 139 fn close(&self, data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 149 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data() argument 160 fn truncate(&self, len: usize) -> Result<(), SystemError> { in truncate() argument 170 ) -> Result<usize, SystemError> { in read_at() argument 180 ) -> Result<usize, SystemError> { in write_at() argument 195 fn metadata(&self) -> Result<super::Metadata, SystemError> { in metadata() argument 200 fn set_metadata(&self, metadata: &super::Metadata) -> Result<(), SystemError> { in set_metadata() argument [all …]
|
/DragonOS-0.1.9/kernel/src/libs/ |
D | vec_cursor.rs | 6 use system_error::SystemError; 46 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8() argument 48 return Err(SystemError::E2BIG); in read_u8() 55 pub fn read_u16(&mut self) -> Result<u16, SystemError> { in read_u16() argument 57 return Err(SystemError::E2BIG); in read_u16() 69 pub fn read_u32(&mut self) -> Result<u32, SystemError> { in read_u32() argument 71 return Err(SystemError::E2BIG); in read_u32() 83 pub fn read_u64(&mut self) -> Result<u64, SystemError> { in read_u64() argument 85 return Err(SystemError::E2BIG); in read_u64() 102 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact() argument [all …]
|
/DragonOS-0.1.9/kernel/src/driver/tty/ |
D | console.rs | 1 use system_error::SystemError; 10 fn con_init(&self, vc_data: &mut VirtualConsoleData, init: bool) -> Result<(), SystemError>; in con_init() argument 13 fn con_deinit(&self) -> Result<(), SystemError>; in con_deinit() argument 30 ) -> Result<(), SystemError>; in con_clear() argument 44 ) -> Result<(), SystemError>; in con_putc() argument 60 ) -> Result<(), SystemError>; in con_putcs() argument 69 ) -> Result<(usize, usize, usize), SystemError> { in con_getxy() argument 70 return Err(SystemError::ENOSYS); in con_getxy() 97 ) -> Result<u8, SystemError> { in con_build_attr() argument 98 return Err(SystemError::ENOSYS); in con_build_attr() [all …]
|
/DragonOS-0.1.9/docs/kernel/libs/lib_ui/ |
D | scm.md | 15 fn install(&self) -> Result<i32, SystemError> { 16 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); 19 fn uninstall(&self) -> Result<i32, SystemError> { 20 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); 23 fn enable(&self) -> Result<i32, SystemError> { 24 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); 27 fn disable(&self) -> Result<i32, SystemError> { 28 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); 31 fn change(&self, _buf: ScmBufferInfo) -> Result<i32, SystemError> { 32 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); [all …]
|
/DragonOS-0.1.9/kernel/src/syscall/ |
D | user_access.rs | 12 use super::SystemError; 28 pub unsafe fn clear_user(dest: VirtAddr, len: usize) -> Result<usize, SystemError> { in clear_user() argument 29 verify_area(dest, len).map_err(|_| SystemError::EFAULT)?; in clear_user() 37 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() argument 38 verify_area(dest, src.len()).map_err(|_| SystemError::EFAULT)?; in copy_to_user() 47 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() argument 48 verify_area(src, dst.len()).map_err(|_| SystemError::EFAULT)?; in copy_from_user() 76 ) -> Result<String, SystemError> { in check_and_clone_cstr() argument 98 return Ok(String::from_utf8(buffer).map_err(|_| SystemError::EFAULT)?); in check_and_clone_cstr() 115 pub fn check_and_clone_cstr_array(user: *const *const u8) -> Result<Vec<String>, SystemError> { in check_and_clone_cstr_array() argument [all …]
|
/DragonOS-0.1.9/kernel/src/driver/input/serio/ |
D | serio_device.rs | 2 use system_error::SystemError; 23 fn write(&self, device: &Arc<dyn SerioDevice>, data: u8) -> Result<(), SystemError>; in write() argument 25 fn open(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in open() argument 27 fn close(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in close() argument 29 fn start(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in start() argument 31 fn stop(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in stop() argument 50 pub fn register_port(&self, device: Arc<dyn SerioDevice>) -> Result<(), SystemError> { in register_port() argument 64 pub fn init_port(&self, device: Arc<dyn SerioDevice>) -> Result<(), SystemError> { in init_port() argument
|
D | serio_driver.rs | 2 use system_error::SystemError; 16 fn write_wakeup(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in write_wakeup() argument 34 ) -> Result<(), SystemError>; in interrupt() argument 36 fn connect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in connect() argument 38 fn reconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in reconnect() argument 40 fn fast_reconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in fast_reconnect() argument 42 fn disconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in disconnect() argument 44 fn cleanup(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in cleanup() argument 66 pub fn register(&self, driver: Arc<dyn SerioDriver>) -> Result<(), SystemError> { in register() argument
|
/DragonOS-0.1.9/kernel/src/filesystem/kernfs/ |
D | mod.rs | 9 use system_error::SystemError; 145 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 155 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 159 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument 163 fn set_metadata(&self, _metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument 165 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in set_metadata() 168 fn resize(&self, _len: usize) -> Result<(), SystemError> { in resize() argument 178 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data() argument 180 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in create_with_data() 183 fn link(&self, _name: &str, _other: &Arc<dyn IndexNode>) -> Result<(), SystemError> { in link() argument [all …]
|
D | callback.rs | 7 use system_error::SystemError; 15 fn open(&self, data: KernCallbackData) -> Result<(), SystemError>; in open() argument 22 ) -> Result<usize, SystemError>; in read() argument 29 ) -> Result<usize, SystemError>; in write() argument 31 fn poll(&self, data: KernCallbackData) -> Result<PollStatus, SystemError>; in poll() argument 68 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument 73 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in callback_read() 76 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument 81 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in callback_write() 93 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument [all …]
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/kvm/ |
D | mod.rs | 13 use system_error::SystemError; 32 pub fn kvm_arch_cpu_supports_vm() -> Result<(), SystemError> { in kvm_arch_cpu_supports_vm() 37 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in kvm_arch_cpu_supports_vm() 44 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in kvm_arch_cpu_supports_vm() 51 pub fn kvm_arch_init() -> Result<(), SystemError> { in kvm_arch_init() 55 pub fn kvm_arch_dev_ioctl(cmd: u32, _arg: usize) -> Result<usize, SystemError> { in kvm_arch_dev_ioctl() argument 59 return Err(SystemError::EINVAL); in kvm_arch_dev_ioctl() 64 pub fn kvm_arch_vcpu_create(id: u32) -> Result<Arc<Mutex<VmxVcpu>>, SystemError> { in kvm_arch_vcpu_create() argument 70 pub fn kvm_arch_vcpu_setup(vcpu: &Mutex<VmxVcpu>) -> Result<(), SystemError> { in kvm_arch_vcpu_setup() argument 75 pub fn kvm_arch_vcpu_ioctl_run(_vcpu: &Mutex<VmxVcpu>) -> Result<(), SystemError> { in kvm_arch_vcpu_ioctl_run() argument
|
/DragonOS-0.1.9/kernel/src/driver/video/fbdev/base/ |
D | fbsysfs.rs | 2 use system_error::SystemError; 63 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument 65 let fb = fb_dev.framebuffer().ok_or(SystemError::ENODEV)?; in show() 87 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument 89 return Err(SystemError::ENOSYS); in store() 92 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument 94 let fb = fb_dev.framebuffer().ok_or(SystemError::ENODEV)?; in show() 118 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument 120 return Err(SystemError::ENOSYS); in store() 141 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument [all …]
|
/DragonOS-0.1.9/kernel/src/filesystem/ramfs/ |
D | mod.rs | 10 use system_error::SystemError; 124 fn truncate(&self, len: usize) -> Result<(), SystemError> { in truncate() argument 129 return Err(SystemError::EINVAL); in truncate() 139 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 147 ) -> Result<(), SystemError> { in open() argument 157 ) -> Result<usize, SystemError> { in read_at() argument 159 return Err(SystemError::EINVAL); in read_at() 166 return Err(SystemError::EISDIR); in read_at() 174 return Err(SystemError::ENOBUFS); in read_at() 189 ) -> Result<usize, SystemError> { in write_at() argument [all …]
|
/DragonOS-0.1.9/kernel/src/exception/ |
D | irqchip.rs | 8 use system_error::SystemError; 40 fn irq_startup(&self, _irq: &Arc<IrqData>) -> Result<(), SystemError> { in irq_startup() argument 41 Err(SystemError::ENOSYS) in irq_startup() 45 fn irq_shutdown(&self, _irq: &Arc<IrqData>) -> Result<(), SystemError> { in irq_shutdown() argument 46 Err(SystemError::ENOSYS) in irq_shutdown() 52 fn irq_enable(&self, _irq: &Arc<IrqData>) -> Result<(), SystemError> { in irq_enable() argument 53 Err(SystemError::ENOSYS) in irq_enable() 69 fn irq_mask(&self, _irq: &Arc<IrqData>) -> Result<(), SystemError> { in irq_mask() argument 70 Err(SystemError::ENOSYS) in irq_mask() 84 fn irq_unmask(&self, _irq: &Arc<IrqData>) -> Result<(), SystemError> { in irq_unmask() argument [all …]
|
D | resend.rs | 1 use system_error::SystemError; 18 ) -> Result<(), SystemError> { in irq_check_and_resend() argument 33 return Err(SystemError::EINVAL); in irq_check_and_resend() 40 return Err(SystemError::EBUSY); in irq_check_and_resend() 59 ret = Err(SystemError::EINVAL); in irq_check_and_resend() 74 ) -> Result<(), SystemError> { in try_retrigger() argument 81 if e != SystemError::ENOSYS { in try_retrigger()
|
/DragonOS-0.1.9/kernel/src/driver/disk/ahci/ |
D | ahci_inode.rs | 15 use system_error::SystemError; 79 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 80 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in open() 83 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 84 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in close() 87 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument 95 fn list(&self) -> Result<Vec<String>, SystemError> { in list() argument 96 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in list() 99 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument 118 ) -> Result<usize, SystemError> { in read_at() argument [all …]
|
/DragonOS-0.1.9/kernel/src/filesystem/sysfs/ |
D | file.rs | 7 use system_error::SystemError; 60 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 109 ) -> Result<(), SystemError> { in create_file() argument 110 let inode = kobj.inode().ok_or(SystemError::EINVAL)?; in create_file() 120 ) -> Result<(), SystemError> { in add_file_with_mode() argument 134 SystemError::EINVAL in add_file_with_mode() 164 if e == SystemError::EEXIST { in add_file_with_mode() 208 ) -> Result<(), SystemError> { in create_bin_file() argument 209 let inode = kobj.inode().ok_or(SystemError::EINVAL)?; in create_bin_file() [all …]
|
D | mod.rs | 16 use system_error::SystemError; 33 pub fn sysfs_init() -> Result<(), SystemError> { in sysfs_init() 69 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument 77 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in callback_read() 83 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument 89 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in callback_write() 127 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument 128 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in show() 131 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument 132 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in store() [all …]
|
/DragonOS-0.1.9/kernel/src/process/ |
D | syscall.rs | 8 use system_error::SystemError; 33 pub fn fork(frame: &TrapFrame) -> Result<usize, SystemError> { in fork() argument 37 pub fn vfork(frame: &TrapFrame) -> Result<usize, SystemError> { in vfork() argument 55 ) -> Result<(), SystemError> { in execve() argument 68 return Err(SystemError::EINVAL); in execve() 77 let r: Result<(String, Vec<String>, Vec<String>), SystemError> = x(); in execve() 104 ) -> Result<usize, SystemError> { in wait4() argument 105 let options = WaitOption::from_bits(options as u32).ok_or(SystemError::EINVAL)?; in wait4() 146 pub fn getpid() -> Result<Pid, SystemError> { in getpid() 157 pub fn getpgid(mut pid: Pid) -> Result<Pid, SystemError> { in getpgid() argument [all …]
|
/DragonOS-0.1.9/kernel/src/net/ |
D | syscall.rs | 6 use system_error::SystemError; 39 ) -> Result<usize, SystemError> { in socket() argument 73 ) -> Result<usize, SystemError> { in socketpair() argument 89 let mut alloc_fd = |socket: Box<dyn Socket>| -> Result<i32, SystemError> { in socketpair() 114 ) -> Result<usize, SystemError> { in setsockopt() argument 117 .ok_or(SystemError::EBADF)?; in setsockopt() 138 ) -> Result<usize, SystemError> { in getsockopt() argument 143 .ok_or(SystemError::EBADF)?; in getsockopt() 148 .map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt() 168 return Err(SystemError::ENOPROTOOPT); in getsockopt() [all …]
|