blob: 0b0d492c953b0118114d925cf1672b11500f0926 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070085/* Private functions with odd calling conventions. */
86extern void ___atomic24_add(void);
87extern void ___atomic24_sub(void);
88extern void ___set_bit(void);
89extern void ___clear_bit(void);
90extern void ___change_bit(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070091extern void ___rw_read_enter(void);
92extern void ___rw_read_exit(void);
93extern void ___rw_write_enter(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
95/* Alias functions whose names begin with "." and export the aliases.
96 * The module references will be fixed up by module_frob_arch_sections.
97 */
Al Viro7caaeab2005-09-11 20:14:07 -070098extern int _Div(int, int);
99extern int _Mul(int, int);
100extern int _Rem(int, int);
101extern unsigned _Udiv(unsigned, unsigned);
102extern unsigned _Umul(unsigned, unsigned);
103extern unsigned _Urem(unsigned, unsigned);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104
105/* used by various drivers */
106EXPORT_SYMBOL(sparc_cpu_model);
107EXPORT_SYMBOL(kernel_thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108#ifdef CONFIG_SMP
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109// XXX find what uses (or used) these.
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700110EXPORT_SYMBOL(___rw_read_enter);
111EXPORT_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
140/* Misc SMP information */
141EXPORT_SYMBOL(__cpu_number_map);
142EXPORT_SYMBOL(__cpu_logical_map);
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700143
144/* CPU online map and active count. */
145EXPORT_SYMBOL(cpu_online_map);
146EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147#endif
148
149EXPORT_SYMBOL(__udelay);
150EXPORT_SYMBOL(__ndelay);
151EXPORT_SYMBOL(rtc_lock);
152EXPORT_SYMBOL(mostek_lock);
153EXPORT_SYMBOL(mstk48t02_regs);
154#ifdef CONFIG_SUN_AUXIO
155EXPORT_SYMBOL(set_auxio);
156EXPORT_SYMBOL(get_auxio);
157#endif
158EXPORT_SYMBOL(request_fast_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159EXPORT_SYMBOL(io_remap_pfn_range);
160 /* P3: iounit_xxx may be needed, sun4d users */
161/* EXPORT_SYMBOL(iounit_map_dma_init); */
162/* EXPORT_SYMBOL(iounit_map_dma_page); */
163
164#ifndef CONFIG_SMP
165EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
166#else
167EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
168#endif
169EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
170EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
171EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa));
172EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
173EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
174EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
175EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
176EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
177EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
178
179#ifdef CONFIG_SBUS
180EXPORT_SYMBOL(sbus_root);
181EXPORT_SYMBOL(dma_chain);
182EXPORT_SYMBOL(sbus_set_sbus64);
183EXPORT_SYMBOL(sbus_alloc_consistent);
184EXPORT_SYMBOL(sbus_free_consistent);
185EXPORT_SYMBOL(sbus_map_single);
186EXPORT_SYMBOL(sbus_unmap_single);
187EXPORT_SYMBOL(sbus_map_sg);
188EXPORT_SYMBOL(sbus_unmap_sg);
189EXPORT_SYMBOL(sbus_dma_sync_single_for_cpu);
190EXPORT_SYMBOL(sbus_dma_sync_single_for_device);
191EXPORT_SYMBOL(sbus_dma_sync_sg_for_cpu);
192EXPORT_SYMBOL(sbus_dma_sync_sg_for_device);
193EXPORT_SYMBOL(sbus_iounmap);
194EXPORT_SYMBOL(sbus_ioremap);
195#endif
196#ifdef CONFIG_PCI
197EXPORT_SYMBOL(ebus_chain);
198EXPORT_SYMBOL(insb);
199EXPORT_SYMBOL(outsb);
200EXPORT_SYMBOL(insw);
201EXPORT_SYMBOL(outsw);
202EXPORT_SYMBOL(insl);
203EXPORT_SYMBOL(outsl);
204EXPORT_SYMBOL(pci_alloc_consistent);
205EXPORT_SYMBOL(pci_free_consistent);
206EXPORT_SYMBOL(pci_map_single);
207EXPORT_SYMBOL(pci_unmap_single);
208EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
209EXPORT_SYMBOL(pci_dma_sync_single_for_device);
210EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
211EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
212EXPORT_SYMBOL(pci_map_sg);
213EXPORT_SYMBOL(pci_unmap_sg);
214EXPORT_SYMBOL(pci_map_page);
215EXPORT_SYMBOL(pci_unmap_page);
216/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
217EXPORT_SYMBOL(ioremap);
218EXPORT_SYMBOL(iounmap);
219#endif
220
221/* in arch/sparc/mm/highmem.c */
222#ifdef CONFIG_HIGHMEM
223EXPORT_SYMBOL(kmap_atomic);
224EXPORT_SYMBOL(kunmap_atomic);
225#endif
226
227/* Solaris/SunOS binary compatibility */
228EXPORT_SYMBOL(svr4_setcontext);
229EXPORT_SYMBOL(svr4_getcontext);
230EXPORT_SYMBOL(_sigpause_common);
231
232EXPORT_SYMBOL(dump_thread);
233
234/* prom symbols */
235EXPORT_SYMBOL(idprom);
236EXPORT_SYMBOL(prom_root_node);
237EXPORT_SYMBOL(prom_getchild);
238EXPORT_SYMBOL(prom_getsibling);
239EXPORT_SYMBOL(prom_searchsiblings);
240EXPORT_SYMBOL(prom_firstprop);
241EXPORT_SYMBOL(prom_nextprop);
242EXPORT_SYMBOL(prom_getproplen);
243EXPORT_SYMBOL(prom_getproperty);
244EXPORT_SYMBOL(prom_node_has_property);
245EXPORT_SYMBOL(prom_setprop);
246EXPORT_SYMBOL(saved_command_line);
247EXPORT_SYMBOL(prom_apply_obio_ranges);
248EXPORT_SYMBOL(prom_getname);
249EXPORT_SYMBOL(prom_feval);
250EXPORT_SYMBOL(prom_getbool);
251EXPORT_SYMBOL(prom_getstring);
252EXPORT_SYMBOL(prom_getint);
253EXPORT_SYMBOL(prom_getintdefault);
254EXPORT_SYMBOL(prom_finddevice);
255EXPORT_SYMBOL(romvec);
256EXPORT_SYMBOL(__prom_getchild);
257EXPORT_SYMBOL(__prom_getsibling);
258
259/* sparc library symbols */
260EXPORT_SYMBOL(memchr);
261EXPORT_SYMBOL(memscan);
262EXPORT_SYMBOL(strlen);
263EXPORT_SYMBOL(strnlen);
264EXPORT_SYMBOL(strcpy);
265EXPORT_SYMBOL(strncpy);
266EXPORT_SYMBOL(strcat);
267EXPORT_SYMBOL(strncat);
268EXPORT_SYMBOL(strcmp);
269EXPORT_SYMBOL(strncmp);
270EXPORT_SYMBOL(strchr);
271EXPORT_SYMBOL(strrchr);
272EXPORT_SYMBOL(strpbrk);
273EXPORT_SYMBOL(strstr);
274EXPORT_SYMBOL(page_kernel);
275
276/* Special internal versions of library functions. */
277EXPORT_SYMBOL(__copy_1page);
278EXPORT_SYMBOL(__memcpy);
279EXPORT_SYMBOL(__memset);
280EXPORT_SYMBOL(bzero_1page);
281EXPORT_SYMBOL(__bzero);
282EXPORT_SYMBOL(__memscan_zero);
283EXPORT_SYMBOL(__memscan_generic);
284EXPORT_SYMBOL(__memcmp);
285EXPORT_SYMBOL(__strncmp);
286EXPORT_SYMBOL(__memmove);
287
288/* Moving data to/from userspace. */
289EXPORT_SYMBOL(__copy_user);
290EXPORT_SYMBOL(__strncpy_from_user);
291
292/* Networking helper routines. */
293EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
294EXPORT_SYMBOL(csum_partial);
295
296/* Cache flushing. */
297EXPORT_SYMBOL(sparc_flush_page_to_ram);
298
299/* For when serial stuff is built as modules. */
300EXPORT_SYMBOL(sun_do_break);
301
302EXPORT_SYMBOL(__ret_efault);
303
304EXPORT_SYMBOL(memcmp);
305EXPORT_SYMBOL(memcpy);
306EXPORT_SYMBOL(memset);
307EXPORT_SYMBOL(memmove);
308EXPORT_SYMBOL(__ashrdi3);
309EXPORT_SYMBOL(__ashldi3);
310EXPORT_SYMBOL(__lshrdi3);
311EXPORT_SYMBOL(__muldi3);
312EXPORT_SYMBOL(__divdi3);
313
Al Viro7caaeab2005-09-11 20:14:07 -0700314EXPORT_SYMBOL(_Rem);
315EXPORT_SYMBOL(_Urem);
316EXPORT_SYMBOL(_Mul);
317EXPORT_SYMBOL(_Umul);
318EXPORT_SYMBOL(_Div);
319EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320
321#ifdef CONFIG_DEBUG_BUGVERBOSE
322EXPORT_SYMBOL(do_BUG);
323#endif
324
325/* Sun Power Management Idle Handler */
326EXPORT_SYMBOL(pm_idle);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700327
328/* Binfmt_misc needs this */
329EXPORT_SYMBOL(sys_close);