Home
last modified time | relevance | path

Searched refs:SystemError (Results 1 – 25 of 296) sorted by relevance

12345678910>>...12

/DragonOS/kernel/src/libs/
H A Dvec_cursor.rs6 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/kernel/src/filesystem/vfs/
H A Dmod.rs12 use system_error::SystemError;
128 fn mmap(&self, _start: usize, _len: usize, _offset: usize) -> Result<(), SystemError> { in mmap() argument
129 return Err(SystemError::ENOSYS); in mmap()
139 ) -> Result<(), SystemError> { in open() argument
141 return Err(SystemError::ENOSYS); in open()
148 fn close(&self, _data: SpinLockGuard<FilePrivateData>) -> Result<(), SystemError> { in close() argument
150 return Err(SystemError::ENOSYS); in close()
168 ) -> Result<usize, SystemError>; in read_at() argument
185 ) -> Result<usize, SystemError>; in write_at() argument
190 fn poll(&self, _private_data: &FilePrivateData) -> Result<usize, SystemError> { in poll() argument
[all …]
H A Dsyscall.rs7 use system_error::SystemError;
489 ) -> Result<usize, SystemError> { in open() argument
492 .map_err(|_| SystemError::EINVAL)?; in open()
494 let open_flags: FileMode = FileMode::from_bits(o_flags).ok_or(SystemError::EINVAL)?; in open()
495 let mode = ModeType::from_bits(mode).ok_or(SystemError::EINVAL)?; in open()
511 ) -> Result<usize, SystemError> { in openat() argument
514 .map_err(|_| SystemError::EINVAL)?; in openat()
516 let open_flags: FileMode = FileMode::from_bits(o_flags).ok_or(SystemError::EINVAL)?; in openat()
517 let mode = ModeType::from_bits(mode).ok_or(SystemError::EINVAL)?; in openat()
526 pub fn close(fd: usize) -> Result<usize, SystemError> { in close() argument
[all …]
H A Dmount.rs13 use system_error::SystemError;
114 pub fn umount(&self) -> Result<Arc<MountFS>, SystemError> { in umount() argument
117 .ok_or(SystemError::EINVAL)? in umount()
147 fn is_mountpoint_root(&self) -> Result<bool, SystemError> { in is_mountpoint_root() argument
167 fn do_find(&self, name: &str) -> Result<Arc<MountFSInode>, SystemError> { in do_find() argument
179 pub(super) fn do_parent(&self) -> Result<Arc<MountFSInode>, SystemError> { in do_parent() argument
207 fn do_umount(&self) -> Result<Arc<MountFS>, SystemError> { in do_umount() argument
209 return Err(SystemError::ENOTDIR); in do_umount()
216 .ok_or(SystemError::ENOENT); in do_umount()
219 fn do_absolute_path(&self) -> Result<String, SystemError> { in do_absolute_path() argument
[all …]
H A Dcore.rs5 use system_error::SystemError;
60 pub fn vfs_init() -> Result<(), SystemError> { in vfs_init()
85 fn migrate_virtual_filesystem(new_fs: Arc<dyn FileSystem>) -> Result<(), SystemError> { in migrate_virtual_filesystem() argument
132 pub fn mount_root_fs() -> Result<(), SystemError> { in mount_root_fs()
142 .ok_or(SystemError::ENODEV)? in mount_root_fs()
145 let fatfs: Result<Arc<FATFileSystem>, SystemError> = FATFileSystem::new(gendisk); in mount_root_fs()
173 ) -> Result<Arc<dyn IndexNode>, SystemError> { in do_mkdir_at() argument
187 pub fn do_remove_dir(dirfd: i32, path: &str) -> Result<u64, SystemError> { in do_remove_dir() argument
196 return Err(SystemError::EINVAL); in do_remove_dir()
204 return Err(SystemError::ENOTDIR); in do_remove_dir()
[all …]
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/
H A Dvmx_asm_wrapper.rs5 use system_error::SystemError;
8 pub fn vmxon(vmxon_pa: u64) -> Result<(), SystemError> { in vmxon() argument
13 Err(SystemError::EVMXONFailed) in vmxon()
19 pub fn vmxoff() -> Result<(), SystemError> { in vmxoff()
22 Err(_) => Err(SystemError::EVMXOFFFailed), in vmxoff()
27 pub fn vmx_vmwrite(vmcs_field: u32, value: u64) -> Result<(), SystemError> { in vmx_vmwrite() argument
33 Err(SystemError::EVMWRITEFailed) in vmx_vmwrite()
39 pub fn vmx_vmread(vmcs_field: u32) -> Result<u64, SystemError> { in vmx_vmread() argument
44 Err(SystemError::EVMREADFailed) in vmx_vmread()
49 pub fn vmx_vmptrld(vmcs_pa: u64) -> Result<(), SystemError> { in vmx_vmptrld() argument
[all …]
/DragonOS/kernel/src/driver/tty/tty_ldisc/
H A Dmod.rs4 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/kernel/src/syscall/
H A Duser_access.rs13 use super::SystemError;
29 pub unsafe fn clear_user(dest: VirtAddr, len: usize) -> Result<usize, SystemError> { in clear_user() argument
30 verify_area(dest, len).map_err(|_| SystemError::EFAULT)?; in clear_user()
38 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() argument
39 verify_area(dest, src.len()).map_err(|_| SystemError::EFAULT)?; in copy_to_user()
48 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() argument
49 verify_area(src, dst.len()).map_err(|_| SystemError::EFAULT)?; in copy_from_user()
78 ) -> Result<CString, SystemError> { in check_and_clone_cstr() argument
80 return Err(SystemError::EFAULT); in check_and_clone_cstr()
98 buffer.push(NonZero::new(c[0]).ok_or(SystemError::EINVAL)?); in check_and_clone_cstr()
[all …]
/DragonOS/docs/kernel/libs/lib_ui/
H A Dscm.md15 fn install(&self) -> Result<i32, SystemError> {
16 return Err(SystemError::ENOSYS);
19 fn uninstall(&self) -> Result<i32, SystemError> {
20 return Err(SystemError::ENOSYS);
23 fn enable(&self) -> Result<i32, SystemError> {
24 return Err(SystemError::ENOSYS);
27 fn disable(&self) -> Result<i32, SystemError> {
28 return Err(SystemError::ENOSYS);
31 fn change(&self, _buf: ScmBufferInfo) -> Result<i32, SystemError> {
32 return Err(SystemError::ENOSYS);
[all …]
/DragonOS/kernel/src/arch/riscv64/interrupt/
H A Dhandle.rs7 use system_error::SystemError;
13 type ExceptionHandler = fn(&mut TrapFrame) -> Result<(), SystemError>;
64 fn default_handler(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in default_handler() argument
72 fn do_trap_insn_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_misaligned() argument
80 fn do_trap_insn_access_fault(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_access_fault() argument
88 fn do_trap_insn_illegal(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_insn_illegal() argument
96 fn do_trap_break(trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_break() argument
103 fn do_trap_load_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_load_misaligned() argument
111 fn do_trap_load_access_fault(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_load_access_fault() argument
119 fn do_trap_store_misaligned(_trap_frame: &mut TrapFrame) -> Result<(), SystemError> { in do_trap_store_misaligned() argument
[all …]
/DragonOS/kernel/src/driver/rtc/
H A Dinterface.rs2 use system_error::SystemError;
9 pub fn rtc_read_time(general_dev: &Arc<RtcGeneralDevice>) -> Result<RtcTime, SystemError> { in rtc_read_time() argument
10 let class_ops = general_dev.class_ops().ok_or(SystemError::EINVAL)?; in rtc_read_time()
15 .ok_or(SystemError::ENODEV)?; in rtc_read_time()
17 let real_dev = kobj2rtc_device(real_dev).ok_or(SystemError::EINVAL)?; in rtc_read_time()
22 return Err(SystemError::EINVAL); in rtc_read_time()
29 pub fn rtc_read_time_default() -> Result<RtcTime, SystemError> { in rtc_read_time_default()
30 rtc_read_time(&global_default_rtc().ok_or(SystemError::ENODEV)?) in rtc_read_time_default()
/DragonOS/kernel/src/driver/tty/
H A Dconsole.rs2 use system_error::SystemError;
17 ) -> Result<(), SystemError>; in con_init() argument
21 fn con_deinit(&self) -> Result<(), SystemError>; in con_deinit() argument
38 ) -> Result<(), SystemError>; in con_clear() argument
52 ) -> Result<(), SystemError>; in con_putc() argument
68 ) -> Result<(), SystemError>; in con_putcs() argument
77 ) -> Result<(usize, usize, usize), SystemError> { in con_getxy() argument
78 return Err(SystemError::ENOSYS); in con_getxy()
106 ) -> Result<u8, SystemError> { in con_build_attr() argument
107 return Err(SystemError::ENOSYS); in con_build_attr()
[all …]
/DragonOS/kernel/src/arch/riscv64/init/
H A Ddragonstub.rs2 use system_error::SystemError;
9 pub(super) fn early_dragonstub_init() -> Result<(), SystemError> { in early_dragonstub_init()
17 fn init_bootloader_name(&self) -> Result<Option<String>, SystemError> { in init_bootloader_name() argument
21 fn init_acpi_args(&self) -> Result<BootloaderAcpiArg, SystemError> { in init_acpi_args() argument
25 fn init_kernel_cmdline(&self) -> Result<(), SystemError> { in init_kernel_cmdline() argument
33 ) -> Result<(), SystemError> { in early_init_framebuffer_info() argument
37 fn early_init_memory_blocks(&self) -> Result<(), SystemError> { in early_init_memory_blocks() argument
/DragonOS/kernel/src/filesystem/kernfs/
H A Dmod.rs10 use system_error::SystemError;
162 ) -> Result<(), SystemError> { in open() argument
172 fn close(&self, _data: SpinLockGuard<FilePrivateData>) -> Result<(), SystemError> { in close() argument
176 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument
180 fn set_metadata(&self, _metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
182 return Err(SystemError::ENOSYS); in set_metadata()
185 fn resize(&self, _len: usize) -> Result<(), SystemError> { in resize() argument
195 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data() argument
197 return Err(SystemError::ENOSYS); in create_with_data()
200 fn link(&self, _name: &str, _other: &Arc<dyn IndexNode>) -> Result<(), SystemError> { in link() argument
[all …]
H A Dcallback.rs7 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::ENOSYS); in callback_read()
76 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() argument
81 return Err(SystemError::ENOSYS); in callback_write()
93 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() argument
[all …]
/DragonOS/kernel/src/driver/video/fbdev/base/
H A Dfbsysfs.rs3 use system_error::SystemError;
64 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
66 let fb = fb_dev.framebuffer().ok_or(SystemError::ENODEV)?; in show()
88 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
90 return Err(SystemError::ENOSYS); in store()
93 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
95 let fb = fb_dev.framebuffer().ok_or(SystemError::ENODEV)?; in show()
119 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
121 return Err(SystemError::ENOSYS); in store()
142 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
[all …]
/DragonOS/kernel/src/driver/input/serio/
H A Dserio_device.rs2 use system_error::SystemError;
24 fn write(&self, device: &Arc<dyn SerioDevice>, data: u8) -> Result<(), SystemError>; in write() argument
26 fn open(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in open() argument
28 fn close(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in close() argument
30 fn start(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in start() argument
32 fn stop(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in stop() argument
51 pub fn register_port(&self, device: Arc<dyn SerioDevice>) -> Result<(), SystemError> { in register_port() argument
65 pub fn init_port(&self, device: Arc<dyn SerioDevice>) -> Result<(), SystemError> { in init_port() argument
H A Dserio_driver.rs2 use system_error::SystemError;
17 fn write_wakeup(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in write_wakeup() argument
35 ) -> Result<(), SystemError>; in interrupt() argument
37 fn connect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in connect() argument
39 fn reconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in reconnect() argument
41 fn fast_reconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in fast_reconnect() argument
43 fn disconnect(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in disconnect() argument
45 fn cleanup(&self, device: &Arc<dyn SerioDevice>) -> Result<(), SystemError>; in cleanup() argument
67 pub fn register(&self, driver: Arc<dyn SerioDriver>) -> Result<(), SystemError> { in register() argument
/DragonOS/kernel/src/filesystem/overlayfs/
H A Dmod.rs18 use system_error::SystemError;
30 ) -> Result<Arc<dyn FileSystem + 'static>, SystemError>),
40 pub fn from_row(raw_data: *const u8) -> Result<Self, SystemError> { in from_row() argument
42 return Err(SystemError::EINVAL); in from_row()
46 .ok_or(SystemError::EINVAL)?; in from_row()
48 let raw_str = core::str::from_utf8(slice).map_err(|_| SystemError::EINVAL)?; in from_row()
57 let key = parts.next().ok_or(SystemError::EINVAL)?; in from_row()
58 let value = parts.next().ok_or(SystemError::EINVAL)?; in from_row()
64 _ => return Err(SystemError::EINVAL), in from_row()
151 ) -> Result<Arc<dyn FileSystem + 'static>, SystemError> { in make_overlayfs() argument
[all …]
/DragonOS/kernel/src/filesystem/ramfs/
H A Dmod.rs22 use system_error::SystemError;
158 ) -> Result<Arc<dyn FileSystem + 'static>, SystemError> { in make_ramfs() argument
169 ) -> Result<Arc<dyn FileSystem + 'static>, SystemError>),
173 fn truncate(&self, len: usize) -> Result<(), SystemError> { in truncate() argument
178 return Err(SystemError::EINVAL); in truncate()
188 fn close(&self, _data: SpinLockGuard<FilePrivateData>) -> Result<(), SystemError> { in close() argument
196 ) -> Result<(), SystemError> { in open() argument
206 ) -> Result<usize, SystemError> { in read_at() argument
208 return Err(SystemError::EINVAL); in read_at()
215 return Err(SystemError::EISDIR); in read_at()
[all …]
/DragonOS/kernel/src/driver/pci/
H A Dattr.rs4 use system_error::SystemError;
59 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
64 SystemError::EINVAL in show()
69 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
90 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
95 SystemError::EINVAL in show()
100 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
121 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
126 SystemError::EINVAL in show()
131 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
[all …]
/DragonOS/kernel/src/exception/
H A Dirqchip.rs9 use system_error::SystemError;
42 fn irq_startup(&self, _irq_data: &Arc<IrqData>) -> Result<(), SystemError> { in irq_startup() argument
43 Err(SystemError::ENOSYS) in irq_startup()
47 fn irq_shutdown(&self, _irq_data: &Arc<IrqData>) -> Result<(), SystemError> { in irq_shutdown() argument
48 Err(SystemError::ENOSYS) in irq_shutdown()
54 fn irq_enable(&self, _irq_data: &Arc<IrqData>) -> Result<(), SystemError> { in irq_enable() argument
55 Err(SystemError::ENOSYS) in irq_enable()
71 fn irq_mask(&self, _irq_data: &Arc<IrqData>) -> Result<(), SystemError> { in irq_mask() argument
72 Err(SystemError::ENOSYS) in irq_mask()
86 fn irq_unmask(&self, _irq_data: &Arc<IrqData>) -> Result<(), SystemError> { in irq_unmask() argument
[all …]
/DragonOS/kernel/src/net/
H A Dsyscall.rs6 use system_error::SystemError;
40 ) -> Result<usize, SystemError> { in socket() argument
69 ) -> Result<usize, SystemError> { in socketpair() argument
110 ) -> Result<usize, SystemError> { in setsockopt() argument
113 .ok_or(SystemError::EBADF)?; in setsockopt()
134 ) -> Result<usize, SystemError> { in getsockopt() argument
139 .ok_or(SystemError::EBADF)?; in getsockopt()
144 .map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt()
163 return Err(SystemError::ENOPROTOOPT); in getsockopt()
176 PosixIpProtocol::try_from(level as u16).map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt()
[all …]
/DragonOS/kernel/src/arch/x86_64/kvm/
H A Dmod.rs10 use system_error::SystemError;
29 pub fn kvm_arch_cpu_supports_vm() -> Result<(), SystemError> { in kvm_arch_cpu_supports_vm()
34 return Err(SystemError::ENOSYS); in kvm_arch_cpu_supports_vm()
41 return Err(SystemError::ENOSYS); in kvm_arch_cpu_supports_vm()
48 pub fn kvm_arch_init() -> Result<(), SystemError> { in kvm_arch_init()
53 pub fn kvm_arch_dev_ioctl(cmd: u32, _arg: usize) -> Result<usize, SystemError> { in kvm_arch_dev_ioctl() argument
55 return Err(SystemError::EINVAL); in kvm_arch_dev_ioctl()
58 pub fn kvm_arch_vcpu_create(id: u32) -> Result<Arc<Mutex<VmxVcpu>>, SystemError> { in kvm_arch_vcpu_create() argument
64 pub fn kvm_arch_vcpu_setup(vcpu: &Mutex<VmxVcpu>) -> Result<(), SystemError> { in kvm_arch_vcpu_setup() argument
69 pub fn kvm_arch_vcpu_ioctl_run(_vcpu: &Mutex<VmxVcpu>) -> Result<(), SystemError> { in kvm_arch_vcpu_ioctl_run() argument
/DragonOS/kernel/src/filesystem/
H A Deventfd.rs17 use system_error::SystemError;
66 pub fn remove_epoll(&self, epoll: &Weak<SpinLock<EventPoll>>) -> Result<(), SystemError> { in remove_epoll() argument
78 Err(SystemError::ENOENT) in remove_epoll()
92 ) -> Result<(), SystemError> { in open() argument
96 fn close(&self, _data: SpinLockGuard<FilePrivateData>) -> Result<(), SystemError> { in close() argument
114 ) -> Result<usize, SystemError> { in read_at() argument
118 return Err(SystemError::EINVAL); in read_at()
124 return Err(SystemError::EAGAIN_OR_EWOULDBLOCK); in read_at()
130 return Err(SystemError::ERESTARTSYS); in read_at()
168 ) -> Result<usize, SystemError> { in write_at() argument
[all …]

12345678910>>...12