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:
Bahadir Balban
2008-02-29 21:56:05 +00:00
parent 55117c600b
commit 4f346cea53
9 changed files with 166 additions and 19 deletions

View File

@@ -61,6 +61,12 @@ void fault_ipc_to_pager(u32 faulty_pc, u32 fsr, u32 far)
*/
}
/*
* When a task calls the kernel and the supplied user buffer is not mapped, the kernel
* generates a page fault to the task's pager so that the pager can make the decision
* on mapping the buffer. Remember that if a task maps its own user buffer to itself
* this way, the kernel can access it, since it shares that task's page table.
*/
int pager_pagein_request(unsigned long addr, unsigned long size, unsigned int flags)
{
u32 abort;

View File

@@ -252,7 +252,7 @@ int check_mapping_pgd(unsigned long vaddr, unsigned long size,
/* Convert generic map flags to pagetable-specific */
BUG_ON(!(flags = space_flags_to_ptflags(flags)));
for (int i = 0; i < npages; i++) {
pte = virt_to_pte(vaddr + i * PAGE_SIZE);