(path: &str, mut handle: CommHandle)
| 577 | } |
| 578 | |
| 579 | pub fn mount(path: &str, mut handle: CommHandle) -> Result<(), SyscallError> { |
| 580 | let error: u64; |
| 581 | unsafe { |
| 582 | asm!("syscall", |
| 583 | // RAX contains | handle (32) | empty (24) | syscall (8) |
| 584 | in("rax") SYSCALL_MOUNT | ((handle.take() as u64) << 32), |
| 585 | // RDI contains pointer to string data |
| 586 | in("rdi") path.as_ptr() as usize, |
| 587 | // RSI contains string length |
| 588 | in("rsi") path.len(), |
| 589 | lateout("rax") error, |
| 590 | out("rcx") _, |
| 591 | out("r11") _); |
| 592 | } |
| 593 | if error == 0 { |
| 594 | Ok(()) |
| 595 | } else { |
| 596 | Err(SyscallError(error)) |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | pub fn list_mounts() -> Result<(MemoryHandle, u64), SyscallError> { |
| 601 | let error: u64; |
nothing calls this directly
no test coverage detected