blob: 1c8fd0fd930590ce218d915cbcc4cf128fc4b66d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* $Id: sparc_ksyms.c,v 1.107 2001/07/17 16:17:33 anton Exp $
2 * arch/sparc/kernel/ksyms.c: Sparc 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 */
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/config.h>
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/smp.h>
16#include <linux/types.h>
17#include <linux/string.h>
18#include <linux/sched.h>
19#include <linux/interrupt.h>
20#include <linux/in6.h>
21#include <linux/spinlock.h>
22#include <linux/mm.h>
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070023#include <linux/syscalls.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#ifdef CONFIG_PCI
25#include <linux/pci.h>
26#endif
27#include <linux/pm.h>
28#ifdef CONFIG_HIGHMEM
29#include <linux/highmem.h>
30#endif
31
32#include <asm/oplib.h>
33#include <asm/delay.h>
34#include <asm/system.h>
35#include <asm/auxio.h>
36#include <asm/pgtable.h>
37#include <asm/io.h>
38#include <asm/irq.h>
39#include <asm/idprom.h>
40#include <asm/svr4.h>
41#include <asm/head.h>
42#include <asm/smp.h>
43#include <asm/mostek.h>
44#include <asm/ptrace.h>
45#include <asm/user.h>
46#include <asm/uaccess.h>
47#include <asm/checksum.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#endif
55#include <asm/a.out.h>
56#include <asm/io-unit.h>
57#include <asm/bug.h>
58
59extern spinlock_t rtc_lock;
60
61struct poll {
62 int fd;
63 short events;
64 short revents;
65};
66
67extern int svr4_getcontext (svr4_ucontext_t *, struct pt_regs *);
68extern int svr4_setcontext (svr4_ucontext_t *, struct pt_regs *);
69void _sigpause_common (unsigned int set, struct pt_regs *);
70extern void (*__copy_1page)(void *, const void *);
71extern void __memmove(void *, const void *, __kernel_size_t);
72extern void (*bzero_1page)(void *);
73extern void *__bzero(void *, size_t);
74extern void *__memscan_zero(void *, size_t);
75extern void *__memscan_generic(void *, int, size_t);
76extern int __memcmp(const void *, const void *, __kernel_size_t);
77extern int __strncmp(const char *, const char *, __kernel_size_t);
78
79extern int __ashrdi3(int, int);
80extern int __ashldi3(int, int);
81extern int __lshrdi3(int, int);
82extern int __muldi3(int, int);
83extern int __divdi3(int, int);
84
85extern void dump_thread(struct pt_regs *, struct user *);
86
87/* Private functions with odd calling conventions. */
88extern void ___atomic24_add(void);
89extern void ___atomic24_sub(void);
90extern void ___set_bit(void);
91extern void ___clear_bit(void);
92extern void ___change_bit(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070093extern void ___rw_read_enter(void);
94extern void ___rw_read_exit(void);
95extern void ___rw_write_enter(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
97/* Alias functions whose names begin with "." and export the aliases.
98 * The module references will be fixed up by module_frob_arch_sections.
99 */
Al Viro7caaeab2005-09-11 20:14:07 -0700100extern int _Div(int, int);
101extern int _Mul(int, int);
102extern int _Rem(int, int);
103extern unsigned _Udiv(unsigned, unsigned);
104extern unsigned _Umul(unsigned, unsigned);
105extern unsigned _Urem(unsigned, unsigned);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107/* used by various drivers */
108EXPORT_SYMBOL(sparc_cpu_model);
109EXPORT_SYMBOL(kernel_thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110#ifdef CONFIG_SMP
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111// XXX find what uses (or used) these.
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700112EXPORT_SYMBOL(___rw_read_enter);
113EXPORT_SYMBOL(___rw_read_exit);
114EXPORT_SYMBOL(___rw_write_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115#endif
116/* semaphores */
117EXPORT_SYMBOL(__up);
118EXPORT_SYMBOL(__down);
119EXPORT_SYMBOL(__down_trylock);
120EXPORT_SYMBOL(__down_interruptible);
121
122EXPORT_SYMBOL(sparc_valid_addr_bitmap);
123EXPORT_SYMBOL(phys_base);
124EXPORT_SYMBOL(pfn_base);
125
126/* Atomic operations. */
127EXPORT_SYMBOL(___atomic24_add);
128EXPORT_SYMBOL(___atomic24_sub);
129
130/* Bit operations. */
131EXPORT_SYMBOL(___set_bit);
132EXPORT_SYMBOL(___clear_bit);
133EXPORT_SYMBOL(___change_bit);
134
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700135/* Per-CPU information table */
136EXPORT_PER_CPU_SYMBOL(__cpu_data);
137
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138#ifdef CONFIG_SMP
139/* IRQ implementation. */
140EXPORT_SYMBOL(synchronize_irq);
141
142/* Misc SMP information */
143EXPORT_SYMBOL(__cpu_number_map);
144EXPORT_SYMBOL(__cpu_logical_map);
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700145
146/* CPU online map and active count. */
147EXPORT_SYMBOL(cpu_online_map);
148EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149#endif
150
151EXPORT_SYMBOL(__udelay);
152EXPORT_SYMBOL(__ndelay);
153EXPORT_SYMBOL(rtc_lock);
154EXPORT_SYMBOL(mostek_lock);
155EXPORT_SYMBOL(mstk48t02_regs);
156#ifdef CONFIG_SUN_AUXIO
157EXPORT_SYMBOL(set_auxio);
158EXPORT_SYMBOL(get_auxio);
159#endif
160EXPORT_SYMBOL(request_fast_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161EXPORT_SYMBOL(io_remap_pfn_range);
162 /* P3: iounit_xxx may be needed, sun4d users */
163/* EXPORT_SYMBOL(iounit_map_dma_init); */
164/* EXPORT_SYMBOL(iounit_map_dma_page); */
165
166#ifndef CONFIG_SMP
167EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
168#else
169EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
170#endif
171EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
172EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
173EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa));
174EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
175EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
176EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
177EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
178EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
179EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
180
181#ifdef CONFIG_SBUS
182EXPORT_SYMBOL(sbus_root);
183EXPORT_SYMBOL(dma_chain);
184EXPORT_SYMBOL(sbus_set_sbus64);
185EXPORT_SYMBOL(sbus_alloc_consistent);
186EXPORT_SYMBOL(sbus_free_consistent);
187EXPORT_SYMBOL(sbus_map_single);
188EXPORT_SYMBOL(sbus_unmap_single);
189EXPORT_SYMBOL(sbus_map_sg);
190EXPORT_SYMBOL(sbus_unmap_sg);
191EXPORT_SYMBOL(sbus_dma_sync_single_for_cpu);
192EXPORT_SYMBOL(sbus_dma_sync_single_for_device);
193EXPORT_SYMBOL(sbus_dma_sync_sg_for_cpu);
194EXPORT_SYMBOL(sbus_dma_sync_sg_for_device);
195EXPORT_SYMBOL(sbus_iounmap);
196EXPORT_SYMBOL(sbus_ioremap);
197#endif
198#ifdef CONFIG_PCI
199EXPORT_SYMBOL(ebus_chain);
200EXPORT_SYMBOL(insb);
201EXPORT_SYMBOL(outsb);
202EXPORT_SYMBOL(insw);
203EXPORT_SYMBOL(outsw);
204EXPORT_SYMBOL(insl);
205EXPORT_SYMBOL(outsl);
206EXPORT_SYMBOL(pci_alloc_consistent);
207EXPORT_SYMBOL(pci_free_consistent);
208EXPORT_SYMBOL(pci_map_single);
209EXPORT_SYMBOL(pci_unmap_single);
210EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
211EXPORT_SYMBOL(pci_dma_sync_single_for_device);
212EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
213EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
214EXPORT_SYMBOL(pci_map_sg);
215EXPORT_SYMBOL(pci_unmap_sg);
216EXPORT_SYMBOL(pci_map_page);
217EXPORT_SYMBOL(pci_unmap_page);
218/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
219EXPORT_SYMBOL(ioremap);
220EXPORT_SYMBOL(iounmap);
221#endif
222
223/* in arch/sparc/mm/highmem.c */
224#ifdef CONFIG_HIGHMEM
225EXPORT_SYMBOL(kmap_atomic);
226EXPORT_SYMBOL(kunmap_atomic);
227#endif
228
229/* Solaris/SunOS binary compatibility */
230EXPORT_SYMBOL(svr4_setcontext);
231EXPORT_SYMBOL(svr4_getcontext);
232EXPORT_SYMBOL(_sigpause_common);
233
234EXPORT_SYMBOL(dump_thread);
235
236/* prom symbols */
237EXPORT_SYMBOL(idprom);
238EXPORT_SYMBOL(prom_root_node);
239EXPORT_SYMBOL(prom_getchild);
240EXPORT_SYMBOL(prom_getsibling);
241EXPORT_SYMBOL(prom_searchsiblings);
242EXPORT_SYMBOL(prom_firstprop);
243EXPORT_SYMBOL(prom_nextprop);
244EXPORT_SYMBOL(prom_getproplen);
245EXPORT_SYMBOL(prom_getproperty);
246EXPORT_SYMBOL(prom_node_has_property);
247EXPORT_SYMBOL(prom_setprop);
248EXPORT_SYMBOL(saved_command_line);
249EXPORT_SYMBOL(prom_apply_obio_ranges);
250EXPORT_SYMBOL(prom_getname);
251EXPORT_SYMBOL(prom_feval);
252EXPORT_SYMBOL(prom_getbool);
253EXPORT_SYMBOL(prom_getstring);
254EXPORT_SYMBOL(prom_getint);
255EXPORT_SYMBOL(prom_getintdefault);
256EXPORT_SYMBOL(prom_finddevice);
257EXPORT_SYMBOL(romvec);
258EXPORT_SYMBOL(__prom_getchild);
259EXPORT_SYMBOL(__prom_getsibling);
260
261/* sparc library symbols */
262EXPORT_SYMBOL(memchr);
263EXPORT_SYMBOL(memscan);
264EXPORT_SYMBOL(strlen);
265EXPORT_SYMBOL(strnlen);
266EXPORT_SYMBOL(strcpy);
267EXPORT_SYMBOL(strncpy);
268EXPORT_SYMBOL(strcat);
269EXPORT_SYMBOL(strncat);
270EXPORT_SYMBOL(strcmp);
271EXPORT_SYMBOL(strncmp);
272EXPORT_SYMBOL(strchr);
273EXPORT_SYMBOL(strrchr);
274EXPORT_SYMBOL(strpbrk);
275EXPORT_SYMBOL(strstr);
276EXPORT_SYMBOL(page_kernel);
277
278/* Special internal versions of library functions. */
279EXPORT_SYMBOL(__copy_1page);
280EXPORT_SYMBOL(__memcpy);
281EXPORT_SYMBOL(__memset);
282EXPORT_SYMBOL(bzero_1page);
283EXPORT_SYMBOL(__bzero);
284EXPORT_SYMBOL(__memscan_zero);
285EXPORT_SYMBOL(__memscan_generic);
286EXPORT_SYMBOL(__memcmp);
287EXPORT_SYMBOL(__strncmp);
288EXPORT_SYMBOL(__memmove);
289
290/* Moving data to/from userspace. */
291EXPORT_SYMBOL(__copy_user);
292EXPORT_SYMBOL(__strncpy_from_user);
293
294/* Networking helper routines. */
295EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
296EXPORT_SYMBOL(csum_partial);
297
298/* Cache flushing. */
299EXPORT_SYMBOL(sparc_flush_page_to_ram);
300
301/* For when serial stuff is built as modules. */
302EXPORT_SYMBOL(sun_do_break);
303
304EXPORT_SYMBOL(__ret_efault);
305
306EXPORT_SYMBOL(memcmp);
307EXPORT_SYMBOL(memcpy);
308EXPORT_SYMBOL(memset);
309EXPORT_SYMBOL(memmove);
310EXPORT_SYMBOL(__ashrdi3);
311EXPORT_SYMBOL(__ashldi3);
312EXPORT_SYMBOL(__lshrdi3);
313EXPORT_SYMBOL(__muldi3);
314EXPORT_SYMBOL(__divdi3);
315
Al Viro7caaeab2005-09-11 20:14:07 -0700316EXPORT_SYMBOL(_Rem);
317EXPORT_SYMBOL(_Urem);
318EXPORT_SYMBOL(_Mul);
319EXPORT_SYMBOL(_Umul);
320EXPORT_SYMBOL(_Div);
321EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322
323#ifdef CONFIG_DEBUG_BUGVERBOSE
324EXPORT_SYMBOL(do_BUG);
325#endif
326
327/* Sun Power Management Idle Handler */
328EXPORT_SYMBOL(pm_idle);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700329
330/* Binfmt_misc needs this */
331EXPORT_SYMBOL(sys_close);