Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26
[pandora-kernel.git] / arch / sparc64 / kernel / sparc64_ksyms.c
1 /* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
2  *
3  * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
4  * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
5  * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
6  */
7
8 /* Tell string.h we don't want memcpy etc. as cpp defines */
9 #define EXPORT_SYMTAB_STROPS
10 #define PROMLIB_INTERNAL
11
12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/string.h>
15 #include <linux/sched.h>
16 #include <linux/in6.h>
17 #include <linux/pci.h>
18 #include <linux/interrupt.h>
19 #include <linux/fs_struct.h>
20 #include <linux/fs.h>
21 #include <linux/mm.h>
22 #include <linux/socket.h>
23 #include <linux/syscalls.h>
24 #include <linux/percpu.h>
25 #include <linux/init.h>
26 #include <linux/rwsem.h>
27 #include <net/compat.h>
28
29 #include <asm/oplib.h>
30 #include <asm/system.h>
31 #include <asm/auxio.h>
32 #include <asm/pgtable.h>
33 #include <asm/io.h>
34 #include <asm/irq.h>
35 #include <asm/idprom.h>
36 #include <asm/svr4.h>
37 #include <asm/elf.h>
38 #include <asm/head.h>
39 #include <asm/smp.h>
40 #include <asm/mostek.h>
41 #include <asm/ptrace.h>
42 #include <asm/user.h>
43 #include <asm/uaccess.h>
44 #include <asm/checksum.h>
45 #include <asm/fpumacro.h>
46 #include <asm/pgalloc.h>
47 #include <asm/cacheflush.h>
48 #ifdef CONFIG_SBUS
49 #include <asm/sbus.h>
50 #include <asm/dma.h>
51 #endif
52 #ifdef CONFIG_PCI
53 #include <asm/ebus.h>
54 #include <asm/isa.h>
55 #endif
56 #include <asm/ns87303.h>
57 #include <asm/timer.h>
58 #include <asm/cpudata.h>
59
60 struct poll {
61         int fd;
62         short events;
63         short revents;
64 };
65
66 extern void die_if_kernel(char *str, struct pt_regs *regs);
67 extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
68 extern void *__bzero(void *, size_t);
69 extern void *__memscan_zero(void *, size_t);
70 extern void *__memscan_generic(void *, int, size_t);
71 extern int __memcmp(const void *, const void *, __kernel_size_t);
72 extern __kernel_size_t strlen(const char *);
73 extern void linux_sparc_syscall(void);
74 extern void rtrap(void);
75 extern void show_regs(struct pt_regs *);
76 extern void solaris_syscall(void);
77 extern void syscall_trace(struct pt_regs *, int);
78 extern u32 sunos_sys_table[], sys_call_table32[];
79 extern void tl0_solaris(void);
80 extern void sys_sigsuspend(void);
81 extern int svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
82 extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
83 extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
84 extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
85 extern long sparc32_open(const char __user * filename, int flags, int mode);
86 extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
87         unsigned long pfn, unsigned long size, pgprot_t prot);
88
89 extern int __ashrdi3(int, int);
90
91 extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
92
93 extern unsigned int sys_call_table[];
94
95 extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
96 extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
97                       unsigned long *);
98 extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
99                       unsigned long *, unsigned long *);
100 extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
101                       unsigned long *, unsigned long *, unsigned long *);
102
103 extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
104 extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
105                           unsigned long *);
106 extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
107                           unsigned long *, unsigned long *);
108 extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
109                           unsigned long *, unsigned long *, unsigned long *);
110
111 /* Per-CPU information table */
112 EXPORT_PER_CPU_SYMBOL(__cpu_data);
113
114 /* used by various drivers */
115 #ifdef CONFIG_SMP
116 /* Out of line rw-locking implementation. */
117 EXPORT_SYMBOL(__read_lock);
118 EXPORT_SYMBOL(__read_unlock);
119 EXPORT_SYMBOL(__write_lock);
120 EXPORT_SYMBOL(__write_unlock);
121 EXPORT_SYMBOL(__write_trylock);
122
123 EXPORT_SYMBOL(smp_call_function);
124 #endif /* CONFIG_SMP */
125
126 #if defined(CONFIG_MCOUNT)
127 extern void _mcount(void);
128 EXPORT_SYMBOL(_mcount);
129 #endif
130
131 EXPORT_SYMBOL(sparc64_get_clock_tick);
132
133 /* RW semaphores */
134 EXPORT_SYMBOL(__down_read);
135 EXPORT_SYMBOL(__down_read_trylock);
136 EXPORT_SYMBOL(__down_write);
137 EXPORT_SYMBOL(__down_write_trylock);
138 EXPORT_SYMBOL(__up_read);
139 EXPORT_SYMBOL(__up_write);
140 EXPORT_SYMBOL(__downgrade_write);
141
142 /* Atomic counter implementation. */
143 EXPORT_SYMBOL(atomic_add);
144 EXPORT_SYMBOL(atomic_add_ret);
145 EXPORT_SYMBOL(atomic_sub);
146 EXPORT_SYMBOL(atomic_sub_ret);
147 EXPORT_SYMBOL(atomic64_add);
148 EXPORT_SYMBOL(atomic64_add_ret);
149 EXPORT_SYMBOL(atomic64_sub);
150 EXPORT_SYMBOL(atomic64_sub_ret);
151
152 /* Atomic bit operations. */
153 EXPORT_SYMBOL(test_and_set_bit);
154 EXPORT_SYMBOL(test_and_clear_bit);
155 EXPORT_SYMBOL(test_and_change_bit);
156 EXPORT_SYMBOL(set_bit);
157 EXPORT_SYMBOL(clear_bit);
158 EXPORT_SYMBOL(change_bit);
159
160 EXPORT_SYMBOL(__flushw_user);
161
162 EXPORT_SYMBOL(tlb_type);
163 EXPORT_SYMBOL(sun4v_chip_type);
164 EXPORT_SYMBOL(get_fb_unmapped_area);
165 EXPORT_SYMBOL(flush_icache_range);
166
167 EXPORT_SYMBOL(flush_dcache_page);
168 #ifdef DCACHE_ALIASING_POSSIBLE
169 EXPORT_SYMBOL(__flush_dcache_range);
170 #endif
171
172 EXPORT_SYMBOL(mostek_lock);
173 EXPORT_SYMBOL(mstk48t02_regs);
174 #ifdef CONFIG_SUN_AUXIO
175 EXPORT_SYMBOL(auxio_set_led);
176 EXPORT_SYMBOL(auxio_set_lte);
177 #endif
178 #ifdef CONFIG_SBUS
179 EXPORT_SYMBOL(sbus_root);
180 EXPORT_SYMBOL(dma_chain);
181 EXPORT_SYMBOL(sbus_set_sbus64);
182 EXPORT_SYMBOL(sbus_alloc_consistent);
183 EXPORT_SYMBOL(sbus_free_consistent);
184 EXPORT_SYMBOL(sbus_map_single);
185 EXPORT_SYMBOL(sbus_unmap_single);
186 EXPORT_SYMBOL(sbus_map_sg);
187 EXPORT_SYMBOL(sbus_unmap_sg);
188 EXPORT_SYMBOL(sbus_dma_sync_single_for_cpu);
189 EXPORT_SYMBOL(sbus_dma_sync_single_for_device);
190 EXPORT_SYMBOL(sbus_dma_sync_sg_for_cpu);
191 EXPORT_SYMBOL(sbus_dma_sync_sg_for_device);
192 #endif
193 EXPORT_SYMBOL(outsb);
194 EXPORT_SYMBOL(outsw);
195 EXPORT_SYMBOL(outsl);
196 EXPORT_SYMBOL(insb);
197 EXPORT_SYMBOL(insw);
198 EXPORT_SYMBOL(insl);
199 #ifdef CONFIG_PCI
200 EXPORT_SYMBOL(ebus_chain);
201 EXPORT_SYMBOL(isa_chain);
202 EXPORT_SYMBOL(pci_alloc_consistent);
203 EXPORT_SYMBOL(pci_free_consistent);
204 EXPORT_SYMBOL(pci_map_single);
205 EXPORT_SYMBOL(pci_unmap_single);
206 EXPORT_SYMBOL(pci_map_sg);
207 EXPORT_SYMBOL(pci_unmap_sg);
208 EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
209 EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
210 EXPORT_SYMBOL(pci_dma_supported);
211 #endif
212
213 /* I/O device mmaping on Sparc64. */
214 EXPORT_SYMBOL(io_remap_pfn_range);
215
216 #if defined(CONFIG_COMPAT) && defined(CONFIG_NET)
217 /* Solaris/SunOS binary compatibility */
218 EXPORT_SYMBOL(verify_compat_iovec);
219 #endif
220
221 EXPORT_SYMBOL(dump_fpu);
222 EXPORT_SYMBOL(put_fs_struct);
223
224 /* math-emu wants this */
225 EXPORT_SYMBOL(die_if_kernel);
226
227 /* Kernel thread creation. */
228 EXPORT_SYMBOL(kernel_thread);
229
230 /* prom symbols */
231 EXPORT_SYMBOL(idprom);
232 EXPORT_SYMBOL(prom_root_node);
233 EXPORT_SYMBOL(prom_getchild);
234 EXPORT_SYMBOL(prom_getsibling);
235 EXPORT_SYMBOL(prom_searchsiblings);
236 EXPORT_SYMBOL(prom_firstprop);
237 EXPORT_SYMBOL(prom_nextprop);
238 EXPORT_SYMBOL(prom_getproplen);
239 EXPORT_SYMBOL(prom_getproperty);
240 EXPORT_SYMBOL(prom_node_has_property);
241 EXPORT_SYMBOL(prom_setprop);
242 EXPORT_SYMBOL(saved_command_line);
243 EXPORT_SYMBOL(prom_finddevice);
244 EXPORT_SYMBOL(prom_feval);
245 EXPORT_SYMBOL(prom_getbool);
246 EXPORT_SYMBOL(prom_getstring);
247 EXPORT_SYMBOL(prom_getint);
248 EXPORT_SYMBOL(prom_getintdefault);
249 EXPORT_SYMBOL(__prom_getchild);
250 EXPORT_SYMBOL(__prom_getsibling);
251
252 /* sparc library symbols */
253 EXPORT_SYMBOL(strlen);
254 EXPORT_SYMBOL(__strlen_user);
255 EXPORT_SYMBOL(__strnlen_user);
256
257 #ifdef CONFIG_SOLARIS_EMUL_MODULE
258 EXPORT_SYMBOL(linux_sparc_syscall);
259 EXPORT_SYMBOL(rtrap);
260 EXPORT_SYMBOL(show_regs);
261 EXPORT_SYMBOL(solaris_syscall);
262 EXPORT_SYMBOL(syscall_trace);
263 EXPORT_SYMBOL(sunos_sys_table);
264 EXPORT_SYMBOL(sys_call_table32);
265 EXPORT_SYMBOL(tl0_solaris);
266 EXPORT_SYMBOL(sys_sigsuspend);
267 EXPORT_SYMBOL(sys_getppid);
268 EXPORT_SYMBOL(sys_getpid);
269 EXPORT_SYMBOL(sys_geteuid);
270 EXPORT_SYMBOL(sys_getuid);
271 EXPORT_SYMBOL(sys_getegid);
272 EXPORT_SYMBOL(sysctl_nr_open);
273 EXPORT_SYMBOL(sys_getgid);
274 EXPORT_SYMBOL(svr4_getcontext);
275 EXPORT_SYMBOL(svr4_setcontext);
276 EXPORT_SYMBOL(compat_sys_ioctl);
277 EXPORT_SYMBOL(sys_ioctl);
278 EXPORT_SYMBOL(sparc32_open);
279 #endif
280
281 /* Special internal versions of library functions. */
282 EXPORT_SYMBOL(_clear_page);
283 EXPORT_SYMBOL(clear_user_page);
284 EXPORT_SYMBOL(copy_user_page);
285 EXPORT_SYMBOL(__bzero);
286 EXPORT_SYMBOL(__memscan_zero);
287 EXPORT_SYMBOL(__memscan_generic);
288 EXPORT_SYMBOL(__memcmp);
289 EXPORT_SYMBOL(__memset);
290
291 EXPORT_SYMBOL(csum_partial);
292 EXPORT_SYMBOL(csum_partial_copy_nocheck);
293 EXPORT_SYMBOL(__csum_partial_copy_from_user);
294 EXPORT_SYMBOL(__csum_partial_copy_to_user);
295 EXPORT_SYMBOL(ip_fast_csum);
296
297 /* Moving data to/from/in userspace. */
298 EXPORT_SYMBOL(___copy_to_user);
299 EXPORT_SYMBOL(___copy_from_user);
300 EXPORT_SYMBOL(___copy_in_user);
301 EXPORT_SYMBOL(copy_to_user_fixup);
302 EXPORT_SYMBOL(copy_from_user_fixup);
303 EXPORT_SYMBOL(copy_in_user_fixup);
304 EXPORT_SYMBOL(__strncpy_from_user);
305 EXPORT_SYMBOL(__clear_user);
306
307 /* Various address conversion macros use this. */
308 EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
309
310 /* No version information on this, heavily used in inline asm,
311  * and will always be 'void __ret_efault(void)'.
312  */
313 EXPORT_SYMBOL(__ret_efault);
314
315 /* No version information on these, as gcc produces such symbols. */
316 EXPORT_SYMBOL(memcmp);
317 EXPORT_SYMBOL(memcpy);
318 EXPORT_SYMBOL(memset);
319 EXPORT_SYMBOL(memmove);
320 EXPORT_SYMBOL(strncmp);
321
322 void VISenter(void);
323 /* RAID code needs this */
324 EXPORT_SYMBOL(VISenter);
325
326 /* for input/keybdev */
327 EXPORT_SYMBOL(sun_do_break);
328 EXPORT_SYMBOL(stop_a_enabled);
329
330 #ifdef CONFIG_DEBUG_BUGVERBOSE
331 EXPORT_SYMBOL(do_BUG);
332 #endif
333
334 /* for ns8703 */
335 EXPORT_SYMBOL(ns87303_lock);
336
337 /* for solaris compat module */
338 EXPORT_SYMBOL_GPL(sys_call_table);
339
340 EXPORT_SYMBOL(tick_ops);
341
342 EXPORT_SYMBOL(xor_vis_2);
343 EXPORT_SYMBOL(xor_vis_3);
344 EXPORT_SYMBOL(xor_vis_4);
345 EXPORT_SYMBOL(xor_vis_5);
346
347 EXPORT_SYMBOL(xor_niagara_2);
348 EXPORT_SYMBOL(xor_niagara_3);
349 EXPORT_SYMBOL(xor_niagara_4);
350 EXPORT_SYMBOL(xor_niagara_5);