MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / sys_free

Function sys_free

kernel/src/syscalls.rs:505–519  ·  view source on GitHub ↗

Free a memory chunk containing the given virtual address

(
    context_ptr: *mut Context,
    virtaddr: u64
)

Source from the content-addressed store, hash-verified

503
504/// Free a memory chunk containing the given virtual address
505fn 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
522fn sys_yield(context_ptr: *mut Context) {

Callers 1

dispatch_syscallFunction · 0.85

Calls 1

free_memory_chunkFunction · 0.85

Tested by

no test coverage detected