2 * linux/include/asm-arm/cpu-multi32.h
4 * Copyright (C) 2000 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
12 #include <asm/memory.h>
15 /* forward-declare task_struct */
19 * Don't change this structure - ASM code
22 extern struct processor {
24 * get data abort address/flags
26 void (*_data_abort)(unsigned long pc);
30 void (*_check_bugs)(void);
32 * Set up any processor specifics
34 void (*_proc_init)(void);
36 * Disable any processor specifics
38 void (*_proc_fin)(void);
40 * Special stuff for a reset
42 volatile void (*reset)(unsigned long addr);
46 int (*_do_idle)(void);
48 * Processor architecture specific
54 void (*clean_invalidate_all)(void);
56 * flush a specific page or pages
58 void (*clean_invalidate_range)(unsigned long address, unsigned long end, int flags);
62 void (*_flush_ram_page)(void *virt_page);
65 struct { /* D-cache */
67 * invalidate the specified data range
69 void (*invalidate_range)(unsigned long start, unsigned long end);
71 * clean specified data range
73 void (*clean_range)(unsigned long start, unsigned long end);
75 * obsolete flush cache entry
77 void (*clean_page)(void *virt_page);
79 * clean a virtual address range from the
80 * D-cache without flushing the cache.
82 void (*clean_entry)(unsigned long start);
85 struct { /* I-cache */
87 * invalidate the I-cache for the specified range
89 void (*invalidate_range)(unsigned long start, unsigned long end);
91 * invalidate the I-cache for the specified virtual page
93 void (*invalidate_page)(void *virt_page);
100 void (*invalidate_all)(void);
102 * flush a specific TLB
104 void (*invalidate_range)(unsigned long address, unsigned long end);
106 * flush a specific TLB
108 void (*invalidate_page)(unsigned long address, int flags);
111 struct { /* PageTable */
115 void (*set_pgd)(unsigned long pgd_phys);
117 * Set a PMD (handling IMP bit 4)
119 void (*set_pmd)(pmd_t *pmdp, pmd_t pmd);
123 void (*set_pte)(pte_t *ptep, pte_t pte);
127 extern const struct processor arm6_processor_functions;
128 extern const struct processor arm7_processor_functions;
129 extern const struct processor sa110_processor_functions;
131 #define cpu_data_abort(pc) processor._data_abort(pc)
132 #define cpu_check_bugs() processor._check_bugs()
133 #define cpu_proc_init() processor._proc_init()
134 #define cpu_proc_fin() processor._proc_fin()
135 #define cpu_reset(addr) processor.reset(addr)
136 #define cpu_do_idle() processor._do_idle()
138 #define cpu_cache_clean_invalidate_all() processor.cache.clean_invalidate_all()
139 #define cpu_cache_clean_invalidate_range(s,e,f) processor.cache.clean_invalidate_range(s,e,f)
140 #define cpu_flush_ram_page(vp) processor.cache._flush_ram_page(vp)
142 #define cpu_dcache_clean_page(vp) processor.dcache.clean_page(vp)
143 #define cpu_dcache_clean_entry(addr) processor.dcache.clean_entry(addr)
144 #define cpu_dcache_clean_range(s,e) processor.dcache.clean_range(s,e)
145 #define cpu_dcache_invalidate_range(s,e) processor.dcache.invalidate_range(s,e)
147 #define cpu_icache_invalidate_range(s,e) processor.icache.invalidate_range(s,e)
148 #define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp)
150 #define cpu_tlb_invalidate_all() processor.tlb.invalidate_all()
151 #define cpu_tlb_invalidate_range(s,e) processor.tlb.invalidate_range(s,e)
152 #define cpu_tlb_invalidate_page(vp,f) processor.tlb.invalidate_page(vp,f)
154 #define cpu_set_pgd(pgd) processor.pgtable.set_pgd(pgd)
155 #define cpu_set_pmd(pmdp, pmd) processor.pgtable.set_pmd(pmdp, pmd)
156 #define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte)
158 #define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)))
160 #define cpu_get_pgd() \
163 __asm__("mrc p15, 0, %0, c2, c0, 0" \
166 (pgd_t *)phys_to_virt(pg); \