Lines Matching refs:usize
316 pub const SYS_PUT_STRING: usize = 1;
317 pub const SYS_OPEN: usize = 2;
318 pub const SYS_CLOSE: usize = 3;
319 pub const SYS_READ: usize = 4;
320 pub const SYS_WRITE: usize = 5;
321 pub const SYS_LSEEK: usize = 6;
322 pub const SYS_FORK: usize = 7;
323 pub const SYS_VFORK: usize = 8;
324 pub const SYS_BRK: usize = 9;
325 pub const SYS_SBRK: usize = 10;
327 pub const SYS_REBOOT: usize = 11;
328 pub const SYS_CHDIR: usize = 12;
329 pub const SYS_GET_DENTS: usize = 13;
330 pub const SYS_EXECVE: usize = 14;
331 pub const SYS_WAIT4: usize = 15;
332 pub const SYS_EXIT: usize = 16;
333 pub const SYS_MKDIR: usize = 17;
334 pub const SYS_NANOSLEEP: usize = 18;
336 pub const SYS_CLOCK: usize = 19;
337 pub const SYS_PIPE: usize = 20;
339 pub const __NOT_USED: usize = 21;
340 pub const SYS_UNLINK_AT: usize = 22;
341 pub const SYS_KILL: usize = 23;
342 pub const SYS_SIGACTION: usize = 24;
343 pub const SYS_RT_SIGRETURN: usize = 25;
344 pub const SYS_GETPID: usize = 26;
345 pub const SYS_SCHED: usize = 27;
346 pub const SYS_DUP: usize = 28;
347 pub const SYS_DUP2: usize = 29;
348 pub const SYS_SOCKET: usize = 30;
350 pub const SYS_SETSOCKOPT: usize = 31;
351 pub const SYS_GETSOCKOPT: usize = 32;
352 pub const SYS_CONNECT: usize = 33;
353 pub const SYS_BIND: usize = 34;
354 pub const SYS_SENDTO: usize = 35;
355 pub const SYS_RECVFROM: usize = 36;
356 pub const SYS_RECVMSG: usize = 37;
357 pub const SYS_LISTEN: usize = 38;
358 pub const SYS_SHUTDOWN: usize = 39;
359 pub const SYS_ACCEPT: usize = 40;
361 pub const SYS_GETSOCKNAME: usize = 41;
362 pub const SYS_GETPEERNAME: usize = 42;
363 pub const SYS_GETTIMEOFDAY: usize = 43;
364 pub const SYS_MMAP: usize = 44;
365 pub const SYS_MUNMAP: usize = 45;
367 pub const SYS_MPROTECT: usize = 46;
368 pub const SYS_FSTAT: usize = 47;
370 pub const SYS_GETCWD: usize = 48;
372 pub const SYS_GETPPID: usize = 49;
374 pub const SYS_GETPGID: usize = 50;
376 pub const SYS_FCNTL: usize = 51;
377 pub const SYS_FTRUNCATE: usize = 52;
383 fn do_put_string(s: *const u8, front_color: u32, back_color: u32) -> usize; in do_put_string() argument
408 pub fn handle(syscall_num: usize, args: &[usize], from_user: bool) -> usize { in handle() argument
438 let res = if from_user && verify_area(virt_addr, len as usize).is_err() { in handle()
457 let res = if from_user && verify_area(virt_addr, len as usize).is_err() { in handle()
511 let chdir_check = |arg0: usize| { in handle()
516 let virt_addr = VirtAddr::new(path_ptr as usize); in handle()
519 || (from_user && verify_area(virt_addr, PAGE_2M_SIZE as usize).is_err()) in handle()
527 } else if dest_path.len() > PAGE_4K_SIZE as usize { in handle()
548 let res = if from_user && verify_area(virt_addr, len as usize).is_err() { in handle()
572 && (verify_area(virt_path_ptr, PAGE_4K_SIZE as usize).is_err() in handle()
573 || verify_area(virt_argv_ptr, PAGE_4K_SIZE as usize).is_err()) in handle()
574 || verify_area(virt_env_ptr, PAGE_4K_SIZE as usize).is_err() in handle()
590 let virt_wstatus = VirtAddr::new(wstatus as usize); in handle()
591 let virt_rusage = VirtAddr::new(rusage as usize); in handle()
595 && (verify_area(virt_wstatus, core::mem::size_of::<c_int>() as usize).is_err() in handle()
596 || verify_area(virt_rusage, PAGE_4K_SIZE as usize).is_err()) in handle()
611 let virt_path_ptr = VirtAddr::new(path_ptr as usize); in handle()
614 || (from_user && verify_area(virt_path_ptr, PAGE_2M_SIZE as usize).is_err()) in handle()
638 let virt_req = VirtAddr::new(req as usize); in handle()
639 let virt_rem = VirtAddr::new(rem as usize); in handle()
641 && (verify_area(virt_req, core::mem::size_of::<TimeSpec>() as usize).is_err() in handle()
642 || verify_area(virt_rem, core::mem::size_of::<TimeSpec>() as usize) in handle()
654 let virt_pipefd = VirtAddr::new(pipefd as usize); in handle()
656 && verify_area(virt_pipefd, core::mem::size_of::<[c_int; 2]>() as usize) in handle()
672 let virt_pathname = VirtAddr::new(pathname as usize); in handle()
673 if from_user && verify_area(virt_pathname, PAGE_4K_SIZE as usize).is_err() { in handle()
732 let optlen = args[4] as usize; in handle()
733 let virt_optval = VirtAddr::new(optval as usize); in handle()
735 if verify_area(virt_optval, optlen as usize).is_err() { in handle()
745 let optlen = args[4] as *mut usize; in handle()
746 let virt_optval = VirtAddr::new(optval as usize); in handle()
747 let virt_optlen = VirtAddr::new(optlen as usize); in handle()
750 if verify_area(virt_optval, PAGE_4K_SIZE as usize).is_err() { in handle()
756 if verify_area(virt_optlen, core::mem::size_of::<u32>() as usize).is_err() { in handle()
772 let addrlen = args[2] as usize; in handle()
773 let virt_addr = VirtAddr::new(addr as usize); in handle()
775 if verify_area(virt_addr, addrlen as usize).is_err() { in handle()
784 let addrlen = args[2] as usize; in handle()
785 let virt_addr = VirtAddr::new(addr as usize); in handle()
787 if verify_area(virt_addr, addrlen as usize).is_err() { in handle()
797 let len = args[2] as usize; in handle()
800 let addrlen = args[5] as usize; in handle()
801 let virt_buf = VirtAddr::new(buf as usize); in handle()
802 let virt_addr = VirtAddr::new(addr as usize); in handle()
804 if verify_area(virt_buf, len as usize).is_err() { in handle()
807 } else if verify_area(virt_addr, addrlen as usize).is_err() { in handle()
818 let len = args[2] as usize; in handle()
821 let addrlen = args[5] as *mut usize; in handle()
822 let virt_buf = VirtAddr::new(buf as usize); in handle()
823 let virt_addrlen = VirtAddr::new(addrlen as usize); in handle()
824 let virt_addr = VirtAddr::new(addr as usize); in handle()
827 if verify_area(virt_buf, len as usize).is_err() { in handle()
833 if verify_area(virt_addrlen, core::mem::size_of::<u32>() as usize).is_err() { in handle()
838 if verify_area(virt_addr, core::mem::size_of::<SockAddr>() as usize).is_err() { in handle()
856 let virt_msg = VirtAddr::new(msg as usize); in handle()
861 core::mem::size_of::<crate::net::syscall::MsgHdr>() as usize, in handle()
892 let virt_timeval = VirtAddr::new(timeval as usize); in handle()
893 let virt_timezone_ptr = VirtAddr::new(timezone_ptr as usize); in handle()
895 if verify_area(virt_timeval, core::mem::size_of::<PosixTimeval>() as usize) in handle()
902 core::mem::size_of::<PosixTimeZone>() as usize, in handle()
923 let virt_addr = VirtAddr::new(args[0] as usize); in handle()
924 if verify_area(virt_addr, len as usize).is_err() { in handle()
961 let vaddr = VirtAddr::new(kstat as usize); in handle()
987 let len = args[1] as usize; in handle()
996 let r = r.unwrap_or_else(|e| e.to_posix_errno() as usize); in handle()
1004 ) -> Result<usize, SystemError> { in put_string() argument
1008 pub fn reboot() -> Result<usize, SystemError> { in reboot()