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

Function sys_copy_rendezvous

kernel/src/syscalls.rs:547–565  ·  view source on GitHub ↗

Make a copy of a Rendezvous Takes handle as first argument (syscall RDI) Returns new handle in RDI

(context_ptr: *mut Context, handle: u64)

Source from the content-addressed store, hash-verified

545/// Takes handle as first argument (syscall RDI)
546/// Returns new handle in RDI
547fn sys_copy_rendezvous(context_ptr: *mut Context, handle: u64) {
548 let context = unsafe {&mut (*context_ptr)};
549
550 if let Some(mut thread) = process::take_current_thread() {
551 thread.set_context(context_ptr);
552
553 // Thread::rendezvous() returns a clone
554 if let Some(rdv) = thread.rendezvous(handle) {
555 let new_handle = thread.give_rendezvous(rdv);
556 // Return
557 context.rax = 0; // Success!
558 context.rdi = new_handle;
559 } else {
560 // Missing handle
561 thread.return_error(SYSCALL_ERROR_INVALID_HANDLE);
562 }
563 process::set_current_thread(thread);
564 }
565}
566
567/// Create a new process
568///

Callers 1

dispatch_syscallFunction · 0.85

Calls 6

take_current_threadFunction · 0.85
set_current_threadFunction · 0.85
set_contextMethod · 0.80
rendezvousMethod · 0.80
give_rendezvousMethod · 0.80
return_errorMethod · 0.80

Tested by

no test coverage detected