- Stephen Rothwell: APM updates
[davej-history.git] / include / asm-arm / cpu-multi32.h
blob7f07bc8e55cd0d7369b9d30d387c0ffcd0f3b790
1 /*
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.
9 */
10 #ifndef __ASSEMBLY__
12 #include <asm/page.h>
14 /* forward-declare task_struct */
15 struct task_struct;
18 * Don't change this structure - ASM code
19 * relies on it.
21 extern struct processor {
22 /* MISC
23 * get data abort address/flags
25 void (*_data_abort)(unsigned long pc);
27 * check for any bugs
29 void (*_check_bugs)(void);
31 * Set up any processor specifics
33 void (*_proc_init)(void);
35 * Disable any processor specifics
37 void (*_proc_fin)(void);
39 * Special stuff for a reset
41 volatile void (*reset)(unsigned long addr);
43 * Idle the processor
45 int (*_do_idle)(int mode);
47 * Processor architecture specific
49 struct { /* CACHE */
51 * flush all caches
53 void (*clean_invalidate_all)(void);
55 * flush a specific page or pages
57 void (*clean_invalidate_range)(unsigned long address, unsigned long end, int flags);
59 * flush a page to RAM
61 void (*_flush_ram_page)(void *virt_page);
62 } cache;
64 struct { /* D-cache */
66 * invalidate the specified data range
68 void (*invalidate_range)(unsigned long start, unsigned long end);
70 * clean specified data range
72 void (*clean_range)(unsigned long start, unsigned long end);
74 * obsolete flush cache entry
76 void (*clean_page)(void *virt_page);
78 * clean a virtual address range from the
79 * D-cache without flushing the cache.
81 void (*clean_entry)(unsigned long start);
82 } dcache;
84 struct { /* I-cache */
86 * invalidate the I-cache for the specified range
88 void (*invalidate_range)(unsigned long start, unsigned long end);
90 * invalidate the I-cache for the specified virtual page
92 void (*invalidate_page)(void *virt_page);
93 } icache;
95 struct { /* TLB */
97 * flush all TLBs
99 void (*invalidate_all)(void);
101 * flush a specific TLB
103 void (*invalidate_range)(unsigned long address, unsigned long end);
105 * flush a specific TLB
107 void (*invalidate_page)(unsigned long address, int flags);
108 } tlb;
110 struct { /* PageTable */
112 * Set the page table
114 void (*set_pgd)(unsigned long pgd_phys);
116 * Set a PMD (handling IMP bit 4)
118 void (*set_pmd)(pmd_t *pmdp, pmd_t pmd);
120 * Set a PTE
122 void (*set_pte)(pte_t *ptep, pte_t pte);
123 } pgtable;
124 } processor;
126 extern const struct processor arm6_processor_functions;
127 extern const struct processor arm7_processor_functions;
128 extern const struct processor sa110_processor_functions;
130 #define cpu_data_abort(pc) processor._data_abort(pc)
131 #define cpu_check_bugs() processor._check_bugs()
132 #define cpu_proc_init() processor._proc_init()
133 #define cpu_proc_fin() processor._proc_fin()
134 #define cpu_reset(addr) processor.reset(addr)
135 #define cpu_do_idle(mode) processor._do_idle(mode)
137 #define cpu_cache_clean_invalidate_all() processor.cache.clean_invalidate_all()
138 #define cpu_cache_clean_invalidate_range(s,e,f) processor.cache.clean_invalidate_range(s,e,f)
139 #define cpu_flush_ram_page(vp) processor.cache._flush_ram_page(vp)
141 #define cpu_dcache_clean_page(vp) processor.dcache.clean_page(vp)
142 #define cpu_dcache_clean_entry(addr) processor.dcache.clean_entry(addr)
143 #define cpu_dcache_clean_range(s,e) processor.dcache.clean_range(s,e)
144 #define cpu_dcache_invalidate_range(s,e) processor.dcache.invalidate_range(s,e)
146 #define cpu_icache_invalidate_range(s,e) processor.icache.invalidate_range(s,e)
147 #define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp)
149 #define cpu_tlb_invalidate_all() processor.tlb.invalidate_all()
150 #define cpu_tlb_invalidate_range(s,e) processor.tlb.invalidate_range(s,e)
151 #define cpu_tlb_invalidate_page(vp,f) processor.tlb.invalidate_page(vp,f)
153 #define cpu_set_pgd(pgd) processor.pgtable.set_pgd(pgd)
154 #define cpu_set_pmd(pmdp, pmd) processor.pgtable.set_pmd(pmdp, pmd)
155 #define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte)
157 #define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)))
159 #endif