Free a memory chunk containing the given virtual address
(
context_ptr: *mut Context,
virtaddr: u64
)
| 503 | |
| 504 | /// Free a memory chunk containing the given virtual address |
| 505 | fn sys_free( |
| 506 | context_ptr: *mut Context, |
| 507 | virtaddr: u64 |
| 508 | ) { |
| 509 | let context = unsafe {&mut (*context_ptr)}; |
| 510 | |
| 511 | match process::free_memory_chunk(VirtAddr::new(virtaddr)) { |
| 512 | Ok(()) => { |
| 513 | context.rax = 0; // No error |
| 514 | } |
| 515 | Err(code) => { |
| 516 | context.rax = code; |
| 517 | } |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | /// Yield to another process |
| 522 | fn sys_yield(context_ptr: *mut Context) { |
no test coverage detected