/DragonOS-0.1.5/kernel/src/filesystem/vfs/ |
D | mod.rs | 94 fn open(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 103 fn close(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 123 ) -> Result<usize, i32>; in read_at() 140 ) -> Result<usize, i32>; in write_at() 145 fn poll(&self) -> Result<PollStatus, i32>; in poll() 151 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 160 fn set_metadata(&self, _metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 169 fn resize(&self, _len: usize) -> Result<(), i32> { in resize() argument 187 ) -> Result<Arc<dyn IndexNode>, i32> { in create() 207 ) -> Result<Arc<dyn IndexNode>, i32> { in create_with_data() [all …]
|
D | mount.rs | 107 fn is_mountpoint_root(&self) -> Result<bool, i32> { in is_mountpoint_root() 129 fn open(&self, data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 133 fn close(&self, data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 143 ) -> Result<Arc<dyn IndexNode>, i32> { in create_with_data() 149 fn truncate(&self, len: usize) -> Result<(), i32> { in truncate() argument 159 ) -> Result<usize, i32> { in read_at() 169 ) -> Result<usize, i32> { in write_at() 176 fn poll(&self) -> Result<super::PollStatus, i32> { in poll() 191 fn metadata(&self) -> Result<super::Metadata, i32> { in metadata() 196 fn set_metadata(&self, metadata: &super::Metadata) -> Result<(), i32> { in set_metadata() argument [all …]
|
D | file.rs | 99 pub fn new(inode: Arc<dyn IndexNode>, mode: FileMode) -> Result<Self, i32> { in new() 121 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() 157 pub fn metadata(&self) -> Result<Metadata, i32> { in metadata() 162 pub fn get_entry_name(&self, ino: usize) -> Result<String, i32> { in get_entry_name() 169 pub fn lseek(&mut self, origin: SeekFrom) -> Result<usize, i32> { in lseek() 199 pub fn readable(&self) -> Result<(), i32> { in readable() argument 210 pub fn writeable(&self) -> Result<(), i32> { in writeable() argument 221 pub fn readdir(&mut self, dirent: &mut Dirent) -> Result<u64, i32> { in readdir() 270 let r: Result<(), i32> = self.inode.close(&mut self.private_data); in drop()
|
D | core.rs | 102 ) -> Result<(), i32> { in do_migrate() argument 120 fn migrate_virtual_filesystem(new_fs: Arc<dyn FileSystem>) -> Result<(), i32> { in migrate_virtual_filesystem() argument 163 let fatfs: Result<Arc<FATFileSystem>, i32> = FATFileSystem::new(partiton); in mount_root_fs() 187 pub fn do_open(path: &str, mode: FileMode) -> Result<i32, i32> { in do_open() 193 let inode: Result<Arc<dyn IndexNode>, i32> = ROOT_INODE().lookup(path); in do_open() 250 pub fn do_read(fd: i32, buf: &mut [u8]) -> Result<usize, i32> { in do_read() 267 pub fn do_write(fd: i32, buf: &[u8]) -> Result<usize, i32> { in do_write() 284 pub fn do_lseek(fd: i32, seek: SeekFrom) -> Result<usize, i32> { in do_lseek() 294 pub fn do_mkdir(path: &str, _mode: FileMode) -> Result<u64, i32> { in do_mkdir() 300 let inode: Result<Arc<dyn IndexNode>, i32> = ROOT_INODE().lookup(path); in do_mkdir() [all …]
|
D | syscall.rs | 30 let path: Result<&str, core::str::Utf8Error> = path.to_str(); in sys_open() 37 let r: Result<i32, i32> = do_open(path, open_flags); in sys_open() 52 let r: Result<(), i32> = current_pcb().drop_fd(fd); in sys_close() 81 let r: Result<usize, i32> = do_read(fd, buf); in sys_read() 110 let r: Result<usize, i32> = do_write(fd, buf); in sys_write() 138 let r: Result<usize, i32> = do_lseek(fd, w); in sys_lseek() 182 let dest_path: Result<&str, core::str::Utf8Error> = dest_path.to_str(); in sys_chdir() 272 let path: Result<&str, core::str::Utf8Error> = path.to_str(); in sys_mkdir() 312 let path: Result<&str, core::str::Utf8Error> = path.to_str(); in sys_unlink_at()
|
/DragonOS-0.1.5/kernel/src/libs/ |
D | vec_cursor.rs | 48 pub fn read_u8(&mut self) -> Result<u8, i32> { in read_u8() 57 pub fn read_u16(&mut self) -> Result<u16, i32> { in read_u16() 71 pub fn read_u32(&mut self) -> Result<u32, i32> { in read_u32() 85 pub fn read_u64(&mut self) -> Result<u64, i32> { in read_u64() 104 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), i32> { in read_exact() argument 116 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), i32> { in read_u16_into() argument 134 pub fn seek(&mut self, origin: SeekFrom) -> Result<usize, i32> { in seek() 160 pub fn write_u8(&mut self, value: u8) -> Result<u8, i32> { in write_u8() 172 pub fn write_u16(&mut self, value: u16) -> Result<u16, i32> { in write_u16() 186 pub fn write_u32(&mut self, value: u32) -> Result<u32, i32> { in write_u32() [all …]
|
D | lockref.rs | 53 fn cmpxchg_loop(&mut self, mode: CmpxchgMode) -> Result<i32, i32> { in cmpxchg_loop() 123 fn cmpxchg_loop(&mut self, mode: CmpxchgMode) -> Result<i32, i32> { in cmpxchg_loop() 147 pub fn inc_not_zero(&mut self) -> Result<i32, i32> { in inc_not_zero() 176 pub fn inc_not_dead(&mut self) -> Result<i32, i32> { in inc_not_dead() 206 pub fn dec(&mut self) -> Result<i32, i32> { in dec() 213 let retval: Result<i32, i32>; in dec() 238 pub fn dec_return(&mut self) -> Result<i32, i32> { in dec_return() 265 pub fn dec_not_zero(&mut self) -> Result<i32, i32> { in dec_not_zero() 275 let retval: Result<i32, i32>; in dec_not_zero() 296 pub fn dec_or_lock_not_zero(&mut self) -> Result<i32, i32> { in dec_or_lock_not_zero() [all …]
|
D | semaphore.rs | 21 fn new(counter: i32) -> Result<Self, i32> { in new()
|
/DragonOS-0.1.5/kernel/src/filesystem/devfs/ |
D | null_dev.rs | 75 fn open(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 79 fn close(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 83 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 91 fn list(&self) -> Result<Vec<String>, i32> { in list() 95 fn set_metadata(&self, metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 107 fn poll(&self) -> Result<PollStatus, i32> { in poll() 120 ) -> Result<usize, i32> { in read_at() 139 ) -> Result<usize, i32> { in write_at()
|
D | zero_dev.rs | 75 fn open(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 79 fn close(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 83 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 91 fn list(&self) -> Result<Vec<String>, i32> { in list() 95 fn set_metadata(&self, metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 107 fn poll(&self) -> Result<PollStatus, i32> { in poll() 120 ) -> Result<usize, i32> { in read_at() 139 ) -> Result<usize, i32> { in write_at()
|
D | mod.rs | 97 pub fn register_device<T: DeviceINode>(&self, name: &str, device: Arc<T>) -> Result<(), i32> { in register_device() argument 138 pub fn unregister_device<T: DeviceINode>(&self, name: &str, device: Arc<T>) -> Result<(), i32> { in unregister_device() argument 233 pub fn add_dir(&self, name: &str) -> Result<(), i32> { in add_dir() argument 250 pub fn add_dev(&self, name: &str, dev: Arc<dyn IndexNode>) -> Result<(), i32> { in add_dev() argument 261 pub fn remove(&self, name: &str) -> Result<(), i32> { in remove() argument 276 _data: usize,) -> Result<Arc<dyn IndexNode>, i32>{ in do_create_with_data() 325 fn open(&self, _data: &mut super::vfs::FilePrivateData) -> Result<(), i32> { in open() argument 329 fn close(&self, _data: &mut super::vfs::FilePrivateData) -> Result<(), i32> { in close() argument 339 ) -> Result<Arc<dyn IndexNode>, i32> { in create_with_data() 346 fn find(&self, name: &str) -> Result<Arc<dyn IndexNode>, i32> { in find() [all …]
|
/DragonOS-0.1.5/kernel/src/driver/disk/ahci/ |
D | ahci_inode.rs | 80 fn open(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 84 fn close(&self, _data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 88 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 96 fn list(&self) -> Result<Vec<String>, i32> { in list() 100 fn set_metadata(&self, metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 112 fn poll(&self) -> Result<PollStatus, i32> { in poll() 125 ) -> Result<usize, i32> { in read_at() 144 ) -> Result<usize, i32> { in write_at()
|
D | ahcidisk.rs | 41 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt() argument 57 ) -> Result<usize, i32> { in read_at() 190 ) -> Result<usize, i32> { in write_at() 307 fn sync(&self) -> Result<(), i32> { in sync() argument 319 ) -> Result<Arc<LockedAhciDisk>, i32> { in new() 354 pub fn read_mbr_table(&self) -> Result<MbrDiskPartionTable, i32> { in read_mbr_table() 407 ) -> Result<usize, i32> { in read_at() 421 ) -> Result<usize, i32> { in write_at() 425 fn sync(&self) -> Result<(), i32> { in sync() argument
|
/DragonOS-0.1.5/kernel/src/driver/keyboard/ |
D | ps2_keyboard.rs | 84 ) -> Result<usize, i32> { in read_at() 104 ) -> Result<usize, i32> { in write_at() 108 fn open(&self, _data: &mut crate::filesystem::vfs::FilePrivateData) -> Result<(), i32> { in open() argument 115 fn close(&self, _data: &mut crate::filesystem::vfs::FilePrivateData) -> Result<(), i32> { in close() argument 122 fn poll(&self) -> Result<PollStatus, i32> { in poll() 128 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 132 fn set_metadata(&self, metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 152 fn list(&self) -> Result<alloc::vec::Vec<alloc::string::String>, i32> { in list()
|
/DragonOS-0.1.5/docs/kernel/locking/ |
D | lockref.md | 62 - `pub fn inc_not_zero(&mut self) -> Result<i32, i32>` 63 - `pub fn inc_not_dead(&mut self) -> Result<i32, i32>` 102 - `pub fn dec(&mut self) -> Result<i32, i32>` 103 - `pub fn dec_return(&mut self) -> Result<i32, i32>` 104 - `pub fn dec_not_zero(&mut self) -> Result<i32, i32>` 105 - `pub fn dec_or_lock_not_zero(&mut self) -> Result<i32, i32>`
|
/DragonOS-0.1.5/docs/community/code_contribution/ |
D | rust-coding-style.md | 36 fn foo() -> Result<(), CustomErr> { 45 fn foo() -> Result<(), i32> { 84   如果函数的返回值是`Result`类型,那么返回值应当这样进行解释:
|
/DragonOS-0.1.5/kernel/src/filesystem/procfs/ |
D | mod.rs | 117 fn open_status(&self, pdata: &mut ProcfsFilePrivateData) -> Result<i64, i32> { in open_status() 201 ) -> Result<usize, i32> { in read_status() 281 pub fn register_pid(&self, pid: i64) -> Result<(), i32> { in register_pid() argument 303 pub fn unregister_pid(&self, pid: i64) -> Result<(), i32> { in unregister_pid() argument 322 fn open(&self, data: &mut FilePrivateData) -> Result<(), i32> { in open() argument 345 fn close(&self, data: &mut FilePrivateData) -> Result<(), i32> { in close() argument 369 ) -> Result<usize, i32> { in read_at() 416 ) -> Result<usize, i32> { in write_at() 420 fn poll(&self) -> Result<PollStatus, i32> { in poll() 442 fn metadata(&self) -> Result<Metadata, i32> { in metadata() [all …]
|
/DragonOS-0.1.5/kernel/src/io/ |
D | device.rs | 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() 45 fn sync(&self) -> Result<(), i32>; in sync() argument 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() 72 fn sync(&self) -> Result<(), i32>; in sync() 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() 171 fn sync(&self) -> Result<(), i32> { in sync() argument
|
/DragonOS-0.1.5/kernel/src/filesystem/ramfs/ |
D | mod.rs | 125 ) -> Result<usize, i32> { in read_at() 157 ) -> Result<usize, i32> { in write_at() 182 fn poll(&self) -> Result<PollStatus, i32> { in poll() 204 fn metadata(&self) -> Result<Metadata, i32> { in metadata() 212 fn set_metadata(&self, metadata: &Metadata) -> Result<(), i32> { in set_metadata() argument 224 fn resize(&self, len: usize) -> Result<(), i32> { in resize() argument 240 ) -> Result<Arc<dyn IndexNode>, i32> { in create_with_data() 286 fn link(&self, name: &str, other: &Arc<dyn IndexNode>) -> Result<(), i32> { in link() argument 317 fn unlink(&self, name: &str) -> Result<(), i32> { in unlink() argument 340 fn rmdir(&self, name: &str) -> Result<(), i32> { in rmdir() argument [all …]
|
/DragonOS-0.1.5/kernel/src/process/ |
D | process.rs | 114 pub fn init_files(&mut self) -> Result<(), i32> { in init_files() argument 136 ) -> Result<(), i32> { in copy_files() argument 161 pub fn exit_files(&mut self) -> Result<(), i32> { in exit_files() argument 177 pub fn alloc_fd(&mut self, file: File) -> Result<i32, i32> { in alloc_fd() 236 pub fn drop_fd(&self, fd: i32) -> Result<(), i32> { in drop_fd() argument 296 let r: Result<(), i32> = pcb.exit_files(); in process_exit_files()
|
/DragonOS-0.1.5/kernel/src/driver/pci/ |
D | pci.rs | 123 fn fmt(&self, f: &mut Formatter) -> fmt::Result { in fmt() argument 143 fn fmt(&self, f: &mut Formatter) -> fmt::Result { in fmt() argument 171 fn try_from(value: u8) -> Result<Self, Self::Error> { in try_from() 235 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { in fmt() argument 272 pub fn get_bar(&self, bar_index: u8) -> Result<&BarInfo, PciError> { in get_bar() 285 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { in fmt() argument 310 pub fn pci_bar_init(device_function: DeviceFunction) -> Result<PciDeviceBar, PciError> { in pci_bar_init()
|
/DragonOS-0.1.5/kernel/src/filesystem/fat/ |
D | fs.rs | 125 fn find(&mut self, name: &str) -> Result<Arc<LockedFATInode>, i32> { in find() 246 pub fn new(partition: Arc<Partition>) -> Result<Arc<FATFileSystem>, i32> { in new() 345 pub fn get_fat_entry(&self, cluster: Cluster) -> Result<FATEntry, i32> { in get_fat_entry() 440 pub fn get_fat_entry_raw(&self, cluster: Cluster) -> Result<u64, i32> { in get_fat_entry_raw() 541 pub fn allocate_cluster(&self, prev_cluster: Option<Cluster>) -> Result<Cluster, i32> { in allocate_cluster() 589 pub fn deallocate_cluster_chain(&self, start_cluster: Cluster) -> Result<(), i32> { in deallocate_cluster_chain() argument 600 pub fn deallocate_cluster(&self, cluster: Cluster) -> Result<(), i32> { in deallocate_cluster() argument 767 pub fn is_shut_bit_ok(&mut self) -> Result<bool, i32> { in is_shut_bit_ok() 790 pub fn is_hard_error_bit_ok(&mut self) -> Result<bool, i32> { in is_hard_error_bit_ok() 809 pub fn set_shut_bit_ok(&mut self) -> Result<(), i32> { in set_shut_bit_ok() argument [all …]
|
D | entry.rs | 85 pub fn read(&self, fs: &Arc<FATFileSystem>, buf: &mut [u8], offset: u64) -> Result<usize, i32> { in read() 162 ) -> Result<usize, i32> { in write() 229 fn ensure_len(&mut self, fs: &Arc<FATFileSystem>, offset: u64, len: u64) -> Result<(), i32> { in ensure_len() argument 314 ) -> Result<(), i32> { in zero_range() argument 334 pub fn truncate(&mut self, fs: &Arc<FATFileSystem>, new_size: u64) -> Result<(), i32> { in truncate() argument 403 ) -> Result<Option<(Cluster, u64)>, i32> { in find_free_entries() 498 ) -> Result<FATDirEntry, i32> { in find_entry() 525 pub fn open_file(&self, name: &str, fs: Arc<FATFileSystem>) -> Result<FATFile, i32> { in open_file() 531 pub fn open_dir(&self, name: &str, fs: Arc<FATFileSystem>) -> Result<FATDir, i32> { in open_dir() 540 pub fn create_file(&self, name: &str, fs: &Arc<FATFileSystem>) -> Result<FATFile, i32> { in create_file() [all …]
|
/DragonOS-0.1.5/kernel/src/mm/ |
D | mmio_buddy.rs | 77 fn give_back_block(&self, vaddr: u64, exp: u32) -> Result<i32, i32> { in give_back_block() 125 ) -> Result<Box<MmioBuddyAddrRegion>, MmioResult> { in query_addr_region() 263 ) -> Result<Box<MmioBuddyAddrRegion>, MmioResult> { in mmio_buddy_query_addr_region() 311 ) -> Result<Box<MmioBuddyAddrRegion>, MmioResult> { in pop_buddy_block() 343 ) -> Result<Box<MmioBuddyAddrRegion>, MmioResult> { in pop_block() 369 ) -> Result<MmioResult, MmioResult> { in merge_all_exp() 421 ) -> Result<MmioResult, MmioResult> { in merge_blocks() 450 ) -> Result<i32, i32> { in create_mmio() 557 pub fn release_mmio(&self, vaddr: u64, length: u64) -> Result<i32, i32> { in release_mmio()
|
/DragonOS-0.1.5/kernel/src/driver/virtio/ |
D | transport_pci.rs | 95 pub fn new<H: Hal>(device_function: DeviceFunction) -> Result<Self, VirtioPciError> { in new() 337 fn config_space<T>(&self) -> Result<NonNull<T>, Error> { in config_space() 427 fn fmt(&self, f: &mut Formatter) -> fmt::Result { in fmt() argument 478 ) -> Result<NonNull<T>, VirtioPciError> { in get_bar_region() 510 ) -> Result<NonNull<[T]>, VirtioPciError> { in get_bar_region_slice()
|