diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/cacheflush.h | 12 | ||||
-rw-r--r-- | include/asm-sparc64/cpudata.h | 10 | ||||
-rw-r--r-- | include/asm-sparc64/futex.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/head.h | 9 | ||||
-rw-r--r-- | include/asm-sparc64/ide.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/openprom.h | 4 | ||||
-rw-r--r-- | include/asm-sparc64/oplib.h | 66 | ||||
-rw-r--r-- | include/asm-sparc64/page.h | 24 | ||||
-rw-r--r-- | include/asm-sparc64/pbm.h | 30 | ||||
-rw-r--r-- | include/asm-sparc64/pgalloc.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/pgtable.h | 34 | ||||
-rw-r--r-- | include/asm-sparc64/uaccess.h | 24 |
12 files changed, 102 insertions, 115 deletions
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h index 51b26e81d828..b3f61659ba81 100644 --- a/include/asm-sparc64/cacheflush.h +++ b/include/asm-sparc64/cacheflush.h | |||
@@ -4,13 +4,6 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/page.h> | 5 | #include <asm/page.h> |
6 | 6 | ||
7 | /* Flushing for D-cache alias handling is only needed if | ||
8 | * the page size is smaller than 16K. | ||
9 | */ | ||
10 | #if PAGE_SHIFT < 14 | ||
11 | #define DCACHE_ALIASING_POSSIBLE | ||
12 | #endif | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | 7 | #ifndef __ASSEMBLY__ |
15 | 8 | ||
16 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
@@ -73,6 +66,11 @@ extern void flush_ptrace_access(struct vm_area_struct *, struct page *, | |||
73 | #define flush_cache_vmap(start, end) do { } while (0) | 66 | #define flush_cache_vmap(start, end) do { } while (0) |
74 | #define flush_cache_vunmap(start, end) do { } while (0) | 67 | #define flush_cache_vunmap(start, end) do { } while (0) |
75 | 68 | ||
69 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
70 | /* internal debugging function */ | ||
71 | void kernel_map_pages(struct page *page, int numpages, int enable); | ||
72 | #endif | ||
73 | |||
76 | #endif /* !__ASSEMBLY__ */ | 74 | #endif /* !__ASSEMBLY__ */ |
77 | 75 | ||
78 | #endif /* _SPARC64_CACHEFLUSH_H */ | 76 | #endif /* _SPARC64_CACHEFLUSH_H */ |
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index 9a3a81f1cc58..74de79dca915 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
@@ -22,6 +22,16 @@ typedef struct { | |||
22 | unsigned int __pad1; | 22 | unsigned int __pad1; |
23 | unsigned long *pte_cache[2]; | 23 | unsigned long *pte_cache[2]; |
24 | unsigned long *pgd_cache; | 24 | unsigned long *pgd_cache; |
25 | |||
26 | /* Dcache line 3, rarely used */ | ||
27 | unsigned int dcache_size; | ||
28 | unsigned int dcache_line_size; | ||
29 | unsigned int icache_size; | ||
30 | unsigned int icache_line_size; | ||
31 | unsigned int ecache_size; | ||
32 | unsigned int ecache_line_size; | ||
33 | unsigned int __pad2; | ||
34 | unsigned int __pad3; | ||
25 | } cpuinfo_sparc; | 35 | } cpuinfo_sparc; |
26 | 36 | ||
27 | DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); | 37 | DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); |
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h index 2cac5ecd9d00..9feff4ce1424 100644 --- a/include/asm-sparc64/futex.h +++ b/include/asm-sparc64/futex.h | |||
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
14 | int cmp = (encoded_op >> 24) & 15; | 14 | int cmp = (encoded_op >> 24) & 15; |
15 | int oparg = (encoded_op << 8) >> 20; | 15 | int oparg = (encoded_op << 8) >> 20; |
16 | int cmparg = (encoded_op << 20) >> 20; | 16 | int cmparg = (encoded_op << 20) >> 20; |
17 | int oldval = 0, ret, tem; | 17 | int oldval = 0, ret; |
18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
19 | oparg = 1 << oparg; | 19 | oparg = 1 << oparg; |
20 | 20 | ||
diff --git a/include/asm-sparc64/head.h b/include/asm-sparc64/head.h index b63a33cf4971..0abd3a674e8f 100644 --- a/include/asm-sparc64/head.h +++ b/include/asm-sparc64/head.h | |||
@@ -12,9 +12,12 @@ | |||
12 | #define __JALAPENO_ID 0x003e0016 | 12 | #define __JALAPENO_ID 0x003e0016 |
13 | 13 | ||
14 | #define CHEETAH_MANUF 0x003e | 14 | #define CHEETAH_MANUF 0x003e |
15 | #define CHEETAH_IMPL 0x0014 | 15 | #define CHEETAH_IMPL 0x0014 /* Ultra-III */ |
16 | #define CHEETAH_PLUS_IMPL 0x0015 | 16 | #define CHEETAH_PLUS_IMPL 0x0015 /* Ultra-III+ */ |
17 | #define JALAPENO_IMPL 0x0016 | 17 | #define JALAPENO_IMPL 0x0016 /* Ultra-IIIi */ |
18 | #define JAGUAR_IMPL 0x0018 /* Ultra-IV */ | ||
19 | #define PANTHER_IMPL 0x0019 /* Ultra-IV+ */ | ||
20 | #define SERRANO_IMPL 0x0022 /* Ultra-IIIi+ */ | ||
18 | 21 | ||
19 | #define BRANCH_IF_CHEETAH_BASE(tmp1,tmp2,label) \ | 22 | #define BRANCH_IF_CHEETAH_BASE(tmp1,tmp2,label) \ |
20 | rdpr %ver, %tmp1; \ | 23 | rdpr %ver, %tmp1; \ |
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index 4c1098474c73..c393f815b0be 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/spitfire.h> | 16 | #include <asm/spitfire.h> |
17 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
18 | #include <asm/page.h> | ||
18 | 19 | ||
19 | #ifndef MAX_HWIFS | 20 | #ifndef MAX_HWIFS |
20 | # ifdef CONFIG_BLK_DEV_IDEPCI | 21 | # ifdef CONFIG_BLK_DEV_IDEPCI |
diff --git a/include/asm-sparc64/openprom.h b/include/asm-sparc64/openprom.h index 0a336901d585..b4959d2b0d99 100644 --- a/include/asm-sparc64/openprom.h +++ b/include/asm-sparc64/openprom.h | |||
@@ -186,8 +186,8 @@ struct linux_prom_registers { | |||
186 | }; | 186 | }; |
187 | 187 | ||
188 | struct linux_prom64_registers { | 188 | struct linux_prom64_registers { |
189 | long phys_addr; | 189 | unsigned long phys_addr; |
190 | long reg_size; | 190 | unsigned long reg_size; |
191 | }; | 191 | }; |
192 | 192 | ||
193 | struct linux_prom_irqs { | 193 | struct linux_prom_irqs { |
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index a432d9e7daaa..d02f1e8ae1a6 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h | |||
@@ -38,6 +38,20 @@ extern int prom_stdin, prom_stdout; | |||
38 | */ | 38 | */ |
39 | extern int prom_chosen_node; | 39 | extern int prom_chosen_node; |
40 | 40 | ||
41 | /* Helper values and strings in arch/sparc64/kernel/head.S */ | ||
42 | extern const char prom_finddev_name[]; | ||
43 | extern const char prom_chosen_path[]; | ||
44 | extern const char prom_getprop_name[]; | ||
45 | extern const char prom_mmu_name[]; | ||
46 | extern const char prom_callmethod_name[]; | ||
47 | extern const char prom_translate_name[]; | ||
48 | extern const char prom_map_name[]; | ||
49 | extern const char prom_unmap_name[]; | ||
50 | extern int prom_mmu_ihandle_cache; | ||
51 | extern unsigned int prom_boot_mapped_pc; | ||
52 | extern unsigned int prom_boot_mapping_mode; | ||
53 | extern unsigned long prom_boot_mapping_phys_high, prom_boot_mapping_phys_low; | ||
54 | |||
41 | struct linux_mlist_p1275 { | 55 | struct linux_mlist_p1275 { |
42 | struct linux_mlist_p1275 *theres_more; | 56 | struct linux_mlist_p1275 *theres_more; |
43 | unsigned long start_adr; | 57 | unsigned long start_adr; |
@@ -68,7 +82,7 @@ extern char *prom_getbootargs(void); | |||
68 | * of the string is different on V0 vs. V2->higher proms. The caller must | 82 | * of the string is different on V0 vs. V2->higher proms. The caller must |
69 | * know what he/she is doing! Returns the device descriptor, an int. | 83 | * know what he/she is doing! Returns the device descriptor, an int. |
70 | */ | 84 | */ |
71 | extern int prom_devopen(char *device_string); | 85 | extern int prom_devopen(const char *device_string); |
72 | 86 | ||
73 | /* Close a previously opened device described by the passed integer | 87 | /* Close a previously opened device described by the passed integer |
74 | * descriptor. | 88 | * descriptor. |
@@ -81,27 +95,13 @@ extern int prom_devclose(int device_handle); | |||
81 | extern void prom_seek(int device_handle, unsigned int seek_hival, | 95 | extern void prom_seek(int device_handle, unsigned int seek_hival, |
82 | unsigned int seek_lowval); | 96 | unsigned int seek_lowval); |
83 | 97 | ||
84 | /* Machine memory configuration routine. */ | ||
85 | |||
86 | /* This function returns a V0 format memory descriptor table, it has three | ||
87 | * entries. One for the total amount of physical ram on the machine, one | ||
88 | * for the amount of physical ram available, and one describing the virtual | ||
89 | * areas which are allocated by the prom. So, in a sense the physical | ||
90 | * available is a calculation of the total physical minus the physical mapped | ||
91 | * by the prom with virtual mappings. | ||
92 | * | ||
93 | * These lists are returned pre-sorted, this should make your life easier | ||
94 | * since the prom itself is way too lazy to do such nice things. | ||
95 | */ | ||
96 | extern struct linux_mem_p1275 *prom_meminfo(void); | ||
97 | |||
98 | /* Miscellaneous routines, don't really fit in any category per se. */ | 98 | /* Miscellaneous routines, don't really fit in any category per se. */ |
99 | 99 | ||
100 | /* Reboot the machine with the command line passed. */ | 100 | /* Reboot the machine with the command line passed. */ |
101 | extern void prom_reboot(char *boot_command); | 101 | extern void prom_reboot(const char *boot_command); |
102 | 102 | ||
103 | /* Evaluate the forth string passed. */ | 103 | /* Evaluate the forth string passed. */ |
104 | extern void prom_feval(char *forth_string); | 104 | extern void prom_feval(const char *forth_string); |
105 | 105 | ||
106 | /* Enter the prom, with possibility of continuation with the 'go' | 106 | /* Enter the prom, with possibility of continuation with the 'go' |
107 | * command in newer proms. | 107 | * command in newer proms. |
@@ -154,7 +154,7 @@ extern char prom_getchar(void); | |||
154 | extern void prom_putchar(char character); | 154 | extern void prom_putchar(char character); |
155 | 155 | ||
156 | /* Prom's internal routines, don't use in kernel/boot code. */ | 156 | /* Prom's internal routines, don't use in kernel/boot code. */ |
157 | extern void prom_printf(char *fmt, ...); | 157 | extern void prom_printf(const char *fmt, ...); |
158 | extern void prom_write(const char *buf, unsigned int len); | 158 | extern void prom_write(const char *buf, unsigned int len); |
159 | 159 | ||
160 | /* Query for input device type */ | 160 | /* Query for input device type */ |
@@ -215,7 +215,7 @@ extern int prom_getunumber(int syndrome_code, | |||
215 | char *buf, int buflen); | 215 | char *buf, int buflen); |
216 | 216 | ||
217 | /* Retain physical memory to the caller across soft resets. */ | 217 | /* Retain physical memory to the caller across soft resets. */ |
218 | extern unsigned long prom_retain(char *name, | 218 | extern unsigned long prom_retain(const char *name, |
219 | unsigned long pa_low, unsigned long pa_high, | 219 | unsigned long pa_low, unsigned long pa_high, |
220 | long size, long align); | 220 | long size, long align); |
221 | 221 | ||
@@ -269,28 +269,28 @@ extern int prom_getsibling(int node); | |||
269 | /* Get the length, at the passed node, of the given property type. | 269 | /* Get the length, at the passed node, of the given property type. |
270 | * Returns -1 on error (ie. no such property at this node). | 270 | * Returns -1 on error (ie. no such property at this node). |
271 | */ | 271 | */ |
272 | extern int prom_getproplen(int thisnode, char *property); | 272 | extern int prom_getproplen(int thisnode, const char *property); |
273 | 273 | ||
274 | /* Fetch the requested property using the given buffer. Returns | 274 | /* Fetch the requested property using the given buffer. Returns |
275 | * the number of bytes the prom put into your buffer or -1 on error. | 275 | * the number of bytes the prom put into your buffer or -1 on error. |
276 | */ | 276 | */ |
277 | extern int prom_getproperty(int thisnode, char *property, | 277 | extern int prom_getproperty(int thisnode, const char *property, |
278 | char *prop_buffer, int propbuf_size); | 278 | char *prop_buffer, int propbuf_size); |
279 | 279 | ||
280 | /* Acquire an integer property. */ | 280 | /* Acquire an integer property. */ |
281 | extern int prom_getint(int node, char *property); | 281 | extern int prom_getint(int node, const char *property); |
282 | 282 | ||
283 | /* Acquire an integer property, with a default value. */ | 283 | /* Acquire an integer property, with a default value. */ |
284 | extern int prom_getintdefault(int node, char *property, int defval); | 284 | extern int prom_getintdefault(int node, const char *property, int defval); |
285 | 285 | ||
286 | /* Acquire a boolean property, 0=FALSE 1=TRUE. */ | 286 | /* Acquire a boolean property, 0=FALSE 1=TRUE. */ |
287 | extern int prom_getbool(int node, char *prop); | 287 | extern int prom_getbool(int node, const char *prop); |
288 | 288 | ||
289 | /* Acquire a string property, null string on error. */ | 289 | /* Acquire a string property, null string on error. */ |
290 | extern void prom_getstring(int node, char *prop, char *buf, int bufsize); | 290 | extern void prom_getstring(int node, const char *prop, char *buf, int bufsize); |
291 | 291 | ||
292 | /* Does the passed node have the given "name"? YES=1 NO=0 */ | 292 | /* Does the passed node have the given "name"? YES=1 NO=0 */ |
293 | extern int prom_nodematch(int thisnode, char *name); | 293 | extern int prom_nodematch(int thisnode, const char *name); |
294 | 294 | ||
295 | /* Puts in buffer a prom name in the form name@x,y or name (x for which_io | 295 | /* Puts in buffer a prom name in the form name@x,y or name (x for which_io |
296 | * and y for first regs phys address | 296 | * and y for first regs phys address |
@@ -300,7 +300,7 @@ extern int prom_getname(int node, char *buf, int buflen); | |||
300 | /* Search all siblings starting at the passed node for "name" matching | 300 | /* Search all siblings starting at the passed node for "name" matching |
301 | * the given string. Returns the node on success, zero on failure. | 301 | * the given string. Returns the node on success, zero on failure. |
302 | */ | 302 | */ |
303 | extern int prom_searchsiblings(int node_start, char *name); | 303 | extern int prom_searchsiblings(int node_start, const char *name); |
304 | 304 | ||
305 | /* Return the first property type, as a string, for the given node. | 305 | /* Return the first property type, as a string, for the given node. |
306 | * Returns a null string on error. Buffer should be at least 32B long. | 306 | * Returns a null string on error. Buffer should be at least 32B long. |
@@ -310,21 +310,21 @@ extern char *prom_firstprop(int node, char *buffer); | |||
310 | /* Returns the next property after the passed property for the given | 310 | /* Returns the next property after the passed property for the given |
311 | * node. Returns null string on failure. Buffer should be at least 32B long. | 311 | * node. Returns null string on failure. Buffer should be at least 32B long. |
312 | */ | 312 | */ |
313 | extern char *prom_nextprop(int node, char *prev_property, char *buffer); | 313 | extern char *prom_nextprop(int node, const char *prev_property, char *buffer); |
314 | 314 | ||
315 | /* Returns 1 if the specified node has given property. */ | 315 | /* Returns 1 if the specified node has given property. */ |
316 | extern int prom_node_has_property(int node, char *property); | 316 | extern int prom_node_has_property(int node, const char *property); |
317 | 317 | ||
318 | /* Returns phandle of the path specified */ | 318 | /* Returns phandle of the path specified */ |
319 | extern int prom_finddevice(char *name); | 319 | extern int prom_finddevice(const char *name); |
320 | 320 | ||
321 | /* Set the indicated property at the given node with the passed value. | 321 | /* Set the indicated property at the given node with the passed value. |
322 | * Returns the number of bytes of your value that the prom took. | 322 | * Returns the number of bytes of your value that the prom took. |
323 | */ | 323 | */ |
324 | extern int prom_setprop(int node, char *prop_name, char *prop_value, | 324 | extern int prom_setprop(int node, const char *prop_name, char *prop_value, |
325 | int value_size); | 325 | int value_size); |
326 | 326 | ||
327 | extern int prom_pathtoinode(char *path); | 327 | extern int prom_pathtoinode(const char *path); |
328 | extern int prom_inst2pkg(int); | 328 | extern int prom_inst2pkg(int); |
329 | 329 | ||
330 | /* CPU probing helpers. */ | 330 | /* CPU probing helpers. */ |
@@ -334,7 +334,7 @@ int cpu_find_by_mid(int mid, int *prom_node); | |||
334 | /* Client interface level routines. */ | 334 | /* Client interface level routines. */ |
335 | extern void prom_set_trap_table(unsigned long tba); | 335 | extern void prom_set_trap_table(unsigned long tba); |
336 | 336 | ||
337 | extern long p1275_cmd (char *, long, ...); | 337 | extern long p1275_cmd(const char *, long, ...); |
338 | 338 | ||
339 | 339 | ||
340 | #if 0 | 340 | #if 0 |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index c9f8ef208ea5..5426bb28a993 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -21,6 +21,13 @@ | |||
21 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) | 21 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) |
22 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 22 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
23 | 23 | ||
24 | /* Flushing for D-cache alias handling is only needed if | ||
25 | * the page size is smaller than 16K. | ||
26 | */ | ||
27 | #if PAGE_SHIFT < 14 | ||
28 | #define DCACHE_ALIASING_POSSIBLE | ||
29 | #endif | ||
30 | |||
24 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
25 | 32 | ||
26 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
@@ -133,23 +140,6 @@ extern unsigned long page_to_pfn(struct page *); | |||
133 | #define virt_to_phys __pa | 140 | #define virt_to_phys __pa |
134 | #define phys_to_virt __va | 141 | #define phys_to_virt __va |
135 | 142 | ||
136 | /* The following structure is used to hold the physical | ||
137 | * memory configuration of the machine. This is filled in | ||
138 | * probe_memory() and is later used by mem_init() to set up | ||
139 | * mem_map[]. We statically allocate SPARC_PHYS_BANKS of | ||
140 | * these structs, this is arbitrary. The entry after the | ||
141 | * last valid one has num_bytes==0. | ||
142 | */ | ||
143 | |||
144 | struct sparc_phys_banks { | ||
145 | unsigned long base_addr; | ||
146 | unsigned long num_bytes; | ||
147 | }; | ||
148 | |||
149 | #define SPARC_PHYS_BANKS 32 | ||
150 | |||
151 | extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | ||
152 | |||
153 | #endif /* !(__ASSEMBLY__) */ | 143 | #endif /* !(__ASSEMBLY__) */ |
154 | 144 | ||
155 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 145 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 38bbbccb4068..dd35a2c7798a 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -27,23 +27,27 @@ | |||
27 | * PCI bus. | 27 | * PCI bus. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define PBM_LOGCLUSTERS 3 | ||
31 | #define PBM_NCLUSTERS (1 << PBM_LOGCLUSTERS) | ||
32 | |||
33 | struct pci_controller_info; | 30 | struct pci_controller_info; |
34 | 31 | ||
35 | /* This contains the software state necessary to drive a PCI | 32 | /* This contains the software state necessary to drive a PCI |
36 | * controller's IOMMU. | 33 | * controller's IOMMU. |
37 | */ | 34 | */ |
35 | struct pci_iommu_arena { | ||
36 | unsigned long *map; | ||
37 | unsigned int hint; | ||
38 | unsigned int limit; | ||
39 | }; | ||
40 | |||
38 | struct pci_iommu { | 41 | struct pci_iommu { |
39 | /* This protects the controller's IOMMU and all | 42 | /* This protects the controller's IOMMU and all |
40 | * streaming buffers underneath. | 43 | * streaming buffers underneath. |
41 | */ | 44 | */ |
42 | spinlock_t lock; | 45 | spinlock_t lock; |
43 | 46 | ||
47 | struct pci_iommu_arena arena; | ||
48 | |||
44 | /* IOMMU page table, a linear array of ioptes. */ | 49 | /* IOMMU page table, a linear array of ioptes. */ |
45 | iopte_t *page_table; /* The page table itself. */ | 50 | iopte_t *page_table; /* The page table itself. */ |
46 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ | ||
47 | 51 | ||
48 | /* Base PCI memory space address where IOMMU mappings | 52 | /* Base PCI memory space address where IOMMU mappings |
49 | * begin. | 53 | * begin. |
@@ -62,12 +66,6 @@ struct pci_iommu { | |||
62 | */ | 66 | */ |
63 | unsigned long write_complete_reg; | 67 | unsigned long write_complete_reg; |
64 | 68 | ||
65 | /* The lowest used consistent mapping entry. Since | ||
66 | * we allocate consistent maps out of cluster 0 this | ||
67 | * is relative to the beginning of closter 0. | ||
68 | */ | ||
69 | u32 lowest_consistent_map; | ||
70 | |||
71 | /* In order to deal with some buggy third-party PCI bridges that | 69 | /* In order to deal with some buggy third-party PCI bridges that |
72 | * do wrong prefetching, we never mark valid mappings as invalid. | 70 | * do wrong prefetching, we never mark valid mappings as invalid. |
73 | * Instead we point them at this dummy page. | 71 | * Instead we point them at this dummy page. |
@@ -75,16 +73,6 @@ struct pci_iommu { | |||
75 | unsigned long dummy_page; | 73 | unsigned long dummy_page; |
76 | unsigned long dummy_page_pa; | 74 | unsigned long dummy_page_pa; |
77 | 75 | ||
78 | /* If PBM_NCLUSTERS is ever decreased to 4 or lower, | ||
79 | * or if largest supported page_table_sz * 8K goes above | ||
80 | * 2GB, you must increase the size of the type of | ||
81 | * these counters. You have been duly warned. -DaveM | ||
82 | */ | ||
83 | struct { | ||
84 | u16 next; | ||
85 | u16 flush; | ||
86 | } alloc_info[PBM_NCLUSTERS]; | ||
87 | |||
88 | /* CTX allocation. */ | 76 | /* CTX allocation. */ |
89 | unsigned long ctx_lowest_free; | 77 | unsigned long ctx_lowest_free; |
90 | unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)]; | 78 | unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)]; |
@@ -102,7 +90,7 @@ struct pci_iommu { | |||
102 | u32 dma_addr_mask; | 90 | u32 dma_addr_mask; |
103 | }; | 91 | }; |
104 | 92 | ||
105 | extern void pci_iommu_table_init(struct pci_iommu *, int); | 93 | extern void pci_iommu_table_init(struct pci_iommu *iommu, int tsbsize, u32 dma_offset, u32 dma_addr_mask); |
106 | 94 | ||
107 | /* This describes a PCI bus module's streaming buffer. */ | 95 | /* This describes a PCI bus module's streaming buffer. */ |
108 | struct pci_strbuf { | 96 | struct pci_strbuf { |
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index b9b1914aae63..a96067cca963 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <asm/spitfire.h> | 10 | #include <asm/spitfire.h> |
11 | #include <asm/cpudata.h> | 11 | #include <asm/cpudata.h> |
12 | #include <asm/cacheflush.h> | 12 | #include <asm/cacheflush.h> |
13 | #include <asm/page.h> | ||
13 | 14 | ||
14 | /* Page table allocation/freeing. */ | 15 | /* Page table allocation/freeing. */ |
15 | #ifdef CONFIG_SMP | 16 | #ifdef CONFIG_SMP |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index a2b4f5ed4625..8c6dfc6c7af6 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -24,21 +24,23 @@ | |||
24 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
25 | #include <asm/const.h> | 25 | #include <asm/const.h> |
26 | 26 | ||
27 | /* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB). | 27 | /* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 32MB). |
28 | * The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB). | 28 | * The page copy blockops can use 0x2000000 to 0x10000000. |
29 | * The PROM resides in an area spanning 0xf0000000 to 0x100000000. | 29 | * The PROM resides in an area spanning 0xf0000000 to 0x100000000. |
30 | * The vmalloc area spans 0x140000000 to 0x200000000. | 30 | * The vmalloc area spans 0x100000000 to 0x200000000. |
31 | * Since modules need to be in the lowest 32-bits of the address space, | ||
32 | * we place them right before the OBP area from 0x10000000 to 0xf0000000. | ||
31 | * There is a single static kernel PMD which maps from 0x0 to address | 33 | * There is a single static kernel PMD which maps from 0x0 to address |
32 | * 0x400000000. | 34 | * 0x400000000. |
33 | */ | 35 | */ |
34 | #define TLBTEMP_BASE _AC(0x0000000001000000,UL) | 36 | #define TLBTEMP_BASE _AC(0x0000000002000000,UL) |
35 | #define MODULES_VADDR _AC(0x0000000002000000,UL) | 37 | #define MODULES_VADDR _AC(0x0000000010000000,UL) |
36 | #define MODULES_LEN _AC(0x000000007e000000,UL) | 38 | #define MODULES_LEN _AC(0x00000000e0000000,UL) |
37 | #define MODULES_END _AC(0x0000000080000000,UL) | 39 | #define MODULES_END _AC(0x00000000f0000000,UL) |
38 | #define VMALLOC_START _AC(0x0000000140000000,UL) | ||
39 | #define VMALLOC_END _AC(0x0000000200000000,UL) | ||
40 | #define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL) | 40 | #define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL) |
41 | #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) | 41 | #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) |
42 | #define VMALLOC_START _AC(0x0000000100000000,UL) | ||
43 | #define VMALLOC_END _AC(0x0000000200000000,UL) | ||
42 | 44 | ||
43 | /* XXX All of this needs to be rethought so we can take advantage | 45 | /* XXX All of this needs to be rethought so we can take advantage |
44 | * XXX cheetah's full 64-bit virtual address space, ie. no more hole | 46 | * XXX cheetah's full 64-bit virtual address space, ie. no more hole |
@@ -58,13 +60,13 @@ | |||
58 | * table can map | 60 | * table can map |
59 | */ | 61 | */ |
60 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) | 62 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) |
61 | #define PMD_SIZE (1UL << PMD_SHIFT) | 63 | #define PMD_SIZE (_AC(1,UL) << PMD_SHIFT) |
62 | #define PMD_MASK (~(PMD_SIZE-1)) | 64 | #define PMD_MASK (~(PMD_SIZE-1)) |
63 | #define PMD_BITS (PAGE_SHIFT - 2) | 65 | #define PMD_BITS (PAGE_SHIFT - 2) |
64 | 66 | ||
65 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 67 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
66 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) | 68 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) |
67 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 69 | #define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT) |
68 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
69 | #define PGDIR_BITS (PAGE_SHIFT - 2) | 71 | #define PGDIR_BITS (PAGE_SHIFT - 2) |
70 | 72 | ||
@@ -96,7 +98,9 @@ | |||
96 | #define _PAGE_NFO _AC(0x1000000000000000,UL) /* No Fault Only */ | 98 | #define _PAGE_NFO _AC(0x1000000000000000,UL) /* No Fault Only */ |
97 | #define _PAGE_IE _AC(0x0800000000000000,UL) /* Invert Endianness */ | 99 | #define _PAGE_IE _AC(0x0800000000000000,UL) /* Invert Endianness */ |
98 | #define _PAGE_SOFT2 _AC(0x07FC000000000000,UL) /* Software bits, set 2 */ | 100 | #define _PAGE_SOFT2 _AC(0x07FC000000000000,UL) /* Software bits, set 2 */ |
99 | #define _PAGE_RES1 _AC(0x0003000000000000,UL) /* Reserved */ | 101 | #define _PAGE_RES1 _AC(0x0002000000000000,UL) /* Reserved */ |
102 | #define _PAGE_SZ32MB _AC(0x0001000000000000,UL) /* (Panther) 32MB page */ | ||
103 | #define _PAGE_SZ256MB _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ | ||
100 | #define _PAGE_SN _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ | 104 | #define _PAGE_SN _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ |
101 | #define _PAGE_RES2 _AC(0x0000780000000000,UL) /* Reserved */ | 105 | #define _PAGE_RES2 _AC(0x0000780000000000,UL) /* Reserved */ |
102 | #define _PAGE_PADDR_SF _AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr[40:13]*/ | 106 | #define _PAGE_PADDR_SF _AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr[40:13]*/ |
@@ -334,7 +338,11 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
334 | #define pte_clear(mm,addr,ptep) \ | 338 | #define pte_clear(mm,addr,ptep) \ |
335 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 339 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
336 | 340 | ||
337 | extern pgd_t swapper_pg_dir[1]; | 341 | extern pgd_t swapper_pg_dir[2048]; |
342 | extern pmd_t swapper_low_pmd_dir[2048]; | ||
343 | |||
344 | extern void paging_init(void); | ||
345 | extern unsigned long find_ecache_flush_span(unsigned long size); | ||
338 | 346 | ||
339 | /* These do nothing with the way I have things setup. */ | 347 | /* These do nothing with the way I have things setup. */ |
340 | #define mmu_lockarea(vaddr, len) (vaddr) | 348 | #define mmu_lockarea(vaddr, len) (vaddr) |
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 80a65d7e3dbf..203e8eee6351 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h | |||
@@ -70,26 +70,14 @@ static inline int access_ok(int type, const void __user * addr, unsigned long si | |||
70 | * with the main instruction path. This means when everything is well, | 70 | * with the main instruction path. This means when everything is well, |
71 | * we don't even have to jump over them. Further, they do not intrude | 71 | * we don't even have to jump over them. Further, they do not intrude |
72 | * on our cache or tlb entries. | 72 | * on our cache or tlb entries. |
73 | * | ||
74 | * There is a special way how to put a range of potentially faulting | ||
75 | * insns (like twenty ldd/std's with now intervening other instructions) | ||
76 | * You specify address of first in insn and 0 in fixup and in the next | ||
77 | * exception_table_entry you specify last potentially faulting insn + 1 | ||
78 | * and in fixup the routine which should handle the fault. | ||
79 | * That fixup code will get | ||
80 | * (faulting_insn_address - first_insn_in_the_range_address)/4 | ||
81 | * in %g2 (ie. index of the faulting instruction in the range). | ||
82 | */ | 73 | */ |
83 | 74 | ||
84 | struct exception_table_entry | 75 | struct exception_table_entry { |
85 | { | 76 | unsigned int insn, fixup; |
86 | unsigned insn, fixup; | ||
87 | }; | 77 | }; |
88 | 78 | ||
89 | /* Special exable search, which handles ranges. Returns fixup */ | ||
90 | unsigned long search_extables_range(unsigned long addr, unsigned long *g2); | ||
91 | |||
92 | extern void __ret_efault(void); | 79 | extern void __ret_efault(void); |
80 | extern void __retl_efault(void); | ||
93 | 81 | ||
94 | /* Uh, these should become the main single-value transfer routines.. | 82 | /* Uh, these should become the main single-value transfer routines.. |
95 | * They automatically use the right size if we just have the right | 83 | * They automatically use the right size if we just have the right |
@@ -263,7 +251,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size) | |||
263 | { | 251 | { |
264 | unsigned long ret = ___copy_from_user(to, from, size); | 252 | unsigned long ret = ___copy_from_user(to, from, size); |
265 | 253 | ||
266 | if (ret) | 254 | if (unlikely(ret)) |
267 | ret = copy_from_user_fixup(to, from, size); | 255 | ret = copy_from_user_fixup(to, from, size); |
268 | return ret; | 256 | return ret; |
269 | } | 257 | } |
@@ -279,7 +267,7 @@ copy_to_user(void __user *to, const void *from, unsigned long size) | |||
279 | { | 267 | { |
280 | unsigned long ret = ___copy_to_user(to, from, size); | 268 | unsigned long ret = ___copy_to_user(to, from, size); |
281 | 269 | ||
282 | if (ret) | 270 | if (unlikely(ret)) |
283 | ret = copy_to_user_fixup(to, from, size); | 271 | ret = copy_to_user_fixup(to, from, size); |
284 | return ret; | 272 | return ret; |
285 | } | 273 | } |
@@ -295,7 +283,7 @@ copy_in_user(void __user *to, void __user *from, unsigned long size) | |||
295 | { | 283 | { |
296 | unsigned long ret = ___copy_in_user(to, from, size); | 284 | unsigned long ret = ___copy_in_user(to, from, size); |
297 | 285 | ||
298 | if (ret) | 286 | if (unlikely(ret)) |
299 | ret = copy_in_user_fixup(to, from, size); | 287 | ret = copy_in_user_fixup(to, from, size); |
300 | return ret; | 288 | return ret; |
301 | } | 289 | } |