wip on ipc reply

This commit is contained in:
2026-03-01 00:05:22 +01:00
parent 4d9e71d278
commit debf37bd26

View File

@@ -256,7 +256,7 @@ int receive(Vault& v, void* buffer, size_t size) {
if(total_len - (i*4096) > 4096) if(total_len - (i*4096) > 4096)
copy_from_phys(v, paddr+offset, buffer, 4096-offset); copy_from_phys(v, paddr+offset, buffer, 4096-offset);
else else
copy_from_phys(v, paddr, buffer, total_len - (i*4096)); copy_from_phys(v, paddr, buffer, total_len - (i*4096)); //last page
} }
return ipc->pid; return ipc->pid;
@@ -276,8 +276,7 @@ bool reply(Vault& v, const void* buffer, size_t size) {
Thread* other_thread = v.thread_list[ipc->pid]; Thread* other_thread = v.thread_list[ipc->pid];
if (other_thread == nullptr) return false; if (other_thread == nullptr) return false;
uintptr_t phys_ptr = isMapped((uintptr_t)buffer, current_thread->paging_tree->l4 ); ipc->ptr = (uintptr_t)buffer;
ipc->ptr = phys_ptr + ((uintptr_t)buffer & 0xFFF);
ipc->size = size; ipc->size = size;
ipc->pid = current_thread->id; ipc->pid = current_thread->id;
ipc->is_answer = true; ipc->is_answer = true;