mirror of
https://github.com/drasko/codezero.git
synced 2026-02-21 14:23:21 +01:00
Added the first means to pass information between 2 tasks using the
utcb as a shared page instead of the message registers. Implemented the code that passes task information from mm0 to fs0 using the fs0 utcb. The code seems to work OK but: There's an issue with anon pages that they end up on the same swapfile and with same file offsets (e.g. utcb and stack at offset 0). Need to fix this issue but otherwise this implementation seems to work. TODO: - Separate anon regions into separate vmfiles. - Possibly map the stacks from virtual files so that they can be read from userspace in the future for debugging. - Possibly utcb could be created as a shared memory object using shmget/shmat during startup.
This commit is contained in:
@@ -324,6 +324,17 @@ int do_anon_page(struct fault_data *fault)
|
||||
l4_map(paddr, (void *)page_align(fault->address), 1,
|
||||
MAP_USR_RW_FLAGS, fault->task->tid);
|
||||
|
||||
/*** DEBUG CODE FOR FS0 UTCB ***/
|
||||
if(page_align(fault->address) == 0xf8001000) {
|
||||
printf("For FS0 utcb @ 0xf8001000, mapping page @ 0x%x, foffset: 0x%x, owned by vma @ 0x%x, vmfile @ 0x%x\n",
|
||||
(unsigned long)page, page->f_offset, fault->vma, fault->vma->owner);
|
||||
}
|
||||
if(page_align(fault->address) == 0xf8002000) {
|
||||
printf("For FS0 utcb @ 0xf8002000, mapping page @ 0x%x, foffset: 0x%x, owned by vma @ 0x%x, vmfile @ 0x%x\n",
|
||||
(unsigned long)page, page->f_offset, fault->vma, fault->vma->owner);
|
||||
}
|
||||
/*** DEBUG CODE FOR FS0 UTCB ***/
|
||||
|
||||
spin_lock(&page->lock);
|
||||
/* vma's swap file owns this page */
|
||||
page->owner = fault->vma->owner;
|
||||
|
||||
Reference in New Issue
Block a user