blob: ec1c9687d67920312df790ec0b550d3740c1c08c [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 *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069extern void (*__copy_1page)(void *, const void *);
70extern void __memmove(void *, const void *, __kernel_size_t);
71extern void (*bzero_1page)(void *);
72extern void *__bzero(void *, size_t);
73extern void *__memscan_zero(void *, size_t);
74extern void *__memscan_generic(void *, int, size_t);
75extern int __memcmp(const void *, const void *, __kernel_size_t);
76extern int __strncmp(const char *, const char *, __kernel_size_t);
77
78extern int __ashrdi3(int, int);
79extern int __ashldi3(int, int);
80extern int __lshrdi3(int, int);
81extern int __muldi3(int, int);
82extern int __divdi3(int, int);
83
Linus Torvalds1da177e2005-04-16 15:20:36 -070084/* Private functions with odd calling conventions. */
85extern void ___atomic24_add(void);
86extern void ___atomic24_sub(void);
87extern void ___set_bit(void);
88extern void ___clear_bit(void);
89extern void ___change_bit(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070090extern void ___rw_read_enter(void);
91extern 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
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108// XXX find what uses (or used) these.
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700109EXPORT_SYMBOL(___rw_read_enter);
110EXPORT_SYMBOL(___rw_read_exit);
111EXPORT_SYMBOL(___rw_write_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112#endif
113/* semaphores */
114EXPORT_SYMBOL(__up);
115EXPORT_SYMBOL(__down);
116EXPORT_SYMBOL(__down_trylock);
117EXPORT_SYMBOL(__down_interruptible);
118
119EXPORT_SYMBOL(sparc_valid_addr_bitmap);
120EXPORT_SYMBOL(phys_base);
121EXPORT_SYMBOL(pfn_base);
122
123/* Atomic operations. */
124EXPORT_SYMBOL(___atomic24_add);
125EXPORT_SYMBOL(___atomic24_sub);
126
127/* Bit operations. */
128EXPORT_SYMBOL(___set_bit);
129EXPORT_SYMBOL(___clear_bit);
130EXPORT_SYMBOL(___change_bit);
131
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700132/* Per-CPU information table */
133EXPORT_PER_CPU_SYMBOL(__cpu_data);
134
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135#ifdef CONFIG_SMP
136/* IRQ implementation. */
137EXPORT_SYMBOL(synchronize_irq);
138
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700139/* CPU online map and active count. */
140EXPORT_SYMBOL(cpu_online_map);
141EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142#endif
143
144EXPORT_SYMBOL(__udelay);
145EXPORT_SYMBOL(__ndelay);
146EXPORT_SYMBOL(rtc_lock);
147EXPORT_SYMBOL(mostek_lock);
148EXPORT_SYMBOL(mstk48t02_regs);
149#ifdef CONFIG_SUN_AUXIO
150EXPORT_SYMBOL(set_auxio);
151EXPORT_SYMBOL(get_auxio);
152#endif
153EXPORT_SYMBOL(request_fast_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154EXPORT_SYMBOL(io_remap_pfn_range);
155 /* P3: iounit_xxx may be needed, sun4d users */
156/* EXPORT_SYMBOL(iounit_map_dma_init); */
157/* EXPORT_SYMBOL(iounit_map_dma_page); */
158
159#ifndef CONFIG_SMP
160EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
161#else
162EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
163#endif
164EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
165EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
166EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa));
167EXPORT_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);
242EXPORT_SYMBOL(prom_getname);
243EXPORT_SYMBOL(prom_feval);
244EXPORT_SYMBOL(prom_getbool);
245EXPORT_SYMBOL(prom_getstring);
246EXPORT_SYMBOL(prom_getint);
247EXPORT_SYMBOL(prom_getintdefault);
248EXPORT_SYMBOL(prom_finddevice);
249EXPORT_SYMBOL(romvec);
250EXPORT_SYMBOL(__prom_getchild);
251EXPORT_SYMBOL(__prom_getsibling);
252
253/* sparc library symbols */
254EXPORT_SYMBOL(memchr);
255EXPORT_SYMBOL(memscan);
256EXPORT_SYMBOL(strlen);
257EXPORT_SYMBOL(strnlen);
258EXPORT_SYMBOL(strcpy);
259EXPORT_SYMBOL(strncpy);
260EXPORT_SYMBOL(strcat);
261EXPORT_SYMBOL(strncat);
262EXPORT_SYMBOL(strcmp);
263EXPORT_SYMBOL(strncmp);
264EXPORT_SYMBOL(strchr);
265EXPORT_SYMBOL(strrchr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266EXPORT_SYMBOL(strstr);
267EXPORT_SYMBOL(page_kernel);
268
269/* Special internal versions of library functions. */
270EXPORT_SYMBOL(__copy_1page);
271EXPORT_SYMBOL(__memcpy);
272EXPORT_SYMBOL(__memset);
273EXPORT_SYMBOL(bzero_1page);
274EXPORT_SYMBOL(__bzero);
275EXPORT_SYMBOL(__memscan_zero);
276EXPORT_SYMBOL(__memscan_generic);
277EXPORT_SYMBOL(__memcmp);
278EXPORT_SYMBOL(__strncmp);
279EXPORT_SYMBOL(__memmove);
280
281/* Moving data to/from userspace. */
282EXPORT_SYMBOL(__copy_user);
283EXPORT_SYMBOL(__strncpy_from_user);
284
285/* Networking helper routines. */
286EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
287EXPORT_SYMBOL(csum_partial);
288
289/* Cache flushing. */
290EXPORT_SYMBOL(sparc_flush_page_to_ram);
291
292/* For when serial stuff is built as modules. */
293EXPORT_SYMBOL(sun_do_break);
294
295EXPORT_SYMBOL(__ret_efault);
296
297EXPORT_SYMBOL(memcmp);
298EXPORT_SYMBOL(memcpy);
299EXPORT_SYMBOL(memset);
300EXPORT_SYMBOL(memmove);
301EXPORT_SYMBOL(__ashrdi3);
302EXPORT_SYMBOL(__ashldi3);
303EXPORT_SYMBOL(__lshrdi3);
304EXPORT_SYMBOL(__muldi3);
305EXPORT_SYMBOL(__divdi3);
306
Al Viro7caaeab2005-09-11 20:14:07 -0700307EXPORT_SYMBOL(_Rem);
308EXPORT_SYMBOL(_Urem);
309EXPORT_SYMBOL(_Mul);
310EXPORT_SYMBOL(_Umul);
311EXPORT_SYMBOL(_Div);
312EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
314#ifdef CONFIG_DEBUG_BUGVERBOSE
315EXPORT_SYMBOL(do_BUG);
316#endif
317
318/* Sun Power Management Idle Handler */
319EXPORT_SYMBOL(pm_idle);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -0700320
321/* Binfmt_misc needs this */
322EXPORT_SYMBOL(sys_close);