summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/proc-armv
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/proc-armv')
-rw-r--r--include/asm-arm/proc-armv/assembler.h33
-rw-r--r--include/asm-arm/proc-armv/cache.h162
-rw-r--r--include/asm-arm/proc-armv/domain.h8
-rw-r--r--include/asm-arm/proc-armv/io.h35
-rw-r--r--include/asm-arm/proc-armv/locks.h10
-rw-r--r--include/asm-arm/proc-armv/page.h8
-rw-r--r--include/asm-arm/proc-armv/pgtable.h12
-rw-r--r--include/asm-arm/proc-armv/processor.h22
-rw-r--r--include/asm-arm/proc-armv/ptrace.h12
-rw-r--r--include/asm-arm/proc-armv/shmparam.h13
-rw-r--r--include/asm-arm/proc-armv/system.h9
-rw-r--r--include/asm-arm/proc-armv/uaccess.h7
-rw-r--r--include/asm-arm/proc-armv/uncompress.h8
13 files changed, 210 insertions, 129 deletions
diff --git a/include/asm-arm/proc-armv/assembler.h b/include/asm-arm/proc-armv/assembler.h
index aaec7f9c7..6881898f5 100644
--- a/include/asm-arm/proc-armv/assembler.h
+++ b/include/asm-arm/proc-armv/assembler.h
@@ -1,10 +1,14 @@
/*
- * linux/asm-arm/proc-armv/assembler.h
+ * linux/asm-arm/proc-armv/assembler.h
*
- * Copyright (C) 1996-2000 Russell King
+ * Copyright (C) 1996-2000 Russell King
*
- * This file contains ARM processor specifics for
- * the ARM6 and better processors.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains ARM processor specifics for
+ * the ARM6 and better processors.
*/
#define MODE_USR USR_MODE
#define MODE_FIQ FIQ_MODE
@@ -47,3 +51,24 @@
.macro restore_irqs, oldcpsr
msr cpsr_c, \oldcpsr
.endm
+
+/*
+ * These two are used to save LR/restore PC over a user-based access.
+ * The old 26-bit architecture requires that we do. On 32-bit
+ * architecture, we can safely ignore this requirement.
+ */
+ .macro save_lr
+ .endm
+
+ .macro restore_pc
+ mov pc, lr
+ .endm
+
+#define USER(x...) \
+9999: x; \
+ .section __ex_table,"a"; \
+ .align 3; \
+ .long 9999b,9001f; \
+ .previous
+
+
diff --git a/include/asm-arm/proc-armv/cache.h b/include/asm-arm/proc-armv/cache.h
index dbdc10f6b..806856347 100644
--- a/include/asm-arm/proc-armv/cache.h
+++ b/include/asm-arm/proc-armv/cache.h
@@ -1,57 +1,98 @@
+/*
+ * linux/include/asm-arm/proc-armv/cache.h
+ *
+ * Copyright (C) 1999-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
#include <asm/mman.h>
/*
- * Cache flushing...
+ * Cache handling for 32-bit ARM processors.
+ *
+ * Note that on ARM, we have a more accurate specification than that
+ * Linux's "flush". We therefore do not use "flush" here, but instead
+ * use:
+ *
+ * clean: the act of pushing dirty cache entries out to memory.
+ * invalidate: the act of discarding data held within the cache,
+ * whether it is dirty or not.
+ */
+
+/*
+ * Generic I + D cache
*/
#define flush_cache_all() \
- cpu_flush_cache_all()
+ do { \
+ cpu_cache_clean_invalidate_all(); \
+ } while (0)
+/* This is always called for current->mm */
#define flush_cache_mm(_mm) \
do { \
- if ((_mm) == current->mm) \
- cpu_flush_cache_all(); \
+ if ((_mm) == current->active_mm) \
+ cpu_cache_clean_invalidate_all(); \
} while (0)
#define flush_cache_range(_mm,_start,_end) \
do { \
if ((_mm) == current->mm) \
- cpu_flush_cache_area((_start), (_end), 1); \
+ cpu_cache_clean_invalidate_range((_start), (_end), 1); \
} while (0)
#define flush_cache_page(_vma,_vmaddr) \
do { \
- if ((_vma)->vm_mm == current->mm) \
- cpu_flush_cache_area((_vmaddr), \
+ if ((_vma)->vm_mm == current->mm) { \
+ cpu_cache_clean_invalidate_range((_vmaddr), \
(_vmaddr) + PAGE_SIZE, \
((_vma)->vm_flags & VM_EXEC)); \
+ } \
} while (0)
-#define clean_cache_range(_start,_end) \
- do { \
- unsigned long _s, _sz; \
- _s = (unsigned long)_start; \
- _sz = (unsigned long)_end - _s; \
- cpu_clean_cache_area(_s, _sz); \
- } while (0)
+/*
+ * This flushes back any buffered write data. We have to clean the entries
+ * in the cache for this page. This does not invalidate either I or D caches.
+ */
+static __inline__ void flush_page_to_ram(struct page *page)
+{
+ cpu_flush_ram_page(page_address(page));
+}
+
+/*
+ * D cache only
+ */
+
+#define invalidate_dcache_range(_s,_e) cpu_dcache_invalidate_range((_s),(_e))
+#define clean_dcache_range(_s,_e) cpu_dcache_clean_range((_s),(_e))
+#define flush_dcache_range(_s,_e) cpu_cache_clean_invalidate_range((_s),(_e),0)
+
+/*
+ * FIXME: We currently clean the dcache for this page. Should we
+ * also invalidate the Dcache? And what about the Icache? -- rmk
+ */
+#define flush_dcache_page(page) cpu_dcache_clean_page(page_address(page))
+
+#define clean_dcache_entry(_s) cpu_dcache_clean_entry((unsigned long)(_s))
-#define clean_cache_area(_start,_size) \
+/*
+ * I cache only
+ */
+#define flush_icache_range(_s,_e) \
do { \
- unsigned long _s; \
- _s = (unsigned long)_start; \
- cpu_clean_cache_area(_s, _size); \
+ cpu_icache_invalidate_range((_s), (_e)); \
} while (0)
-#define flush_icache_range(_start,_end) \
- cpu_flush_icache_area((_start), (_end) - (_start))
-
#define flush_icache_page(vma,pg) \
do { \
if ((vma)->vm_flags & PROT_EXEC) \
- cpu_flush_icache_page((unsigned long) page_address(pg)); \
+ cpu_icache_invalidate_page(page_address(pg)); \
} while (0)
/*
- * We don't have a MEMC chip...
+ * Old ARM MEMC stuff. This supports the reversed mapping handling that
+ * we have on the older 26-bit machines. We don't have a MEMC chip, so...
*/
#define memc_update_all() do { } while (0)
#define memc_update_mm(mm) do { } while (0)
@@ -59,48 +100,57 @@
#define memc_clear(mm,physaddr) do { } while (0)
/*
- * This flushes back any buffered write data. We have to clean the entries
- * in the cache for this page. This does not invalidate either I or D caches.
- */
-static __inline__ void flush_page_to_ram(struct page *page)
-{
- cpu_flush_ram_page((unsigned long) page_address(page));
-}
-
-/* You guys might need to do something here. -DaveM */
-#define flush_dcache_page(page) do { } while (0)
-
-/*
- * TLB flushing:
+ * 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
+ * - flush_tlb_all() flushes all processes TLBs
+ * - flush_tlb_mm(mm) flushes the specified mm context TLB's
+ * - flush_tlb_page(vma, vmaddr) flushes TLB for specified page
+ * - flush_tlb_range(mm, start, end) flushes TLB for specified range of pages
*
* We drain the write buffer in here to ensure that the page tables in ram
* are really up to date. It is more efficient to do this here...
*/
-#define flush_tlb_all() \
- cpu_flush_tlb_all()
-#define flush_tlb_mm(_mm) \
- do { \
- if ((_mm) == current->mm) \
- cpu_flush_tlb_all(); \
+/*
+ * Notes:
+ * current->active_mm is the currently active memory description.
+ * current->mm == NULL iff we are lazy.
+ */
+#define flush_tlb_all() \
+ do { \
+ cpu_tlb_invalidate_all(); \
} while (0)
-#define flush_tlb_range(_mm,_start,_end) \
- do { \
- if ((_mm) == current->mm) \
- cpu_flush_tlb_area((_start), (_end), 1); \
+/*
+ * Flush all user virtual address space translations described by `_mm'.
+ *
+ * Currently, this is always called for current->mm, which should be
+ * the same as current->active_mm. This is currently not be called for
+ * the lazy TLB case.
+ */
+#define flush_tlb_mm(_mm) \
+ do { \
+ if ((_mm) == current->active_mm) \
+ cpu_tlb_invalidate_all(); \
} while (0)
-#define flush_tlb_page(_vma,_vmaddr) \
- do { \
- if ((_vma)->vm_mm == current->mm) \
- cpu_flush_tlb_page((_vmaddr), \
- ((_vma)->vm_flags & VM_EXEC)); \
+/*
+ * Flush the specified range of user virtual address space translations.
+ *
+ * _mm may not be current->active_mm, but may not be NULL.
+ */
+#define flush_tlb_range(_mm,_start,_end) \
+ do { \
+ if ((_mm) == current->active_mm) \
+ cpu_tlb_invalidate_range((_start), (_end)); \
} while (0)
-
+/*
+ * Flush the specified user virtual address space translation.
+ */
+#define flush_tlb_page(_vma,_page) \
+ do { \
+ if ((_vma)->vm_mm == current->active_mm) \
+ cpu_tlb_invalidate_page((_page), \
+ ((_vma)->vm_flags & VM_EXEC)); \
+ } while (0)
diff --git a/include/asm-arm/proc-armv/domain.h b/include/asm-arm/proc-armv/domain.h
index 398fdce5c..aadc83187 100644
--- a/include/asm-arm/proc-armv/domain.h
+++ b/include/asm-arm/proc-armv/domain.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/domain.h
+ * linux/include/asm-arm/proc-armv/domain.h
*
- * Copyright (C) 1999 Russell King.
+ * Copyright (C) 1999 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_DOMAIN_H
#define __ASM_PROC_DOMAIN_H
diff --git a/include/asm-arm/proc-armv/io.h b/include/asm-arm/proc-armv/io.h
deleted file mode 100644
index 72f0593ef..000000000
--- a/include/asm-arm/proc-armv/io.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * linux/include/asm-arm/proc-armv/io.h
- */
-
-/*
- * The caches on some architectures aren't dma-coherent and have need to
- * handle this in software. There are two types of operations that
- * can be applied to dma buffers.
- *
- * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by
- * writing the content of the caches back to memory, if necessary.
- * The function also invalidates the affected part of the caches as
- * necessary before DMA transfers from outside to memory.
- * - dma_cache_inv(start, size) invalidates the affected parts of the
- * caches. Dirty lines of the caches may be written back or simply
- * be discarded. This operation is necessary before dma operations
- * to the memory.
- * - dma_cache_wback(start, size) writes back any dirty lines but does
- * not invalidate the cache. This can be used before DMA reads from
- * memory,
- */
-
-#include <asm/proc-fns.h>
-
-#define dma_cache_inv(start, size) \
- do { cpu_cache_purge_area((unsigned long)(start), \
- ((unsigned long)(start)+(size))); } while (0)
-
-#define dma_cache_wback(start, size) \
- do { cpu_cache_wback_area((unsigned long)(start), \
- ((unsigned long)(start)+(size))); } while (0)
-
-#define dma_cache_wback_inv(start, size) \
- do { cpu_flush_cache_area((unsigned long)(start), \
- ((unsigned long)(start)+(size)), 0); } while (0)
diff --git a/include/asm-arm/proc-armv/locks.h b/include/asm-arm/proc-armv/locks.h
index 047f0ce16..865663322 100644
--- a/include/asm-arm/proc-armv/locks.h
+++ b/include/asm-arm/proc-armv/locks.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/proc-armv/locks.h
+ * linux/include/asm-arm/proc-armv/locks.h
*
- * Copyright (C) 2000 Russell King
+ * Copyright (C) 2000 Russell King
*
- * Interrupt safe locking assembler.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Interrupt safe locking assembler.
*/
#ifndef __ASM_PROC_LOCKS_H
#define __ASM_PROC_LOCKS_H
diff --git a/include/asm-arm/proc-armv/page.h b/include/asm-arm/proc-armv/page.h
index cd80dec3a..2317fce51 100644
--- a/include/asm-arm/proc-armv/page.h
+++ b/include/asm-arm/proc-armv/page.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/page.h
+ * linux/include/asm-arm/proc-armv/page.h
*
- * Copyright (C) 1995, 1996 Russell King
+ * Copyright (C) 1995, 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PAGE_H
#define __ASM_PROC_PAGE_H
diff --git a/include/asm-arm/proc-armv/pgtable.h b/include/asm-arm/proc-armv/pgtable.h
index b5d53a59e..2de66aabe 100644
--- a/include/asm-arm/proc-armv/pgtable.h
+++ b/include/asm-arm/proc-armv/pgtable.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/proc-armv/pgtable.h
+ * linux/include/asm-arm/proc-armv/pgtable.h
*
- * Copyright (C) 1995-1999 Russell King
+ * Copyright (C) 1995-1999 Russell King
*
- * 12-Jan-1997 RMK Altered flushing routines to use function pointers
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 12-Jan-1997 RMK Altered flushing routines to use function pointers
* now possible to combine ARM6, ARM7 and StrongARM versions.
- * 17-Apr-1999 RMK Now pass an area size to clean_cache_area and
+ * 17-Apr-1999 RMK Now pass an area size to clean_cache_area and
* flush_icache_area.
*/
#ifndef __ASM_PROC_PGTABLE_H
diff --git a/include/asm-arm/proc-armv/processor.h b/include/asm-arm/proc-armv/processor.h
index 9ddfd0028..ab7f31d65 100644
--- a/include/asm-arm/proc-armv/processor.h
+++ b/include/asm-arm/proc-armv/processor.h
@@ -1,15 +1,19 @@
/*
- * linux/include/asm-arm/proc-armv/processor.h
+ * linux/include/asm-arm/proc-armv/processor.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * Changelog:
- * 20-09-1996 RMK Created
- * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
- * 28-09-1996 RMK Moved start_thread into the processor dependencies
- * 09-09-1998 PJB Delete redundant `wp_works_ok'
- * 30-05-1999 PJB Save sl across context switches
- * 31-07-1999 RMK Added 'domain' stuff
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 20-09-1996 RMK Created
+ * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
+ * 28-09-1996 RMK Moved start_thread into the processor dependencies
+ * 09-09-1998 PJB Delete redundant `wp_works_ok'
+ * 30-05-1999 PJB Save sl across context switches
+ * 31-07-1999 RMK Added 'domain' stuff
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
diff --git a/include/asm-arm/proc-armv/ptrace.h b/include/asm-arm/proc-armv/ptrace.h
index 362eac178..d15d5a6ec 100644
--- a/include/asm-arm/proc-armv/ptrace.h
+++ b/include/asm-arm/proc-armv/ptrace.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/ptrace.h
+ * linux/include/asm-arm/proc-armv/ptrace.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PTRACE_H
#define __ASM_PROC_PTRACE_H
@@ -18,6 +22,7 @@
#define UND_MODE 0x1b
#define SYSTEM_MODE 0x1f
#define MODE_MASK 0x1f
+#define T_BIT 0x20
#define F_BIT 0x40
#define I_BIT 0x80
#define CC_V_BIT (1 << 28)
@@ -59,6 +64,9 @@ struct pt_regs {
#define user_mode(regs) \
(((regs)->ARM_cpsr & 0xf) == 0)
+#define thumb_mode(regs) \
+ (((regs)->ARM_cpsr & T_BIT))
+
#define processor_mode(regs) \
((regs)->ARM_cpsr & MODE_MASK)
diff --git a/include/asm-arm/proc-armv/shmparam.h b/include/asm-arm/proc-armv/shmparam.h
index 664b8deaf..5b692cc5b 100644
--- a/include/asm-arm/proc-armv/shmparam.h
+++ b/include/asm-arm/proc-armv/shmparam.h
@@ -1,12 +1,15 @@
/*
- * linux/include/asm-arm/proc-armv/shmparam.h
+ * linux/include/asm-arm/proc-armv/shmparam.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * definitions for the shared process memory on ARM v3 or v4
- * processors
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * definitions for the shared process memory on ARM v3 or v4
+ * processors
*/
-
#ifndef __ASM_PROC_SHMPARAM_H
#define __ASM_PROC_SHMPARAM_H
diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h
index e05e6356f..247ed3e2b 100644
--- a/include/asm-arm/proc-armv/system.h
+++ b/include/asm-arm/proc-armv/system.h
@@ -1,9 +1,12 @@
/*
- * linux/include/asm-arm/proc-armv/system.h
+ * linux/include/asm-arm/proc-armv/system.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#ifndef __ASM_PROC_SYSTEM_H
#define __ASM_PROC_SYSTEM_H
diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h
index af146abf9..4baee9ce7 100644
--- a/include/asm-arm/proc-armv/uaccess.h
+++ b/include/asm-arm/proc-armv/uaccess.h
@@ -1,7 +1,10 @@
/*
- * linux/include/asm-arm/proc-armv/uaccess.h
+ * linux/include/asm-arm/proc-armv/uaccess.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#include <asm/arch/memory.h>
#include <asm/proc/domain.h>
diff --git a/include/asm-arm/proc-armv/uncompress.h b/include/asm-arm/proc-armv/uncompress.h
index e67566d5d..bc41b2811 100644
--- a/include/asm-arm/proc-armv/uncompress.h
+++ b/include/asm-arm/proc-armv/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/uncompress.h
+ * linux/include/asm-arm/proc-armv/uncompress.h
*
- * (c) 1997 Russell King
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
static inline void proc_decomp_setup (void)