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