diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/kernel/skas/tlb.c | |
download | op-kernel-dev-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.zip op-kernel-dev-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.gz |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/um/kernel/skas/tlb.c')
-rw-r--r-- | arch/um/kernel/skas/tlb.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c new file mode 100644 index 0000000..b8c5e717 --- /dev/null +++ b/arch/um/kernel/skas/tlb.c @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. + * Licensed under the GPL + */ + +#include "linux/stddef.h" +#include "linux/sched.h" +#include "linux/mm.h" +#include "asm/page.h" +#include "asm/pgtable.h" +#include "asm/mmu.h" +#include "user_util.h" +#include "mem_user.h" +#include "mem.h" +#include "skas.h" +#include "os.h" +#include "tlb.h" + +static void do_ops(int fd, struct host_vm_op *ops, int last) +{ + struct host_vm_op *op; + int i; + + for(i = 0; i <= last; i++){ + op = &ops[i]; + switch(op->type){ + case MMAP: + map(fd, op->u.mmap.addr, op->u.mmap.len, + op->u.mmap.r, op->u.mmap.w, op->u.mmap.x, + op->u.mmap.fd, op->u.mmap.offset); + break; + case MUNMAP: + unmap(fd, (void *) op->u.munmap.addr, + op->u.munmap.len); + break; + case MPROTECT: + protect(fd, op->u.mprotect.addr, op->u.mprotect.len, + op->u.mprotect.r, op->u.mprotect.w, + op->u.mprotect.x); + break; + default: + printk("Unknown op type %d in do_ops\n", op->type); + break; + } + } +} + +static void fix_range(struct mm_struct *mm, unsigned long start_addr, + unsigned long end_addr, int force) +{ + int fd = mm->context.skas.mm_fd; + + fix_range_common(mm, start_addr, end_addr, force, fd, do_ops); +} + +void __flush_tlb_one_skas(unsigned long addr) +{ + flush_tlb_kernel_range_common(addr, addr + PAGE_SIZE); +} + +void flush_tlb_range_skas(struct vm_area_struct *vma, unsigned long start, + unsigned long end) +{ + if(vma->vm_mm == NULL) + flush_tlb_kernel_range_common(start, end); + else fix_range(vma->vm_mm, start, end, 0); +} + +void flush_tlb_mm_skas(struct mm_struct *mm) +{ + /* Don't bother flushing if this address space is about to be + * destroyed. + */ + if(atomic_read(&mm->mm_users) == 0) + return; + + fix_range(mm, 0, host_task_size, 0); + flush_tlb_kernel_range_common(start_vm, end_vm); +} + +void force_flush_all_skas(void) +{ + fix_range(current->mm, 0, host_task_size, 1); +} |