/DragonOS-0.1.8/kernel/src/filesystem/vfs/ |
D | mod.rs | 14 use crate::{libs::casting::DowncastArc, syscall::SystemError, time::TimeSpec}; 93 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 95 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in open() 102 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 104 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in close() 122 ) -> Result<usize, SystemError>; in read_at() argument 139 ) -> Result<usize, SystemError>; in write_at() argument 144 fn poll(&self) -> Result<PollStatus, SystemError>; in poll() argument 150 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument 152 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in metadata() [all …]
|
D | syscall.rs | 9 syscall::{Syscall, SystemError}, 129 pub fn open(path: &str, mode: FileMode) -> Result<usize, SystemError> { in open() argument 133 return Err(SystemError::ENAMETOOLONG); in open() 136 let inode: Result<Arc<dyn IndexNode>, SystemError> = ROOT_INODE().lookup(path); in open() 143 && errno == SystemError::ENOENT in open() 164 return Err(SystemError::ENOTDIR); in open() 194 pub fn close(fd: usize) -> Result<usize, SystemError> { in close() argument 206 pub fn read(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in read() argument 210 return Err(SystemError::EBADF); in read() 224 pub fn write(fd: i32, buf: &[u8]) -> Result<usize, SystemError> { in write() argument [all …]
|
D | mount.rs | 8 use crate::{libs::spinlock::SpinLock, syscall::SystemError}; 104 fn is_mountpoint_root(&self) -> Result<bool, SystemError> { in is_mountpoint_root() argument 126 fn open(&self, data: &mut FilePrivateData, mode: &FileMode) -> Result<(), SystemError> { in open() argument 130 fn close(&self, data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 140 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data() argument 146 fn truncate(&self, len: usize) -> Result<(), SystemError> { in truncate() argument 156 ) -> Result<usize, SystemError> { in read_at() argument 166 ) -> Result<usize, SystemError> { in write_at() argument 171 fn poll(&self) -> Result<super::PollStatus, SystemError> { in poll() argument 186 fn metadata(&self) -> Result<super::Metadata, SystemError> { in metadata() argument [all …]
|
D | core.rs | 21 syscall::SystemError, 115 ) -> Result<(), SystemError> { in do_migrate() argument 133 fn migrate_virtual_filesystem(new_fs: Arc<dyn FileSystem>) -> Result<(), SystemError> { in migrate_virtual_filesystem() argument 179 let fatfs: Result<Arc<FATFileSystem>, SystemError> = FATFileSystem::new(partiton); in mount_root_fs() 203 pub fn do_mkdir(path: &str, _mode: FileMode) -> Result<u64, SystemError> { in do_mkdir() argument 206 return Err(SystemError::ENAMETOOLONG); in do_mkdir() 209 let inode: Result<Arc<dyn IndexNode>, SystemError> = ROOT_INODE().lookup(path); in do_mkdir() 214 if errno == SystemError::ENOENT { in do_mkdir() 232 pub fn do_remove_dir(path: &str) -> Result<u64, SystemError> { in do_remove_dir() argument 235 return Err(SystemError::ENAMETOOLONG); in do_remove_dir() [all …]
|
/DragonOS-0.1.8/kernel/src/filesystem/sysfs/ |
D | bus.rs | 2 use crate::{filesystem::vfs::IndexNode, kdebug, syscall::SystemError}; 10 pub fn sys_bus_register(bus_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_bus_register() argument 16 .ok_or(SystemError::E2BIG) in sys_bus_register() 25 pub fn sys_bus_unregister(bus_name: &str) -> Result<(), SystemError> { in sys_bus_unregister() argument 30 .ok_or(SystemError::E2BIG) in sys_bus_unregister() 40 ) -> Result<(Arc<dyn IndexNode>, Arc<dyn IndexNode>), SystemError> { in sys_bus_init() argument 49 None => Err(SystemError::E2BIG), in sys_bus_init() 57 pub fn bus_driver_register(bus_name: &str, name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in bus_driver_register() argument 63 .ok_or(SystemError::E2BIG) in bus_driver_register() 66 Err(_) => return Err(SystemError::EXDEV), in bus_driver_register() [all …]
|
D | class.rs | 2 use crate::{filesystem::vfs::IndexNode, syscall::SystemError}; 10 pub fn sys_class_register(class_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_class_register() argument 15 .ok_or(SystemError::E2BIG) in sys_class_register() 25 pub fn sys_class_unregister(class_name: &str) -> Result<(), SystemError> { in sys_class_unregister() argument 30 .ok_or(SystemError::E2BIG) in sys_class_unregister() 44 ) -> Result<Arc<dyn IndexNode>, SystemError> { in class_device_register() argument 48 .ok_or(SystemError::E2BIG) in class_device_register() 62 ) -> Result<(), SystemError> { in class_device_unregister() argument 66 .ok_or(SystemError::E2BIG) in class_device_unregister()
|
D | devices.rs | 2 use crate::{filesystem::vfs::IndexNode, syscall::SystemError}; 10 pub fn sys_device_register(device_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_device_register() argument 15 .ok_or(SystemError::E2BIG) in sys_device_register() 25 pub fn sys_device_unregister(device_name: &str) -> Result<(), SystemError> { in sys_device_unregister() argument 30 .ok_or(SystemError::E2BIG) in sys_device_unregister()
|
D | fs.rs | 2 use crate::{filesystem::vfs::IndexNode, syscall::SystemError}; 10 pub fn fs_register(fs_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in fs_register() argument 15 .ok_or(SystemError::E2BIG) in fs_register() 25 pub fn fs_unregister(fs_name: &str) -> Result<(), SystemError> { in fs_unregister() argument 30 .ok_or(SystemError::E2BIG) in fs_unregister()
|
D | mod.rs | 7 syscall::SystemError, 160 ) -> Result<(), SystemError> { in open() argument 164 fn close(&self, _data: &mut super::vfs::FilePrivateData) -> Result<(), SystemError> { in close() argument 174 ) -> Result<usize, SystemError> { in read_at() argument 175 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in read_at() 184 ) -> Result<usize, SystemError> { in write_at() argument 185 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in write_at() 188 fn poll(&self) -> Result<super::vfs::PollStatus, SystemError> { in poll() argument 194 return Err(SystemError::EISDIR); in poll() 200 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument [all …]
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | vec_cursor.rs | 7 use crate::{io::SeekFrom, syscall::SystemError}; 45 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8() argument 47 return Err(SystemError::E2BIG); in read_u8() 54 pub fn read_u16(&mut self) -> Result<u16, SystemError> { in read_u16() argument 56 return Err(SystemError::E2BIG); in read_u16() 68 pub fn read_u32(&mut self) -> Result<u32, SystemError> { in read_u32() argument 70 return Err(SystemError::E2BIG); in read_u32() 82 pub fn read_u64(&mut self) -> Result<u64, SystemError> { in read_u64() argument 84 return Err(SystemError::E2BIG); in read_u64() 101 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact() argument [all …]
|
D | lockref.rs | 3 use crate::{arch::asm::cmpxchg::try_cmpxchg_q, syscall::SystemError}; 114 return Err(SystemError::ETIMEDOUT.to_posix_errno()); in cmpxchg_loop() 123 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP.to_posix_errno()); in cmpxchg_loop() 144 pub fn inc_not_zero(&mut self) -> Result<i32, SystemError> { in inc_not_zero() argument 151 return Err(SystemError::EPERM); in inc_not_zero() 154 let mut retval = Err(SystemError::EPERM); in inc_not_zero() 172 pub fn inc_not_dead(&mut self) -> Result<i32, SystemError> { in inc_not_dead() argument 178 return Err(SystemError::EPERM); in inc_not_dead() 182 let mut retval = Err(SystemError::EPERM); in inc_not_dead() 202 pub fn dec(&mut self) -> Result<i32, SystemError> { in dec() argument [all …]
|
D | notifier.rs | 5 syscall::SystemError, 32 ) -> Result<(), SystemError> { in register() argument 43 return Err(SystemError::EEXIST); in register() 52 return Err(SystemError::EBUSY); in register() 64 pub fn unregister(&mut self, block: Arc<dyn NotifierBlock<T>>) -> Result<(), SystemError> { in unregister() argument 69 0 => return Err(SystemError::ENOENT), in unregister() 106 pub fn register(&mut self, block: Arc<dyn NotifierBlock<T>>) -> Result<(), SystemError> { in register() argument 114 ) -> Result<(), SystemError> { in register_unique_prio() argument 119 pub fn unregister(&mut self, block: Arc<dyn NotifierBlock<T>>) -> Result<(), SystemError> { in unregister() argument 144 pub fn register(&mut self, block: Arc<dyn NotifierBlock<T>>) -> Result<(), SystemError> { in register() argument [all …]
|
/DragonOS-0.1.8/kernel/src/filesystem/ramfs/ |
D | mod.rs | 13 syscall::SystemError, 123 ) -> Result<usize, SystemError> { in read_at() argument 125 return Err(SystemError::EINVAL); in read_at() 132 return Err(SystemError::EISDIR); in read_at() 140 return Err(SystemError::ENOBUFS); in read_at() 155 ) -> Result<usize, SystemError> { in write_at() argument 157 return Err(SystemError::EINVAL); in write_at() 165 return Err(SystemError::EISDIR); in write_at() 180 fn poll(&self) -> Result<PollStatus, SystemError> { in poll() argument 186 return Err(SystemError::EISDIR); in poll() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/disk/ahci/ |
D | ahci_inode.rs | 8 use crate::syscall::SystemError; 78 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 79 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in open() 82 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 83 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in close() 86 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument 94 fn list(&self) -> Result<Vec<String>, SystemError> { in list() argument 95 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in list() 98 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument 110 fn poll(&self) -> Result<PollStatus, SystemError> { in poll() argument [all …]
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | syscall.rs | 10 syscall::{Syscall, SystemError}, 70 pub fn brk(new_addr: VirtAddr) -> Result<VirtAddr, SystemError> { in brk() argument 91 pub fn sbrk(incr: isize) -> Result<VirtAddr, SystemError> { in sbrk() argument 125 ) -> Result<usize, SystemError> { in mmap() argument 136 return Err(SystemError::EINVAL); in mmap() 141 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in mmap() 147 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in mmap() 170 pub fn munmap(start_vaddr: VirtAddr, len: usize) -> Result<usize, SystemError> { in munmap() argument 175 return Err(SystemError::EINVAL); in munmap() 178 return Err(SystemError::EINVAL); in munmap() [all …]
|
/DragonOS-0.1.8/docs/kernel/locking/ |
D | lockref.md | 62 - `pub fn inc_not_zero(&mut self) -> Result<i32, SystemError>` 63 - `pub fn inc_not_dead(&mut self) -> Result<i32, SystemError>` 86 | Err(SystemError::EPERM) | 失败,返回EPERM | 99 | Err(SystemError::EPERM) | 失败,返回EPERM | 102 - `pub fn dec(&mut self) -> Result<i32, SystemError>` 103 - `pub fn dec_return(&mut self) -> Result<i32, SystemError>` 104 - `pub fn dec_not_zero(&mut self) -> Result<i32, SystemError>` 105 - `pub fn dec_or_lock_not_zero(&mut self) -> Result<i32, SystemError>` 111   原子地将引用计数-1。如果已处于count≤0的状态,则返回Err(SystemError::EPERM) 120 | Err(SystemError::EPERM) | 失败,返回EPERM | [all …]
|
/DragonOS-0.1.8/kernel/src/net/ |
D | mod.rs | 8 use crate::{driver::net::NetDriver, kwarn, libs::rwlock::RwLock, syscall::SystemError}; 41 type Error = SystemError; 45 <Self as FromPrimitive>::from_i32(value).ok_or(SystemError::EINVAL) in try_from() 72 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint); in read() argument 80 fn write(&self, buf: &[u8], to: Option<Endpoint>) -> Result<usize, SystemError>; in write() argument 92 fn connect(&mut self, endpoint: Endpoint) -> Result<(), SystemError>; in connect() argument 101 fn bind(&mut self, _endpoint: Endpoint) -> Result<(), SystemError> { in bind() argument 102 return Err(SystemError::ENOSYS); in bind() 112 fn shutdown(&self, _type: ShutdownType) -> Result<(), SystemError> { in shutdown() argument 113 return Err(SystemError::ENOSYS); in shutdown() [all …]
|
D | syscall.rs | 16 syscall::{Syscall, SystemError}, 34 ) -> Result<usize, SystemError> { in socket() argument 49 return Err(SystemError::EINVAL); in socket() 54 return Err(SystemError::EAFNOSUPPORT); in socket() 79 ) -> Result<usize, SystemError> { in setsockopt() argument 82 .ok_or(SystemError::EBADF)?; in setsockopt() 103 ) -> Result<usize, SystemError> { in getsockopt() argument 108 .ok_or(SystemError::EBADF)?; in getsockopt() 113 .map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt() 133 return Err(SystemError::ENOPROTOOPT); in getsockopt() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/tty/ |
D | tty_device.rs | 15 syscall::SystemError, 63 ) -> Result<&'a mut TtyFilePrivateData, SystemError> { in verify_file_private_data() argument 67 return Err(SystemError::EIO); in verify_file_private_data() 78 pub fn check_rw_param(&self, len: usize, buf: &[u8]) -> Result<(), SystemError> { in check_rw_param() argument 80 return Err(SystemError::EINVAL); in check_rw_param() 86 pub fn input(&self, buf: &[u8]) -> Result<usize, SystemError> { in input() argument 95 TtyError::Closed => return Err(SystemError::ENODEV), in input() 98 return Err(SystemError::EBUSY); in input() 120 fn open(&self, data: &mut FilePrivateData, mode: &FileMode) -> Result<(), SystemError> { in open() argument 134 return Err(SystemError::EINVAL); in open() [all …]
|
/DragonOS-0.1.8/kernel/src/filesystem/devfs/ |
D | mod.rs | 13 syscall::SystemError, 102 ) -> Result<(), SystemError> { in register_device() argument 141 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in register_device() 153 ) -> Result<(), SystemError> { in unregister_device() argument 159 return Err(SystemError::ENOENT); in unregister_device() 172 return Err(SystemError::ENOENT); in unregister_device() 184 return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP); in unregister_device() 248 pub fn add_dir(&self, name: &str) -> Result<(), SystemError> { in add_dir() argument 252 return Err(SystemError::EEXIST); in add_dir() 265 pub fn add_dev(&self, name: &str, dev: Arc<dyn IndexNode>) -> Result<(), SystemError> { in add_dev() argument [all …]
|
D | zero_dev.rs | 6 use crate::{libs::spinlock::SpinLock, syscall::SystemError, time::TimeSpec}; 72 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 76 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 80 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata() argument 88 fn list(&self) -> Result<Vec<String>, SystemError> { in list() argument 89 Err(SystemError::EOPNOTSUPP_OR_ENOTSUP) in list() 92 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument 104 fn poll(&self) -> Result<PollStatus, SystemError> { in poll() argument 115 ) -> Result<usize, SystemError> { in read_at() argument 117 return Err(SystemError::EINVAL); in read_at() [all …]
|
/DragonOS-0.1.8/kernel/src/process/ |
D | syscall.rs | 6 syscall::{Syscall, SystemError}, 15 pub fn fork(&self) -> Result<usize, SystemError> { in fork() argument 21 pub fn vfork(&self) -> Result<usize, SystemError> { in vfork() argument 31 ) -> Result<usize, SystemError> { in execve() argument 41 ) -> Result<usize, SystemError> { in wait4() argument 45 SystemError::from_posix_errno((ret as isize) as i32).expect("wait4: Invalid errno") in wait4() 62 pub fn getpid() -> Result<usize, SystemError> { in getpid()
|
/DragonOS-0.1.8/kernel/src/filesystem/procfs/ |
D | mod.rs | 21 syscall::SystemError, 117 fn open_status(&self, pdata: &mut ProcfsFilePrivateData) -> Result<i64, SystemError> { in open_status() argument 126 return Err(SystemError::ESRCH); in open_status() 203 ) -> Result<usize, SystemError> { in read_status() argument 209 return Err(SystemError::ENOBUFS); in read_status() 283 pub fn register_pid(&self, pid: i64) -> Result<(), SystemError> { in register_pid() argument 305 pub fn unregister_pid(&self, pid: i64) -> Result<(), SystemError> { in unregister_pid() argument 324 fn open(&self, data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument 347 fn close(&self, data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument 371 ) -> Result<usize, SystemError> { in read_at() argument [all …]
|
/DragonOS-0.1.8/kernel/src/time/ |
D | syscall.rs | 7 syscall::{Syscall, SystemError}, 52 ) -> Result<usize, SystemError> { in nanosleep() argument 54 return Err(SystemError::EFAULT); in nanosleep() 61 let r: Result<usize, SystemError> = nanosleep(slt_spec).map(|slt_spec| { in nanosleep() 75 pub fn clock() -> Result<usize, SystemError> { in clock() 82 ) -> Result<usize, SystemError> { in gettimeofday() argument 86 return Err(SystemError::EFAULT); in gettimeofday()
|
/DragonOS-0.1.8/kernel/src/syscall/ |
D | user_access.rs | 8 use super::SystemError; 24 pub unsafe fn clear_user(dest: VirtAddr, len: usize) -> Result<usize, SystemError> { in clear_user() argument 25 verify_area(dest, len).map_err(|_| SystemError::EFAULT)?; in clear_user() 33 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() argument 34 verify_area(dest, src.len()).map_err(|_| SystemError::EFAULT)?; in copy_to_user() 43 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() argument 44 verify_area(src, dst.len()).map_err(|_| SystemError::EFAULT)?; in copy_from_user() 72 ) -> Result<String, SystemError> { in check_and_clone_cstr() argument 94 return Ok(String::from_utf8(buffer).map_err(|_| SystemError::EFAULT)?); in check_and_clone_cstr() 111 pub fn check_and_clone_cstr_array(user: *const *const u8) -> Result<Vec<String>, SystemError> { in check_and_clone_cstr_array() argument
|