Home
last modified time | relevance | path

Searched refs:r (Results 1 – 25 of 35) sorted by relevance

12

/DragonOS-0.1.8/kernel/src/process/
Dc_adapter.rs29 let r = current_pcb().init_files(); in process_init_files() localVariable
30 if r.is_ok() { in process_init_files()
33 return r.unwrap_err().to_posix_errno(); in process_init_files()
54 let r = current_pcb().copy_files(clone_flags, from); in process_copy_files() localVariable
55 if r.is_ok() { in process_copy_files()
58 return r.unwrap_err().to_posix_errno(); in process_copy_files()
69 let r: Result<(), SystemError> = pcb.exit_files(); in process_exit_files() localVariable
70 if r.is_ok() { in process_exit_files()
73 return r.unwrap_err().to_posix_errno(); in process_exit_files()
109 let r = init_stdio(); in rs_init_stdio() localVariable
[all …]
Dprocess.rs197 let r: Option<&mut FileDescriptorVec> = FileDescriptorVec::from_pcb(current_pcb()); in alloc_fd() localVariable
198 if r.is_none() { in alloc_fd()
203 r.unwrap() in alloc_fd()
239 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in get_file_mut_by_fd() localVariable
240 return r.fds[fd as usize].as_deref_mut(); in get_file_mut_by_fd()
253 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in get_file_ref_by_fd() localVariable
254 return r.fds[fd as usize].as_deref(); in get_file_ref_by_fd()
265 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in drop_fd() localVariable
267 let f: Option<&File> = r.fds[fd as usize].as_deref(); in drop_fd()
276 r.fds[fd as usize] = None; in drop_fd()
Dfork.rs28 let r = RefCount::convert_mut(unsafe { &mut (*(current_pcb().sighand)).count }).unwrap(); in process_copy_sighand() localVariable
29 refcount_inc(r); in process_copy_sighand()
/DragonOS-0.1.8/kernel/src/driver/tty/
Dtty_device.rs87 let r: Result<usize, TtyError> = self.core.input(buf, false); in input() localVariable
88 if r.is_ok() { in input()
89 return Ok(r.unwrap()); in input()
92 let r = r.unwrap_err(); in input() localVariable
93 match r { in input()
159 let r: Result<usize, TtyError> = self.core.read_stdin(&mut buf[0..len], true); in read_at() localVariable
160 if r.is_ok() { in read_at()
161 return Ok(r.unwrap()); in read_at()
164 match r.unwrap_err() { in read_at()
194 let r: Result<usize, TtyError> = if data.flags.contains(TtyFileFlag::STDOUT) { in write_at() localVariable
[all …]
Dmod.rs202 let r: Result<mpsc::SendRef<u8>, TrySendError> = self.stdin_tx.try_send_ref(); in write_stdin() localVariable
203 if let Err(e) = r { in write_stdin()
216 *r.unwrap() = buf[cnt]; in write_stdin()
267 let r: Result<mpsc::SendRef<u8>, TrySendError> = self.output_tx.try_send_ref(); in write_output() localVariable
268 if let Err(e) = r { in write_output()
281 *r.unwrap() = buf[cnt]; in write_output()
/DragonOS-0.1.8/kernel/src/libs/
Drefcount.rs50 pub fn refcount_inc(r: &mut RefCount) { in refcount_inc()
51 if atomic_read(&r.refs) == 0 { in refcount_inc()
56 atomic_inc(&mut r.refs); in refcount_inc()
63 pub fn refcount_dec(r: &mut RefCount) { in refcount_dec()
65 atomic_dec(&mut r.refs); in refcount_dec()
Drwlock.rs117 let r = self.inner_try_read(); in try_read() localVariable
118 if r.is_none() { in try_read()
121 return r; in try_read()
181 let r = self.inner_try_write(); in try_write() localVariable
182 if r.is_none() { in try_write()
186 return r; in try_write()
224 let r = self.inner_try_upgradeable_read(); in try_upgradeable_read() localVariable
225 if r.is_none() { in try_upgradeable_read()
229 return r; in try_upgradeable_read()
/DragonOS-0.1.8/kernel/src/time/
Dtimekeep.rs21 let r = rtc_time.get(); in ktime_get_real() localVariable
23 if r.is_err() { in ktime_get_real()
24 return r.unwrap_err() as ktime_t; in ktime_get_real()
Dsyscall.rs61 let r: Result<usize, SystemError> = nanosleep(slt_spec).map(|slt_spec| { in nanosleep() localVariable
69 return r; in nanosleep()
Dtimer.rs117 let r = self.0.lock().timer_func.run(); in run() localVariable
118 if unlikely(r.is_err()) { in run()
121 r.err().unwrap() in run()
/DragonOS-0.1.8/kernel/src/mm/
Ducontext.rs377 for r in regions { in munmap()
378 let r = r.lock().region; in munmap() localVariable
379 let r = self.mappings.remove_vma(&r).unwrap(); in munmap() localVariable
380 let intersection = r.lock().region().intersect(&to_unmap).unwrap(); in munmap()
381 let (before, r, after) = r.extract(intersection).unwrap(); in munmap()
395 r.unmap(&mut self.user_mapper.utable, &mut flusher); in munmap()
430 for r in regions { in mprotect()
432 let r = r.lock().region().clone(); in mprotect() localVariable
433 let r = self.mappings.remove_vma(&r).unwrap(); in mprotect() localVariable
435 let intersection = r.lock().region().intersect(&region).unwrap(); in mprotect()
[all …]
Dsyscall.rs96 let r = unsafe { address_space.sbrk(incr) }; in sbrk() localVariable
99 return r; in sbrk()
Dpage.rs237 let mut r = unsafe { in new() localVariable
248 r = r.set_execute(true); in new()
252 return r; in new()
293 let r = Self::from_data(Arch::ENTRY_FLAG_DEFAULT_TABLE | Arch::ENTRY_FLAG_READWRITE); in new_page_table() localVariable
295 r.set_user(true) in new_page_table()
297 r in new_page_table()
/DragonOS-0.1.8/kernel/src/
Dlib.rs110 let r = net_init(); in __rust_demo_func() localVariable
111 if r.is_err() { in __rust_demo_func()
112 kwarn!("net_init() failed: {:?}", r.err().unwrap()); in __rust_demo_func()
/DragonOS-0.1.8/kernel/src/syscall/
Dmod.rs409 let r = match syscall_num { in handle() localVariable
534 let r: Result<&str, SystemError> = chdir_check(args[0]); in handle() localVariable
535 if r.is_err() { in handle()
536 Err(r.unwrap_err()) in handle()
538 Self::chdir(r.unwrap()) in handle()
762 let r = security_check(); in handle() localVariable
763 if r.is_err() { in handle()
764 Err(r.unwrap_err()) in handle()
844 let r = security_check(); in handle() localVariable
845 if r.is_err() { in handle()
[all …]
/DragonOS-0.1.8/kernel/src/arch/x86_64/
Dsyscall.rs143 let r: Result<(String, Vec<String>, Vec<String>), SystemError> = x(); in rs_do_execve() localVariable
144 if let Err(e) = r { in rs_do_execve()
147 let (path, argv, envp) = r.unwrap(); in rs_do_execve()
168 let r = tmp_rs_execve(path, argv, envp, regs); in rs_exec_init_process() localVariable
170 return r.map(|_| 0).unwrap_or_else(|e| e.to_posix_errno() as usize); in rs_exec_init_process()
/DragonOS-0.1.8/kernel/src/filesystem/vfs/
Dcore.rs116 let r = new_root_inode.find(mountpoint_name); in do_migrate() localVariable
117 let mountpoint = if r.is_err() { in do_migrate()
122 r.unwrap() in do_migrate()
190 let r = migrate_virtual_filesystem(fatfs); in mount_root_fs() localVariable
191 if r.is_err() { in mount_root_fs()
Dfile.rs368 let r: Result<(), SystemError> = self.inode.close(&mut self.private_data); in drop() localVariable
370 if r.is_err() { in drop()
375 r.unwrap_err() in drop()
Dsyscall.rs184 let r = current_pcb().alloc_fd(file, None).map(|fd| fd as usize); in open() localVariable
186 return r; in open()
566 let r = file.ftruncate(len).map(|_| 0); in ftruncate() localVariable
567 return r; in ftruncate()
/DragonOS-0.1.8/kernel/src/libs/libUI/
Dtextui-render.c17 #define calculate_color(r, g, b) ((((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) & 0x00fffff… argument
/DragonOS-0.1.8/kernel/src/driver/disk/ahci/
Dmod.rs44 let r = ahci_rust_init(); in ahci_init() localVariable
45 if r.is_ok() { in ahci_init()
48 return r.unwrap_err().to_posix_errno(); in ahci_init()
/DragonOS-0.1.8/kernel/src/filesystem/fat/
Dfs.rs1185 let r = self.umount(); in drop() localVariable
1186 if r.is_err() { in drop()
1189 r.unwrap_err() in drop()
1365 let r = f.read( in read_at() localVariable
1371 return r; in read_at()
1395 let r = f.write(fs, &buf[0..len], offset as u64); in write_at() localVariable
1397 return r; in write_at()
1585 let r = dir.remove(guard.fs.upgrade().unwrap().clone(), name, true); in unlink() localVariable
1587 return r; in unlink()
1612 let r: Result<(), SystemError> = in rmdir() localVariable
[all …]
Dentry.rs133 let r = fs.partition.disk().device().read_at( in read() localVariable
140 read_ok += r; in read()
141 start += r; in read()
142 in_cluster_offset += r as u64; in read()
557 let r: Result<FATDirEntryOrShortName, SystemError> = in create_file() localVariable
560 if r.is_err() { in create_file()
561 let err_val = r.unwrap_err(); in create_file()
569 match r.unwrap() { in create_file()
596 let r: Result<FATDirEntryOrShortName, SystemError> = in create_dir() localVariable
600 if r.is_err() { in create_dir()
[all …]
/DragonOS-0.1.8/kernel/src/driver/keyboard/
Dps2_keyboard.rs102 let r = unsafe { in read_at() localVariable
110 return Ok(r as usize); in read_at()
/DragonOS-0.1.8/kernel/src/filesystem/procfs/
Dmod.rs659 let r = procfs_register_pid(pid); in rs_procfs_register_pid() localVariable
660 if r.is_ok() { in rs_procfs_register_pid()
663 return r.unwrap_err() as u64; in rs_procfs_register_pid()
685 let r = procfs_unregister_pid(pid); in rs_procfs_unregister_pid() localVariable
686 if r.is_ok() { in rs_procfs_unregister_pid()
689 return r.unwrap_err() as u64; in rs_procfs_unregister_pid()

12