diff options
author | Harald Koerfgen <hkoerfg@web.de> | 1999-08-09 19:43:13 +0000 |
---|---|---|
committer | Harald Koerfgen <hkoerfg@web.de> | 1999-08-09 19:43:13 +0000 |
commit | f67e4ffc79905482c3b9b8c8dd65197bac7eb508 (patch) | |
tree | c88163a075d06cf625e7f7aa69572144806d1175 /include/asm-mips | |
parent | 920be6021d3cd30ce10b1423b565f304736bf899 (diff) |
My proposal for non-generic kernels:
o only code for the configured CPU is compiled
and linked (saves ~100k for R3000 kernels!)
o removed a lot of indirect function calls
o removed Ralf's "cowboy patch"
o added sanity check for DECstations (print warning
if the kernel is configured for the wrong CPU)
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/mmu_context.h | 90 | ||||
-rw-r--r-- | include/asm-mips/pgtable.h | 16 | ||||
-rw-r--r-- | include/asm-mips/processor.h | 3 | ||||
-rw-r--r-- | include/asm-mips/ptrace.h | 4 | ||||
-rw-r--r-- | include/asm-mips/system.h | 2 |
5 files changed, 35 insertions, 80 deletions
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index b7c4c90cd..473e9e2a3 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.2 1998/05/07 03:02:50 ralf Exp $ +/* $Id: mmu_context.h,v 1.3 1999/01/04 16:09:23 ralf Exp $ * * Switch a MMU context. * @@ -11,52 +11,34 @@ #ifndef __ASM_MIPS_MMU_CONTEXT_H #define __ASM_MIPS_MMU_CONTEXT_H +#include <linux/config.h> + /* Fuck. The f-word is here so you can grep for it :-) */ extern unsigned long asid_cache; -/* I patch, therefore I am ... */ -#define ASID_INC(asid) \ - ({ unsigned long __asid = asid; \ - __asm__("1:\taddiu\t%0,0\t\t\t\t# patched\n\t" \ - ".section\t__asid_inc,\"a\"\n\t" \ - ".word\t1b\n\t" \ - ".previous" \ - :"=r" (__asid) \ - :"0" (__asid)); \ - __asid; }) -#define ASID_MASK(asid) \ - ({ unsigned long __asid = asid; \ - __asm__("1:\tandi\t%0,%1,0\t\t\t# patched\n\t" \ - ".section\t__asid_mask,\"a\"\n\t" \ - ".word\t1b\n\t" \ - ".previous" \ - :"=r" (__asid) \ - :"r" (__asid)); \ - __asid; }) -#define ASID_VERSION_MASK \ - ({ unsigned long __asid; \ - __asm__("1:\tli\t%0,0\t\t\t\t# patched\n\t" \ - ".section\t__asid_version_mask,\"a\"\n\t" \ - ".word\t1b\n\t" \ - ".previous" \ - :"=r" (__asid)); \ - __asid; }) -#define ASID_FIRST_VERSION \ - ({ unsigned long __asid = asid; \ - __asm__("1:\tli\t%0,0\t\t\t\t# patched\n\t" \ - ".section\t__asid_first_version,\"a\"\n\t" \ - ".word\t1b\n\t" \ - ".previous" \ - :"=r" (__asid)); \ - __asid; }) +#if defined(CONFIG_CPU_R3000) -#define ASID_FIRST_VERSION_R3000 0x1000 -#define ASID_FIRST_VERSION_R4000 0x100 +#define ASID_INC 0x40 +#define ASID_MASK 0xfc0 -extern inline void -get_new_mmu_context(struct mm_struct *mm, unsigned long asid) +#else /* FIXME: not correct for R6000, R8000 */ + +#define ASID_INC 0x1 +#define ASID_MASK 0xff + +#endif + +/* + * All unused by hardware upper bits will be considered + * as a software asid extension. + */ +#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) +#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) + +extern inline void get_new_mmu_context(struct mm_struct *mm, unsigned +long asid) { - if (!ASID_MASK((asid = ASID_INC(asid)))) { + if (! ((asid += ASID_INC) & ASID_MASK) ) { flush_tlb_all(); /* start new asid cycle */ if (!asid) /* fix version if needed */ asid = ASID_FIRST_VERSION; @@ -105,30 +87,4 @@ extern inline void activate_context(struct task_struct *tsk) set_entryhi(tsk->mm->context); } -extern void __asid_setup(unsigned int inc, unsigned int mask, - unsigned int version_mask, unsigned int first_version); - -extern inline void r3000_asid_setup(void) -{ - __asid_setup(0x40, 0xfc0, 0xf000, ASID_FIRST_VERSION_R3000); -} - -extern inline void r6000_asid_setup(void) -{ - panic("r6000_asid_setup: implement me"); /* No idea ... */ -} - -extern inline void tfp_asid_setup(void) -{ - panic("tfp_asid_setup: implement me"); /* No idea ... */ -} - -extern inline void r4xx0_asid_setup(void) -{ - __asid_setup(1, 0xff, 0xff00, ASID_FIRST_VERSION_R4000); -} - -/* R10000 has the same ASID mechanism as the R4000. */ -#define andes_asid_setup r4xx0_asid_setup - #endif /* __ASM_MIPS_MMU_CONTEXT_H */ diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index d74a241c9..4413ea45d 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -41,16 +41,16 @@ extern void (*flush_page_to_ram)(unsigned long page); * - flush_tlb_page(mm, vmaddr) flushes a single page * - flush_tlb_range(mm, start, end) flushes a range of pages */ -extern void (*flush_tlb_all)(void); -extern void (*flush_tlb_mm)(struct mm_struct *mm); -extern void (*flush_tlb_range)(struct mm_struct *mm, unsigned long start, +extern void flush_tlb_all(void); +extern void flush_tlb_mm(struct mm_struct *mm); +extern void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end); -extern void (*flush_tlb_page)(struct vm_area_struct *vma, unsigned long page); +extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); /* * - add_wired_entry() add a fixed TLB entry, and move wired register */ -extern void (*add_wired_entry)(unsigned long entrylo0, unsigned long entrylo1, +extern void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, unsigned long entryhi, unsigned long pagemask); @@ -219,7 +219,7 @@ extern unsigned long zero_page_mask; #define PAGE_PTR(address) \ ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) -extern void (*load_pgd)(unsigned long pg_dir); +extern void load_pgd(unsigned long pg_dir); /* to set the page-dir */ #define SET_PAGE_DIR(tsk,pgdir) (tsk)->tss.pg_dir = ((unsigned long) (pgdir)) @@ -405,7 +405,7 @@ extern inline pte_t *pte_offset(pmd_t * dir, unsigned long address) /* * Initialize new page directory with pointers to invalid ptes */ -extern void (*pgd_init)(unsigned long page); +extern void pgd_init(unsigned long page); /* * Allocate and free page tables. The xxx_kernel() versions are @@ -590,7 +590,7 @@ extern inline void set_pgdir(unsigned long address, pgd_t entry) extern pgd_t swapper_pg_dir[1024]; -extern void (*update_mmu_cache)(struct vm_area_struct *vma, +extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte); /* diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 8c587afa5..3075f66c4 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.15 1999/02/15 02:22:12 ralf Exp $ +/* $Id: processor.h,v 1.16 1999/06/17 13:30:37 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -202,7 +202,6 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) } struct pt_regs; -extern int (*user_mode)(struct pt_regs *); /* * Do necessary setup to start up a newly executed thread. diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index e7db7a022..2531fb863 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h @@ -60,11 +60,11 @@ struct pt_regs { /* * Does the process account for user or for system time? */ -#define user_mode(regs) ((regs)->cp0_status & KU_USER) +#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) #define instruction_pointer(regs) ((regs)->cp0_epc) -extern void (*show_regs)(struct pt_regs *); +extern void show_regs(struct pt_regs *); #endif /* !(__ASSEMBLY__) */ #endif diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index a397989a0..ee2ebc438 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -145,7 +145,7 @@ __asm__ __volatile__( \ * switch_to(n) should switch tasks to task nr n, first * checking that n isn't the current task, in which case it does nothing. */ -extern asmlinkage void *(*resume)(void *last, void *next); +extern asmlinkage void *resume(void *last, void *next); #endif /* !defined (_LANGUAGE_ASSEMBLY) */ #define switch_to(prev,next,last) \ |