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