summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/proc-armo
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
commit546db14ee74118296f425f3b91634fb767d67290 (patch)
tree22b613a3da8d4bf663eec5e155af01b87fdf9094 /include/asm-arm/proc-armo
parent1e25e41c4f5474e14452094492dbc169b800e4c8 (diff)
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles and IP27 actually works.
Diffstat (limited to 'include/asm-arm/proc-armo')
-rw-r--r--include/asm-arm/proc-armo/assembler.h56
-rw-r--r--include/asm-arm/proc-armo/cache.h67
-rw-r--r--include/asm-arm/proc-armo/elf.h9
-rw-r--r--include/asm-arm/proc-armo/mm-init.h55
-rw-r--r--include/asm-arm/proc-armo/page.h60
-rw-r--r--include/asm-arm/proc-armo/param.h28
-rw-r--r--include/asm-arm/proc-armo/pgtable.h294
-rw-r--r--include/asm-arm/proc-armo/processor.h11
-rw-r--r--include/asm-arm/proc-armo/ptrace.h40
-rw-r--r--include/asm-arm/proc-armo/system.h7
-rw-r--r--include/asm-arm/proc-armo/uaccess.h32
11 files changed, 152 insertions, 507 deletions
diff --git a/include/asm-arm/proc-armo/assembler.h b/include/asm-arm/proc-armo/assembler.h
index 5b9e7c058..d611ea4dd 100644
--- a/include/asm-arm/proc-armo/assembler.h
+++ b/include/asm-arm/proc-armo/assembler.h
@@ -6,54 +6,30 @@
* This file contains arm architecture specific defines
* for the different processors
*/
+#ifndef __ASSEMBLY__
+#error "Only include this from assembly code"
+#endif
-/*
- * LOADREGS: multiple register load (ldm) with pc in register list
- * (takes account of ARM6 not using ^)
- *
- * RETINSTR: return instruction: adds the 's' in at the end of the
- * instruction if this is not an ARM6
- *
- * SAVEIRQS: save IRQ state (not required on ARM2/ARM3 - done
- * implicitly
- *
- * RESTOREIRQS: restore IRQ state (not required on ARM2/ARM3 - done
- * implicitly with ldm ... ^ or movs.
- *
- * These next two need thinking about - can't easily use stack... (see system.S)
- * DISABLEIRQS: disable IRQS in SVC mode
- *
- * ENABLEIRQS: enable IRQS in SVC mode
- *
- * USERMODE: switch to USER mode
- *
- * SVCMODE: switch to SVC mode
- */
-
-#define N_BIT (1 << 31)
-#define Z_BIT (1 << 30)
-#define C_BIT (1 << 29)
-#define V_BIT (1 << 28)
-
-#define PCMASK 0xfc000003
-
-#ifdef __ASSEMBLER__
-
-#define I_BIT (1 << 27)
-#define F_BIT (1 << 26)
-
-#define MODE_USR 0
-#define MODE_FIQ 1
-#define MODE_IRQ 2
-#define MODE_SVC 3
+#define MODE_USR USR26_MODE
+#define MODE_FIQ FIQ26_MODE
+#define MODE_IRQ IRQ26_MODE
+#define MODE_SVC SVC26_MODE
#define DEFAULT_FIQ MODE_FIQ
+#ifdef __STDC__
#define LOADREGS(cond, base, reglist...)\
ldm##cond base,reglist^
#define RETINSTR(instr, regs...)\
instr##s regs
+#else
+#define LOADREGS(cond, base, reglist...)\
+ ldm/**/cond base,reglist^
+
+#define RETINSTR(instr, regs...)\
+ instr/**/s regs
+#endif
#define MODENOP\
mov r0, r0
@@ -84,5 +60,3 @@
#define SVCMODE(tmpreg)\
teqp pc, $0x00000003;\
mov r0, r0
-
-#endif
diff --git a/include/asm-arm/proc-armo/cache.h b/include/asm-arm/proc-armo/cache.h
new file mode 100644
index 000000000..d39b7b79f
--- /dev/null
+++ b/include/asm-arm/proc-armo/cache.h
@@ -0,0 +1,67 @@
+/*
+ * Cache flushing...
+ */
+#define flush_cache_all() do { } while (0)
+#define flush_cache_mm(mm) do { } while (0)
+#define flush_cache_range(mm,start,end) do { } while (0)
+#define flush_cache_page(vma,vmaddr) do { } while (0)
+#define flush_page_to_ram(page) do { } while (0)
+#define flush_icache_range(start,end) do { } while (0)
+
+/*
+ * TLB flushing:
+ *
+ * - flush_tlb_all() flushes all processes TLBs
+ * - flush_tlb_mm(mm) flushes the specified mm context TLB's
+ * - flush_tlb_page(vma, vmaddr) flushes one page
+ * - flush_tlb_range(mm, start, end) flushes a range of pages
+ */
+#define flush_tlb_all() memc_update_all()
+#define flush_tlb_mm(mm) do { } while (0)
+#define flush_tlb_range(mm, start, end) do { (void)(start); (void)(end); } while (0)
+#define flush_tlb_page(vma, vmaddr) do { } while (0)
+
+/*
+ * The following handle the weird MEMC chip
+ */
+extern __inline__ void memc_update_all(void)
+{
+ struct task_struct *p;
+
+ cpu_memc_update_all(init_mm.pgd);
+ for_each_task(p) {
+ if (!p->mm)
+ continue;
+ cpu_memc_update_all(p->mm->pgd);
+ }
+ processor._set_pgd(current->active_mm->pgd);
+}
+
+extern __inline__ void memc_update_mm(struct mm_struct *mm)
+{
+ cpu_memc_update_all(mm->pgd);
+
+ if (mm == current->active_mm)
+ processor._set_pgd(mm->pgd);
+}
+
+extern __inline__ void
+memc_update_addr(struct mm_struct *mm, pte_t pte, unsigned long addr)
+{
+ cpu_memc_update_entry(mm->pgd, pte_val(pte), addr);
+
+ if (mm == current->active_mm)
+ processor._set_pgd(mm->pgd);
+}
+
+extern __inline__ void
+memc_clear(struct mm_struct *mm, unsigned long phys_addr)
+{
+ cpu_memc_update_entry(mm->pgd, phys_addr, 0);
+
+ if (mm == current->active_mm)
+ processor._set_pgd(mm->pgd);
+}
+
+#define __flush_entry_to_ram(entry)
+
diff --git a/include/asm-arm/proc-armo/elf.h b/include/asm-arm/proc-armo/elf.h
index 535deef31..1fc5e957e 100644
--- a/include/asm-arm/proc-armo/elf.h
+++ b/include/asm-arm/proc-armo/elf.h
@@ -4,14 +4,11 @@
#define ELF_EXEC_PAGESIZE 32768
-#if 0 /* not yet */
+#ifdef __KERNEL__
+
+/* We can only execute 26-bit code. */
#define ELF_PROC_OK(x) \
((x)->e_flags & EF_ARM_APCS26)
-#else
-#define ELF_PROC_OK(x) (1)
-#endif
-
-#ifdef __KERNEL__
#define SET_PERSONALITY(ex,ibcs2) \
current->personality = PER_LINUX
diff --git a/include/asm-arm/proc-armo/mm-init.h b/include/asm-arm/proc-armo/mm-init.h
deleted file mode 100644
index ce0fd84e6..000000000
--- a/include/asm-arm/proc-armo/mm-init.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * linux/include/asm-arm/proc-armo/mm-init.h
- *
- * Copyright (C) 1996 Russell King
- *
- * This contains the code to setup the memory map on an ARM2/ARM250/ARM3
- * machine. This is both processor & architecture specific, and requires
- * some more work to get it to fit into our separate processor and
- * architecture structure.
- */
-#include <asm/arch/memory.h>
-
-int page_nr;
-
-#define setup_processor_functions()
-#define PTE_SIZE (PTRS_PER_PTE * BYTES_PER_PTR)
-
-static inline void setup_swapper_dir (int index, pte_t *ptep)
-{
- set_pmd (pmd_offset (swapper_pg_dir + index, 0), mk_pmd (ptep));
-}
-
-static inline unsigned long
-setup_pagetables(unsigned long start_mem, unsigned long end_mem)
-{
- unsigned int i;
- union { unsigned long l; pte_t *pte; } u;
-
- page_nr = MAP_NR(end_mem);
-
- /* map in pages for (0x0000 - 0x8000) */
- u.l = ((start_mem + (PTE_SIZE-1)) & ~(PTE_SIZE-1));
- start_mem = u.l + PTE_SIZE;
- memzero (u.pte, PTE_SIZE);
- u.pte[0] = mk_pte(PAGE_OFFSET + 491520, PAGE_READONLY);
- setup_swapper_dir (0, u.pte);
-
- for (i = 1; i < PTRS_PER_PGD; i++)
- pgd_val(swapper_pg_dir[i]) = 0;
-
- return start_mem;
-}
-
-static inline void
-mark_usable_memory_areas(unsigned long *start_mem, unsigned long end_mem)
-{
- unsigned long smem;
-
- *start_mem = smem = PAGE_ALIGN(*start_mem);
-
- while (smem < end_mem) {
- clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
- smem += PAGE_SIZE;
- }
-}
diff --git a/include/asm-arm/proc-armo/page.h b/include/asm-arm/proc-armo/page.h
index 3768284a2..dd3331994 100644
--- a/include/asm-arm/proc-armo/page.h
+++ b/include/asm-arm/proc-armo/page.h
@@ -3,74 +3,18 @@
*
* Copyright (C) 1995, 1996 Russell King
*/
-
#ifndef __ASM_PROC_PAGE_H
#define __ASM_PROC_PAGE_H
#include <linux/config.h>
/* PAGE_SHIFT determines the page size. This is configurable. */
-#if defined(CONFIG_PAGESIZE_8)
-#define PAGE_SHIFT 13 /* 8K */
-#elif defined(CONFIG_PAGESIZE_16)
+#if defined(CONFIG_PAGESIZE_16)
#define PAGE_SHIFT 14 /* 16K */
#else /* default */
#define PAGE_SHIFT 15 /* 32K */
#endif
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
-#ifdef __KERNEL__
-
-#define STRICT_MM_TYPECHECKS
-
-#ifdef STRICT_MM_TYPECHECKS
-/*
- * These are used to make use of C type-checking..
- */
-typedef struct { unsigned long pte; } pte_t;
-typedef struct { unsigned long pmd; } pmd_t;
-typedef struct { unsigned long pgd; } pgd_t;
-typedef struct { unsigned long pgprot; } pgprot_t;
-
-#define pte_val(x) ((x).pte)
-#define pmd_val(x) ((x).pmd)
-#define pgd_val(x) ((x).pgd)
-#define pgprot_val(x) ((x).pgprot)
-
-#define __pte(x) ((pte_t) { (x) } )
-#define __pmd(x) ((pmd_t) { (x) } )
-#define __pgd(x) ((pgd_t) { (x) } )
-#define __pgprot(x) ((pgprot_t) { (x) } )
-
-#else
-/*
- * .. while these make it easier on the compiler
- */
-typedef unsigned long pte_t;
-typedef unsigned long pmd_t;
-typedef unsigned long pgd_t;
-typedef unsigned long pgprot_t;
-
-#define pte_val(x) (x)
-#define pmd_val(x) (x)
-#define pgd_val(x) (x)
-#define pgprot_val(x) (x)
-
-#define __pte(x) (x)
-#define __pmd(x) (x)
-#define __pgd(x) (x)
-#define __pgprot(x) (x)
-
-#endif
-
-/* to align the pointer to the (next) page boundary */
-#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
-/* This handles the memory map.. */
-#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
-
-#endif /* __KERNEL__ */
+#define EXEC_PAGESIZE 32768
#endif /* __ASM_PROC_PAGE_H */
-
diff --git a/include/asm-arm/proc-armo/param.h b/include/asm-arm/proc-armo/param.h
deleted file mode 100644
index 9ffb72f18..000000000
--- a/include/asm-arm/proc-armo/param.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * linux/include/asm-arm/proc-armo/param.h
- *
- * Copyright (C) 1995, 1996 Russell King
- */
-
-#ifndef __ASM_PROC_PARAM_H
-#define __ASM_PROC_PARAM_H
-
-#ifndef HZ
-#define HZ 100
-#define HZ_TO_STD(a) (a)
-#endif
-
-#define EXEC_PAGESIZE 32768
-
-#ifndef NGROUPS
-#define NGROUPS 32
-#endif
-
-#ifndef NOGROUP
-#define NOGROUP (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64 /* max length of hostname */
-
-#endif
-
diff --git a/include/asm-arm/proc-armo/pgtable.h b/include/asm-arm/proc-armo/pgtable.h
index 4a7b8c6f0..5a0b4e833 100644
--- a/include/asm-arm/proc-armo/pgtable.h
+++ b/include/asm-arm/proc-armo/pgtable.h
@@ -1,105 +1,25 @@
/*
* linux/include/asm-arm/proc-armo/pgtable.h
*
- * Copyright (C) 1995, 1996 Russell King
- * Modified 18/19-Oct-1997 for two-level page table
+ * Copyright (C) 1995-1999 Russell King
+ *
+ * 18-Oct-1997 RMK Now two-level (32x32)
*/
#ifndef __ASM_PROC_PGTABLE_H
#define __ASM_PROC_PGTABLE_H
-#include <linux/config.h>
-#include <linux/slab.h>
-#include <asm/arch/memory.h> /* For TASK_SIZE */
-
-#define LIBRARY_TEXT_START 0x0c000000
-
-/*
- * Cache flushing...
- */
-#define flush_cache_all() do { } while (0)
-#define flush_cache_mm(mm) do { } while (0)
-#define flush_cache_range(mm,start,end) do { } while (0)
-#define flush_cache_page(vma,vmaddr) do { } while (0)
-#define flush_page_to_ram(page) do { } while (0)
-#define flush_icache_range(start,end) do { } while (0)
-
-/*
- * TLB flushing:
- *
- * - flush_tlb() flushes the current mm struct TLBs
- * - flush_tlb_all() flushes all processes TLBs
- * - flush_tlb_mm(mm) flushes the specified mm context TLB's
- * - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
- */
-#define flush_tlb() do { } while (0)
-#define flush_tlb_all() do { } while (0)
-#define flush_tlb_mm(mm) do { } while (0)
-#define flush_tlb_range(mm, start, end) do { } while (0)
-#define flush_tlb_page(vma, vmaddr) do { } while (0)
+#include <asm/proc/domain.h>
/*
- * We have a mem map cache...
+ * PMD_SHIFT determines the size of the area a second-level page table can map
*/
-extern __inline__ void update_memc_all(void)
-{
- struct task_struct *p;
-
- p = &init_task;
- do {
- processor.u.armv2._update_map(p);
- p = p->next_task;
- } while (p != &init_task);
-
- processor.u.armv2._remap_memc (current);
-}
-
-extern __inline__ void update_memc_task(struct task_struct *tsk)
-{
- processor.u.armv2._update_map(tsk);
-
- if (tsk == current)
- processor.u.armv2._remap_memc (tsk);
-}
-
-extern __inline__ void update_memc_mm(struct mm_struct *mm)
-{
- struct task_struct *p;
-
- p = &init_task;
- do {
- if (p->mm == mm)
- processor.u.armv2._update_map(p);
- p = p->next_task;
- } while (p != &init_task);
-
- if (current->mm == mm)
- processor.u.armv2._remap_memc (current);
-}
-
-extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr, pte_t pte)
-{
- struct task_struct *p;
-
- p = &init_task;
- do {
- if (p->mm == mm)
- processor.u.armv2._update_mmu_cache(p, addr, pte);
- p = p->next_task;
- } while (p != &init_task);
-
- if (current->mm == mm)
- processor.u.armv2._remap_memc (current);
-}
-
-#define __flush_entry_to_ram(entry)
-
-/* PMD_SHIFT determines the size of the area a second-level page table can map */
#define PMD_SHIFT 20
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1))
-/* PGDIR_SHIFT determines what a third-level page table entry can map */
+/*
+ * PGDIR_SHIFT determines what a third-level page table entry can map
+ */
#define PGDIR_SHIFT 20
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PGDIR_MASK (~(PGDIR_SIZE-1))
@@ -107,8 +27,6 @@ extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr
/*
* entries per page directory level: the arm3 is one-level, so
* we don't really have any PMD or PTE directory physically.
- *
- * 18-Oct-1997 RMK Now two-level (32x32)
*/
#define PTRS_PER_PTE 32
#define PTRS_PER_PMD 1
@@ -119,11 +37,11 @@ extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#define VMALLOC_END 0x01c00000
-#define _PAGE_PRESENT 0x01
-#define _PAGE_READONLY 0x02
-#define _PAGE_NOT_USER 0x04
-#define _PAGE_OLD 0x08
-#define _PAGE_CLEAN 0x10
+#define _PAGE_PRESENT 0x01
+#define _PAGE_READONLY 0x02
+#define _PAGE_NOT_USER 0x04
+#define _PAGE_OLD 0x08
+#define _PAGE_CLEAN 0x10
#define _PAGE_TABLE (_PAGE_PRESENT)
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_OLD | _PAGE_CLEAN)
@@ -157,47 +75,6 @@ extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr
#define __S110 PAGE_SHARED
#define __S111 PAGE_SHARED
-#undef TEST_VERIFY_AREA
-
-extern unsigned long *empty_zero_page;
-
-/*
- * BAD_PAGETABLE is used when we need a bogus page-table, while
- * BAD_PAGE is used for a bogus page.
- *
- * ZERO_PAGE is a global shared page that is always zero: used
- * for zero-mapped memory areas etc..
- */
-extern pte_t __bad_page(void);
-extern pte_t *__bad_pagetable(void);
-
-#define BAD_PAGETABLE __bad_pagetable()
-#define BAD_PAGE __bad_page()
-#define ZERO_PAGE(vaddr) ((unsigned long) empty_zero_page)
-
-/* number of bits that fit into a memory pointer */
-#define BYTES_PER_PTR (sizeof(unsigned long))
-#define BITS_PER_PTR (8*BYTES_PER_PTR)
-
-/* to align the pointer to a pointer address */
-#define PTR_MASK (~(sizeof(void*)-1))
-
-/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
-#define SIZEOF_PTR_LOG2 2
-
-/* to find an entry in a page-table */
-#define PAGE_PTR(address) \
-((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
-
-/* to set the page-dir */
-#define SET_PAGE_DIR(tsk,pgdir) \
-do { \
- tsk->tss.memmap = (unsigned long)pgdir; \
- processor.u.armv2._update_map(tsk); \
- if ((tsk) == current) \
- processor.u.armv2._remap_memc (current); \
-} while (0)
-
extern unsigned long physical_start;
extern unsigned long physical_end;
@@ -229,7 +106,6 @@ extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_
extern inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NOT_USER); }
extern inline int pte_dirty(pte_t pte) { return !(pte_val(pte) & _PAGE_CLEAN); }
extern inline int pte_young(pte_t pte) { return !(pte_val(pte) & _PAGE_OLD); }
-#define pte_cacheable(pte) 1
extern inline pte_t pte_nocache(pte_t pte) { return pte; }
extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_READONLY; return pte; }
@@ -322,128 +198,45 @@ extern __inline__ pte_t * pte_offset(pmd_t *dir, unsigned long address)
* if any.
*/
-#ifndef __SMP__
-#ifndef CONFIG_NO_PGT_CACHE
-extern struct pgtable_cache_struct {
- unsigned long *pgd_cache;
- unsigned long *pte_cache;
- unsigned long pgtable_cache_sz;
-} quicklists;
-
-#define pmd_quicklist ((unsigned long *)0)
-#define pte_quicklist (quicklists.pte_cache)
-#define pgd_quicklist (quicklists.pgd_cache)
-#define pgtable_cache_size (quicklists.pgtable_cache_sz)
-#endif
-
-#else
-#error Pgtable caches have to be per-CPU, so that no locking is needed.
-#endif
-
-extern pgd_t *get_pgd_slow(void);
extern void free_table(void *table);
-#ifndef CONFIG_NO_PGT_CACHE
-extern __inline__ pgd_t *get_pgd_fast(void)
-{
- unsigned long *ret;
-
- if((ret = pgd_quicklist) != NULL) {
- pgd_quicklist = (unsigned long *)(*ret);
- ret[0] = ret[1];
- pgtable_cache_size--;
- } else
- ret = (unsigned long *)get_pgd_slow();
- return (pgd_t *)ret;
-}
-
-extern __inline__ void free_pgd_fast(pgd_t *pgd)
-{
- *(unsigned long *)pgd = (unsigned long) pgd_quicklist;
- pgd_quicklist = (unsigned long *) pgd;
- pgtable_cache_size++;
-}
-#endif
-
/* keep this as an inline so we get type checking */
extern __inline__ void free_pgd_slow(pgd_t *pgd)
{
- free_table((void *)pgd);
-}
-
-extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted);
-
-#ifndef CONFIG_NO_PGT_CACHE
-extern __inline__ pte_t *get_pte_fast(void)
-{
- unsigned long *ret;
-
- if((ret = (unsigned long *)pte_quicklist) != NULL) {
- pte_quicklist = (unsigned long *)(*ret);
- ret[0] = ret[1];
- pgtable_cache_size--;
- }
- return (pte_t *)ret;
+ free_table(pgd);
}
-extern __inline__ void free_pte_fast(pte_t *pte)
-{
- *(unsigned long *)pte = (unsigned long) pte_quicklist;
- pte_quicklist = (unsigned long *) pte;
- pgtable_cache_size++;
-}
-#endif
-
/* keep this as an inline so we get type checking */
extern __inline__ void free_pte_slow(pte_t *pte)
{
- free_table((void *)pte);
-}
-
-/* We don't use pmd cache, so this is a dummy routine */
-extern __inline__ pmd_t *get_pmd_fast(void)
-{
- return (pmd_t *)0;
-}
-
-extern __inline__ void free_pmd_fast(pmd_t *pmd)
-{
+ free_table(pte);
}
extern __inline__ void free_pmd_slow(pmd_t *pmd)
{
}
-extern void __bad_pmd(pmd_t *pmd);
-extern void __bad_pmd_kernel(pmd_t *pmd);
-
-#ifdef CONFIG_NO_PGT_CACHE
-#define pte_free_kernel(pte) free_pte_slow(pte)
-#define pte_free(pte) free_pte_slow(pte)
-#define pgd_free(pgd) free_pgd_slow(pgd)
-#define pgd_alloc() get_pgd_slow()
+#define pgd_free(pgd) free_pgd_fast(pgd)
-extern __inline__ pte_t *pte_alloc(pmd_t * pmd, unsigned long address)
+extern __inline__ pgd_t *pgd_alloc(void)
{
- address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+ extern pgd_t *get_pgd_slow(void);
+ pgd_t *pgd;
- if (pmd_none (*pmd)) {
- return get_pte_slow(pmd, address);
- }
- if (pmd_bad (*pmd)) {
- __bad_pmd(pmd);
- return NULL;
- }
- return (pte_t *) pmd_page(*pmd) + address;
+ pgd = get_pgd_fast();
+ if (!pgd)
+ pgd = get_pgd_slow();
+
+ return pgd;
}
-#else
+
#define pte_free_kernel(pte) free_pte_fast(pte)
#define pte_free(pte) free_pte_fast(pte)
-#define pgd_free(pgd) free_pgd_fast(pgd)
-#define pgd_alloc() get_pgd_fast()
extern __inline__ pte_t *pte_alloc(pmd_t * pmd, unsigned long address)
{
+ extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted);
+
address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
if (pmd_none (*pmd)) {
@@ -460,7 +253,6 @@ extern __inline__ pte_t *pte_alloc(pmd_t * pmd, unsigned long address)
}
return (pte_t *) pmd_page(*pmd) + address;
}
-#endif
/*
* allocating and freeing a pmd is trivial: the 1-entry pmd is
@@ -479,34 +271,4 @@ extern __inline__ pmd_t *pmd_alloc(pgd_t *pgd, unsigned long address)
#define pmd_alloc_kernel pmd_alloc
#define pte_alloc_kernel pte_alloc
-extern __inline__ void set_pgdir(unsigned long address, pgd_t entry)
-{
- struct task_struct * p;
-
- read_lock(&tasklist_lock);
- for_each_task(p) {
- if (!p->mm)
- continue;
- *pgd_offset(p->mm,address) = entry;
- }
- read_unlock(&tasklist_lock);
-#ifndef CONFIG_NO_PGT_CACHE
- {
- pgd_t *pgd;
- for (pgd = (pgd_t *)pgd_quicklist; pgd;
- pgd = (pgd_t *)*(unsigned long *)pgd)
- pgd[address >> PGDIR_SHIFT] = entry;
- }
-#endif
-}
-
-extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
-
-#define update_mmu_cache(vma,address,pte)
-
-#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
-#define SWP_OFFSET(entry) ((entry) >> 8)
-#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
-
-#endif /* __ASM_PROC_PAGE_H */
-
+#endif /* __ASM_PROC_PGTABLE_H */
diff --git a/include/asm-arm/proc-armo/processor.h b/include/asm-arm/proc-armo/processor.h
index 087dcbcd0..049e2c054 100644
--- a/include/asm-arm/proc-armo/processor.h
+++ b/include/asm-arm/proc-armo/processor.h
@@ -15,7 +15,6 @@
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
-#include <asm/assembler.h>
#include <linux/string.h>
#define KERNEL_STACK_SIZE 4096
@@ -45,20 +44,16 @@ typedef struct {
unsigned long (*copy_to_user)(void *to, const void *from, unsigned long sz);
unsigned long (*clear_user)(void *addr, unsigned long sz);
unsigned long (*strncpy_from_user)(char *to, const char *from, unsigned long sz);
- unsigned long (*strlen_user)(const char *s);
+ unsigned long (*strnlen_user)(const char *s, long n);
} uaccess_t;
extern uaccess_t uaccess_user, uaccess_kernel;
#define EXTRA_THREAD_STRUCT \
- uaccess_t *uaccess; /* User access functions*/ \
- unsigned long memcmap[256];
+ uaccess_t *uaccess; /* User access functions*/
#define EXTRA_THREAD_STRUCT_INIT \
- ,&uaccess_kernel, \
- { 0, }
-
-#define SWAPPER_PG_DIR ((unsigned long)swapper_pg_dir)
+ ,&uaccess_kernel
#define start_thread(regs,pc,sp) \
({ \
diff --git a/include/asm-arm/proc-armo/ptrace.h b/include/asm-arm/proc-armo/ptrace.h
index 513501b7d..9bf506501 100644
--- a/include/asm-arm/proc-armo/ptrace.h
+++ b/include/asm-arm/proc-armo/ptrace.h
@@ -1,12 +1,26 @@
/*
* linux/include/asm-arm/proc-armo/ptrace.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996-1999 Russell King
*/
-
#ifndef __ASM_PROC_PTRACE_H
#define __ASM_PROC_PTRACE_H
+#define USR26_MODE 0x00
+#define FIQ26_MODE 0x01
+#define IRQ26_MODE 0x02
+#define SVC26_MODE 0x03
+#define MODE_MASK 0x03
+#define F_BIT (1 << 26)
+#define I_BIT (1 << 27)
+#define CC_V_BIT (1 << 28)
+#define CC_C_BIT (1 << 29)
+#define CC_Z_BIT (1 << 30)
+#define CC_N_BIT (1 << 31)
+#define PCMASK 0xfc000003
+
+#ifndef __ASSEMBLY__
+
/* this struct defines the way the registers are stored on the
stack during a system call. */
@@ -30,19 +44,7 @@ struct pt_regs {
#define ARM_r2 uregs[2]
#define ARM_r1 uregs[1]
#define ARM_r0 uregs[0]
-#define ARM_ORIG_r0 uregs[16] /* -1 */
-
-#define USR26_MODE 0x00
-#define FIQ26_MODE 0x01
-#define IRQ26_MODE 0x02
-#define SVC26_MODE 0x03
-#define MODE_MASK 0x03
-#define F_BIT (1 << 26)
-#define I_BIT (1 << 27)
-#define CC_V_BIT (1 << 28)
-#define CC_C_BIT (1 << 29)
-#define CC_Z_BIT (1 << 30)
-#define CC_N_BIT (1 << 31)
+#define ARM_ORIG_r0 uregs[16]
#ifdef __KERNEL__
@@ -61,12 +63,6 @@ struct pt_regs {
#define condition_codes(regs) \
((regs)->ARM_pc & (CC_V_BIT|CC_C_BIT|CC_Z_BIT|CC_N_BIT))
-#define pc_pointer(v) \
- ((v) & 0x03fffffc)
-
-#define instruction_pointer(regs) \
- (pc_pointer((regs)->ARM_pc))
-
/* Are the current registers suitable for user mode?
* (used to maintain security in signal handlers)
*/
@@ -86,5 +82,7 @@ static inline int valid_user_regs(struct pt_regs *regs)
#endif /* __KERNEL__ */
+#endif /* __ASSEMBLY__ */
+
#endif
diff --git a/include/asm-arm/proc-armo/system.h b/include/asm-arm/proc-armo/system.h
index 3d6ba7554..1cc3fc606 100644
--- a/include/asm-arm/proc-armo/system.h
+++ b/include/asm-arm/proc-armo/system.h
@@ -13,6 +13,8 @@ extern const char xchg_str[];
extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
{
+ extern void arm_invalidptr(const char *, int);
+
switch (size) {
case 1: return cpu_xchg_1(x, ptr);
case 2: return cpu_xchg_2(x, ptr);
@@ -29,11 +31,6 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int
#define proc_hard_reset() cpu_proc_fin()
/*
- * This processor does not idle
- */
-#define proc_idle()
-
-/*
* A couple of speedups for the ARM
*/
diff --git a/include/asm-arm/proc-armo/uaccess.h b/include/asm-arm/proc-armo/uaccess.h
index 1a6b950ed..7e1a62c5e 100644
--- a/include/asm-arm/proc-armo/uaccess.h
+++ b/include/asm-arm/proc-armo/uaccess.h
@@ -19,16 +19,12 @@
#define KERNEL_DS 0x03000000
#define USER_DS 0x02000000
-#define get_ds() (KERNEL_DS)
-#define get_fs() (current->addr_limit)
-#define segment_eq(a,b) ((a) == (b))
-
extern uaccess_t uaccess_user, uaccess_kernel;
extern __inline__ void set_fs (mm_segment_t fs)
{
current->addr_limit = fs;
- current->tss.uaccess = fs == USER_DS ? &uaccess_user : &uaccess_kernel;
+ current->thread.uaccess = fs == USER_DS ? &uaccess_user : &uaccess_kernel;
}
#define __range_ok(addr,size) ({ \
@@ -47,8 +43,6 @@ extern __inline__ void set_fs (mm_segment_t fs)
: "cc"); \
(flag == 0); })
-#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
-
#define __put_user_asm_byte(x,addr,err) \
__asm__ __volatile__( \
" mov r0, %1\n" \
@@ -58,7 +52,7 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov pc, %3\n" \
" mov %0, r2\n" \
: "=r" (err) \
- : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_byte), \
+ : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_byte), \
"0" (err) \
: "r0", "r1", "r2", "lr")
@@ -71,7 +65,7 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov pc, %3\n" \
" mov %0, r2\n" \
: "=r" (err) \
- : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_half), \
+ : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_half), \
"0" (err) \
: "r0", "r1", "r2", "lr")
@@ -84,7 +78,7 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov pc, %3\n" \
" mov %0, r2\n" \
: "=r" (err) \
- : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_word), \
+ : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_word), \
"0" (err) \
: "r0", "r1", "r2", "lr")
@@ -97,7 +91,7 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov %0, r1\n" \
" mov %1, r0\n" \
: "=r" (err), "=r" (x) \
- : "r" (addr), "r" (current->tss.uaccess->get_byte), "0" (err) \
+ : "r" (addr), "r" (current->thread.uaccess->get_byte), "0" (err) \
: "r0", "r1", "r2", "lr")
#define __get_user_asm_half(x,addr,err) \
@@ -109,7 +103,7 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov %0, r1\n" \
" mov %1, r0\n" \
: "=r" (err), "=r" (x) \
- : "r" (addr), "r" (current->tss.uaccess->get_half), "0" (err) \
+ : "r" (addr), "r" (current->thread.uaccess->get_half), "0" (err) \
: "r0", "r1", "r2", "lr")
#define __get_user_asm_word(x,addr,err) \
@@ -121,20 +115,20 @@ extern __inline__ void set_fs (mm_segment_t fs)
" mov %0, r1\n" \
" mov %1, r0\n" \
: "=r" (err), "=r" (x) \
- : "r" (addr), "r" (current->tss.uaccess->get_word), "0" (err) \
+ : "r" (addr), "r" (current->thread.uaccess->get_word), "0" (err) \
: "r0", "r1", "r2", "lr")
#define __do_copy_from_user(to,from,n) \
- (n) = current->tss.uaccess->copy_from_user((to),(from),(n))
+ (n) = current->thread.uaccess->copy_from_user((to),(from),(n))
#define __do_copy_to_user(to,from,n) \
- (n) = current->tss.uaccess->copy_to_user((to),(from),(n))
+ (n) = current->thread.uaccess->copy_to_user((to),(from),(n))
#define __do_clear_user(addr,sz) \
- (sz) = current->tss.uaccess->clear_user((addr),(sz))
+ (sz) = current->thread.uaccess->clear_user((addr),(sz))
#define __do_strncpy_from_user(dst,src,count,res) \
- (res) = current->tss.uaccess->strncpy_from_user(dst,src,count)
+ (res) = current->thread.uaccess->strncpy_from_user(dst,src,count)
-#define __do_strlen_user(s,res) \
- (res) = current->tss.uaccess->strlen_user(s)
+#define __do_strnlen_user(s,n,res) \
+ (res) = current->thread.uaccess->strnlen_user(s,n)