Commit 3fc0447a authored by Jeff Dike's avatar Jeff Dike

Fixed various build problems with the tlb.c merge.

parent f575fea5
......@@ -23,8 +23,8 @@ extern void initial_thread_cb_skas(void (*proc)(void *), void *arg);
extern void init_idle_skas(void);
extern void flush_tlb_kernel_vm_skas(void);
extern void __flush_tlb_one_skas(unsigned long addr);
extern void flush_tlb_range_skas(struct mm_struct *mm, unsigned long start,
unsigned long end);
extern void flush_tlb_range_skas(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
extern void flush_tlb_mm_skas(struct mm_struct *mm);
extern void force_flush_all_skas(void);
extern long execute_syscall_skas(void *r);
......
......@@ -5,6 +5,7 @@
#include "linux/stddef.h"
#include "linux/sched.h"
#include "linux/mm.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include "asm/mmu.h"
......@@ -28,7 +29,7 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr,
npgd = pgd_offset(mm, addr);
npmd = pmd_offset(npgd, addr);
if(pmd_present(*npmd)){
npte = pte_offset(npmd, addr);
npte = pte_offset_kernel(npmd, addr);
r = pte_read(*npte);
w = pte_write(*npte);
x = pte_exec(*npte);
......@@ -80,7 +81,7 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end)
pgd = pgd_offset(mm, addr);
pmd = pmd_offset(pgd, addr);
if(pmd_present(*pmd)){
pte = pte_offset(pmd, addr);
pte = pte_offset_kernel(pmd, addr);
if(!pte_present(*pte) || pte_newpage(*pte)){
updated = 1;
err = os_unmap_memory((void *) addr,
......@@ -123,12 +124,12 @@ void __flush_tlb_one_skas(unsigned long addr)
flush_kernel_vm_range(addr, addr + PAGE_SIZE);
}
void flush_tlb_range_skas(struct mm_struct *mm, unsigned long start,
void flush_tlb_range_skas(struct vm_area_struct *vma, unsigned long start,
unsigned long end)
{
if(mm == NULL)
if(vma->vm_mm == NULL)
flush_kernel_vm_range(start, end);
else fix_range(mm, start, end, 0);
else fix_range(vma->vm_mm, start, end, 0);
}
void flush_tlb_mm_skas(struct mm_struct *mm)
......
......@@ -6,18 +6,14 @@
#include "linux/mm.h"
#include "asm/page.h"
#include "asm/pgalloc.h"
#include "asm/tlbflush.h"
#include "choose-mode.h"
#include "mode_kern.h"
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
flush_kernel_range(start, end, 1);
}
void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)
{
address &= PAGE_MASK;
flush_tlb_range(vma->vm_mm, address, address + PAGE_SIZE);
flush_tlb_range(vma, address, address + PAGE_SIZE);
}
void flush_tlb_all(void)
......@@ -35,10 +31,10 @@ void __flush_tlb_one(unsigned long addr)
CHOOSE_MODE_PROC(__flush_tlb_one_tt, __flush_tlb_one_skas, addr);
}
void flush_tlb_range(struct mm_struct *mm, unsigned long start,
void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end)
{
CHOOSE_MODE_PROC(flush_tlb_range_tt, flush_tlb_range_skas, mm, start,
CHOOSE_MODE_PROC(flush_tlb_range_tt, flush_tlb_range_skas, vma, start,
end);
}
......
......@@ -24,8 +24,8 @@ extern void initial_thread_cb_tt(void (*proc)(void *), void *arg);
extern void init_idle_tt(void);
extern void flush_tlb_kernel_vm_tt(void);
extern void __flush_tlb_one_tt(unsigned long addr);
extern void flush_tlb_range_tt(struct mm_struct *mm, unsigned long start,
unsigned long end);
extern void flush_tlb_range_tt(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
extern void flush_tlb_mm_tt(struct mm_struct *mm);
extern void force_flush_all_tt(void);
extern long execute_syscall_tt(void *r);
......
......@@ -6,6 +6,7 @@
#include "linux/stddef.h"
#include "linux/kernel.h"
#include "linux/sched.h"
#include "linux/mm.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include "asm/uaccess.h"
......@@ -130,6 +131,11 @@ void flush_kernel_range(unsigned long start, unsigned long end, int update_seq)
if(updated && update_seq) atomic_inc(&vmchange_seq);
}
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
flush_kernel_range(start, end, 1);
}
static void protect_vm_page(unsigned long addr, int w, int must_succeed)
{
int err;
......@@ -166,25 +172,25 @@ void mprotect_kernel_vm(int w)
void flush_tlb_kernel_vm_tt(void)
{
flush_tlb_kernel_vm_range(start_vm, end_vm);
flush_tlb_kernel_range(start_vm, end_vm);
}
void __flush_tlb_one_tt(unsigned long addr)
{
flush_tlb_kernel_vm_range(addr, addr + PAGE_SIZE);
flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
}
void flush_tlb_range_tt(struct mm_struct *mm, unsigned long start,
void flush_tlb_range_tt(struct vm_area_struct *vma, unsigned long start,
unsigned long end)
{
if(mm != current->mm) return;
if(vma->vm_mm != current->mm) return;
/* Assumes that the range start ... end is entirely within
* either process memory or kernel vm
*/
if((start >= start_vm) && (start < end_vm))
flush_kernel_vm_range(start, end, 1);
else fix_range(mm, start, end, 0);
flush_kernel_range(start, end, 1);
else fix_range(vma->vm_mm, start, end, 0);
}
void flush_tlb_mm_tt(struct mm_struct *mm)
......@@ -198,13 +204,13 @@ void flush_tlb_mm_tt(struct mm_struct *mm)
seq = atomic_read(&vmchange_seq);
if(current->thread.mode.tt.vm_seq == seq) return;
current->thread.mode.tt.vm_seq = seq;
flush_kernel_vm_range(start_vm, end_vm, 0);
flush_kernel_range(start_vm, end_vm, 0);
}
void force_flush_all_tt(void)
{
fix_range(current->mm, 0, STACK_TOP, 1);
flush_kernel_vm_range(start_vm, end_vm, 0);
flush_kernel_range(start_vm, end_vm, 0);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment