blob: 33dadd9f28712a14fe964e56933acb3f80486bab [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/types.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/in6.h>
20#include <linux/spinlock.h>
21#include <linux/mm.h>
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070022#include <linux/syscalls.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#ifdef CONFIG_PCI
24#include <linux/pci.h>
25#endif
26#include <linux/pm.h>
27#ifdef CONFIG_HIGHMEM
28#include <linux/highmem.h>
29#endif
30
31#include <asm/oplib.h>
32#include <asm/delay.h>
33#include <asm/system.h>
34#include <asm/auxio.h>
35#include <asm/pgtable.h>
36#include <asm/io.h>
37#include <asm/irq.h>
38#include <asm/idprom.h>
39#include <asm/svr4.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#ifdef CONFIG_SBUS
48#include <asm/sbus.h>
49#include <asm/dma.h>
50#endif
51#ifdef CONFIG_PCI
52#include <asm/ebus.h>
53#endif
54#include <asm/a.out.h>
55#include <asm/io-unit.h>
56#include <asm/bug.h>
57
58extern spinlock_t rtc_lock;
59
60struct poll {
61 int fd;
62 short events;
63 short revents;
64};
65
66extern int svr4_getcontext (svr4_ucontext_t *, struct pt_regs *);
67extern int svr4_setcontext (svr4_ucontext_t *, struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068extern void (*__copy_1page)(void *, const void *);
69extern void __memmove(void *, const void *, __kernel_size_t);
70extern void (*bzero_1page)(void *);
71extern void *__bzero(void *, size_t);
72extern void *__memscan_zero(void *, size_t);
73extern void *__memscan_generic(void *, int, size_t);
74extern int __memcmp(const void *, const void *, __kernel_size_t);
75extern int __strncmp(const char *, const char *, __kernel_size_t);
76
77extern int __ashrdi3(int, int);
78extern int __ashldi3(int, int);
79extern int __lshrdi3(int, int);
80extern int __muldi3(int, int);
81extern int __divdi3(int, int);
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083/* Private functions with odd calling conventions. */
84extern void ___atomic24_add(void);
85extern void ___atomic24_sub(void);
86extern void ___set_bit(void);
87extern void ___clear_bit(void);
88extern void ___change_bit(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070089extern void ___rw_read_enter(void);
Al Viro7a39f522006-10-08 14:32:15 +010090extern void ___rw_read_try(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070091extern void ___rw_read_exit(void);
92extern void ___rw_write_enter(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
94/* Alias functions whose names begin with "." and export the aliases.
95 * The module references will be fixed up by module_frob_arch_sections.
96 */
Al Viro7caaeab2005-09-11 20:14:07 -070097extern int _Div(int, int);
98extern int _Mul(int, int);
99extern int _Rem(int, int);
100extern unsigned _Udiv(unsigned, unsigned);
101extern unsigned _Umul(unsigned, unsigned);
102extern unsigned _Urem(unsigned, unsigned);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
104/* used by various drivers */
105EXPORT_SYMBOL(sparc_cpu_model);
106EXPORT_SYMBOL(kernel_thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107#ifdef CONFIG_SMP
Al Viro7a39f522006-10-08 14:32:15 +0100108// XXX find what uses (or used) these. AV: see asm/spinlock.h
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700109EXPORT_SYMBOL(___rw_read_enter);
Al Viro7a39f522006-10-08 14:32:15 +0100110EXPORT_SYMBOL(___rw_read_try);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700111EXPORT_SYMBOL(___rw_read_exit);
112EXPORT_SYMBOL(___rw_write_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113#endif
114/* semaphores */
115EXPORT_SYMBOL(__up);
116EXPORT_SYMBOL(__down);
117EXPORT_SYMBOL(__down_trylock);
118EXPORT_SYMBOL(__down_interruptible);
119
120EXPORT_SYMBOL(sparc_valid_addr_bitmap);
121EXPORT_SYMBOL(phys_base);
122EXPORT_SYMBOL(pfn_base);
123
124/* Atomic operations. */
125EXPORT_SYMBOL(___atomic24_add);
126EXPORT_SYMBOL(___atomic24_sub);
127
128/* Bit operations. */
129EXPORT_SYMBOL(___set_bit);
130EXPORT_SYMBOL(___clear_bit);
131EXPORT_SYMBOL(___change_bit);
132
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700133/* Per-CPU information table */
134EXPORT_PER_CPU_SYMBOL(__cpu_data);
135
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136#ifdef CONFIG_SMP
137/* IRQ implementation. */
138EXPORT_SYMBOL(synchronize_irq);
139
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700140/* CPU online map and active count. */
141EXPORT_SYMBOL(cpu_online_map);
142EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143#endif
144
145EXPORT_SYMBOL(__udelay);
146EXPORT_SYMBOL(__ndelay);
147EXPORT_SYMBOL(rtc_lock);
148EXPORT_SYMBOL(mostek_lock);
149EXPORT_SYMBOL(mstk48t02_regs);
150#ifdef CONFIG_SUN_AUXIO
151EXPORT_SYMBOL(set_auxio);
152EXPORT_SYMBOL(get_auxio);
153#endif
154EXPORT_SYMBOL(request_fast_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155EXPORT_SYMBOL(io_remap_pfn_range);
156 /* P3: iounit_xxx may be needed, sun4d users */
157/* EXPORT_SYMBOL(iounit_map_dma_init); */
158/* EXPORT_SYMBOL(iounit_map_dma_page); */
159
160#ifndef CONFIG_SMP
161EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
162#else
163EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
164#endif
165EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
166EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
168EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
169EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
170EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
171EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
172EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
173
174#ifdef CONFIG_SBUS
175EXPORT_SYMBOL(sbus_root);
176EXPORT_SYMBOL(dma_chain);
177EXPORT_SYMBOL(sbus_set_sbus64);
178EXPORT_SYMBOL(sbus_alloc_consistent);
179EXPORT_SYMBOL(sbus_free_consistent);
180EXPORT_SYMBOL(sbus_map_single);
181EXPORT_SYMBOL(sbus_unmap_single);
182EXPORT_SYMBOL(sbus_map_sg);
183EXPORT_SYMBOL(sbus_unmap_sg);
184EXPORT_SYMBOL(sbus_dma_sync_single_for_cpu);
185EXPORT_SYMBOL(sbus_dma_sync_single_for_device);
186EXPORT_SYMBOL(sbus_dma_sync_sg_for_cpu);
187EXPORT_SYMBOL(sbus_dma_sync_sg_for_device);
188EXPORT_SYMBOL(sbus_iounmap);
189EXPORT_SYMBOL(sbus_ioremap);
190#endif
191#ifdef CONFIG_PCI
192EXPORT_SYMBOL(ebus_chain);
193EXPORT_SYMBOL(insb);
194EXPORT_SYMBOL(outsb);
195EXPORT_SYMBOL(insw);
196EXPORT_SYMBOL(outsw);
197EXPORT_SYMBOL(insl);
198EXPORT_SYMBOL(outsl);
199EXPORT_SYMBOL(pci_alloc_consistent);
200EXPORT_SYMBOL(pci_free_consistent);
201EXPORT_SYMBOL(pci_map_single);
202EXPORT_SYMBOL(pci_unmap_single);
203EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
204EXPORT_SYMBOL(pci_dma_sync_single_for_device);
205EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
206EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
207EXPORT_SYMBOL(pci_map_sg);
208EXPORT_SYMBOL(pci_unmap_sg);
209EXPORT_SYMBOL(pci_map_page);
210EXPORT_SYMBOL(pci_unmap_page);
211/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
212EXPORT_SYMBOL(ioremap);
213EXPORT_SYMBOL(iounmap);
214#endif
215
216/* in arch/sparc/mm/highmem.c */
217#ifdef CONFIG_HIGHMEM
218EXPORT_SYMBOL(kmap_atomic);
219EXPORT_SYMBOL(kunmap_atomic);
220#endif
221
222/* Solaris/SunOS binary compatibility */
223EXPORT_SYMBOL(svr4_setcontext);
224EXPORT_SYMBOL(svr4_getcontext);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225
226EXPORT_SYMBOL(dump_thread);
227
228/* prom symbols */
229EXPORT_SYMBOL(idprom);
230EXPORT_SYMBOL(prom_root_node);
231EXPORT_SYMBOL(prom_getchild);
232EXPORT_SYMBOL(prom_getsibling);
233EXPORT_SYMBOL(prom_searchsiblings);
234EXPORT_SYMBOL(prom_firstprop);
235EXPORT_SYMBOL(prom_nextprop);
236EXPORT_SYMBOL(prom_getproplen);
237EXPORT_SYMBOL(prom_getproperty);
238EXPORT_SYMBOL(prom_node_has_property);
239EXPORT_SYMBOL(prom_setprop);
240EXPORT_SYMBOL(saved_command_line);
241EXPORT_SYMBOL(prom_apply_obio_ranges);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242EXPORT_SYMBOL(prom_feval);
243EXPORT_SYMBOL(prom_getbool);
244EXPORT_SYMBOL(prom_getstring);
245EXPORT_SYMBOL(prom_getint);
246EXPORT_SYMBOL(prom_getintdefault);
247EXPORT_SYMBOL(prom_finddevice);
248EXPORT_SYMBOL(romvec);
249EXPORT_SYMBOL(__prom_getchild);
250EXPORT_SYMBOL(__prom_getsibling);
251
252/* sparc library symbols */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253EXPORT_SYMBOL(memscan);
254EXPORT_SYMBOL(strlen);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255EXPORT_SYMBOL(strncmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256EXPORT_SYMBOL(page_kernel);
257
258/* Special internal versions of library functions. */
259EXPORT_SYMBOL(__copy_1page);
260EXPORT_SYMBOL(__memcpy);
261EXPORT_SYMBOL(__memset);
262EXPORT_SYMBOL(bzero_1page);
263EXPORT_SYMBOL(__bzero);
264EXPORT_SYMBOL(__memscan_zero);
265EXPORT_SYMBOL(__memscan_generic);
266EXPORT_SYMBOL(__memcmp);
267EXPORT_SYMBOL(__strncmp);
268EXPORT_SYMBOL(__memmove);
269
270/* Moving data to/from userspace. */
271EXPORT_SYMBOL(__copy_user);
272EXPORT_SYMBOL(__strncpy_from_user);
273
274/* Networking helper routines. */
275EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
276EXPORT_SYMBOL(csum_partial);
277
278/* Cache flushing. */
279EXPORT_SYMBOL(sparc_flush_page_to_ram);
280
281/* For when serial stuff is built as modules. */
282EXPORT_SYMBOL(sun_do_break);
283
284EXPORT_SYMBOL(__ret_efault);
285
286EXPORT_SYMBOL(memcmp);
287EXPORT_SYMBOL(memcpy);
288EXPORT_SYMBOL(memset);
289EXPORT_SYMBOL(memmove);
290EXPORT_SYMBOL(__ashrdi3);
291EXPORT_SYMBOL(__ashldi3);
292EXPORT_SYMBOL(__lshrdi3);
293EXPORT_SYMBOL(__muldi3);
294EXPORT_SYMBOL(__divdi3);
295
Al Viro7caaeab2005-09-11 20:14:07 -0700296EXPORT_SYMBOL(_Rem);
297EXPORT_SYMBOL(_Urem);
298EXPORT_SYMBOL(_Mul);
299EXPORT_SYMBOL(_Umul);
300EXPORT_SYMBOL(_Div);
301EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302
303#ifdef CONFIG_DEBUG_BUGVERBOSE
304EXPORT_SYMBOL(do_BUG);
305#endif
306
307/* Sun Power Management Idle Handler */
308EXPORT_SYMBOL(pm_idle);