blob: 6007ac5a7360b899cb6629930a04caeb796db247 [file] [log] [blame]
Adrian Bunk88278ca2008-05-19 16:53:02 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#include <asm/head.h>
40#include <asm/smp.h>
41#include <asm/mostek.h>
42#include <asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#include <asm/uaccess.h>
44#include <asm/checksum.h>
45#ifdef CONFIG_SBUS
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#include <asm/dma.h>
47#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#include <asm/io-unit.h>
49#include <asm/bug.h>
50
51extern spinlock_t rtc_lock;
52
53struct poll {
54 int fd;
55 short events;
56 short revents;
57};
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059extern void (*__copy_1page)(void *, const void *);
60extern void __memmove(void *, const void *, __kernel_size_t);
61extern void (*bzero_1page)(void *);
62extern void *__bzero(void *, size_t);
63extern void *__memscan_zero(void *, size_t);
64extern void *__memscan_generic(void *, int, size_t);
65extern int __memcmp(const void *, const void *, __kernel_size_t);
66extern int __strncmp(const char *, const char *, __kernel_size_t);
67
68extern int __ashrdi3(int, int);
69extern int __ashldi3(int, int);
70extern int __lshrdi3(int, int);
71extern int __muldi3(int, int);
72extern int __divdi3(int, int);
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074/* Private functions with odd calling conventions. */
75extern void ___atomic24_add(void);
76extern void ___atomic24_sub(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070077extern void ___rw_read_enter(void);
Al Viro7a39f522006-10-08 14:32:15 +010078extern void ___rw_read_try(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070079extern void ___rw_read_exit(void);
80extern void ___rw_write_enter(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
82/* Alias functions whose names begin with "." and export the aliases.
83 * The module references will be fixed up by module_frob_arch_sections.
84 */
Al Viro7caaeab2005-09-11 20:14:07 -070085extern int _Div(int, int);
86extern int _Mul(int, int);
87extern int _Rem(int, int);
88extern unsigned _Udiv(unsigned, unsigned);
89extern unsigned _Umul(unsigned, unsigned);
90extern unsigned _Urem(unsigned, unsigned);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
92/* used by various drivers */
93EXPORT_SYMBOL(sparc_cpu_model);
94EXPORT_SYMBOL(kernel_thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -070095#ifdef CONFIG_SMP
Al Viro7a39f522006-10-08 14:32:15 +010096// XXX find what uses (or used) these. AV: see asm/spinlock.h
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070097EXPORT_SYMBOL(___rw_read_enter);
Al Viro7a39f522006-10-08 14:32:15 +010098EXPORT_SYMBOL(___rw_read_try);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070099EXPORT_SYMBOL(___rw_read_exit);
100EXPORT_SYMBOL(___rw_write_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
103EXPORT_SYMBOL(sparc_valid_addr_bitmap);
104EXPORT_SYMBOL(phys_base);
105EXPORT_SYMBOL(pfn_base);
106
107/* Atomic operations. */
108EXPORT_SYMBOL(___atomic24_add);
109EXPORT_SYMBOL(___atomic24_sub);
110
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700111/* Per-CPU information table */
112EXPORT_PER_CPU_SYMBOL(__cpu_data);
113
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114#ifdef CONFIG_SMP
115/* IRQ implementation. */
116EXPORT_SYMBOL(synchronize_irq);
117
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700118/* CPU online map and active count. */
119EXPORT_SYMBOL(cpu_online_map);
120EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121#endif
122
123EXPORT_SYMBOL(__udelay);
124EXPORT_SYMBOL(__ndelay);
125EXPORT_SYMBOL(rtc_lock);
126EXPORT_SYMBOL(mostek_lock);
127EXPORT_SYMBOL(mstk48t02_regs);
128#ifdef CONFIG_SUN_AUXIO
129EXPORT_SYMBOL(set_auxio);
130EXPORT_SYMBOL(get_auxio);
131#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132EXPORT_SYMBOL(io_remap_pfn_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
134#ifndef CONFIG_SMP
135EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
136#else
137EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
138#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
140EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
141EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
142EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
143EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
144EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
145
Al Viro86ac92e2007-07-22 00:38:24 -0700146EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached));
147
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148#ifdef CONFIG_SBUS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149EXPORT_SYMBOL(sbus_set_sbus64);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150#endif
151#ifdef CONFIG_PCI
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152EXPORT_SYMBOL(insb);
153EXPORT_SYMBOL(outsb);
154EXPORT_SYMBOL(insw);
155EXPORT_SYMBOL(outsw);
156EXPORT_SYMBOL(insl);
157EXPORT_SYMBOL(outsl);
158EXPORT_SYMBOL(pci_alloc_consistent);
159EXPORT_SYMBOL(pci_free_consistent);
160EXPORT_SYMBOL(pci_map_single);
161EXPORT_SYMBOL(pci_unmap_single);
162EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
163EXPORT_SYMBOL(pci_dma_sync_single_for_device);
164EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
165EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
166EXPORT_SYMBOL(pci_map_sg);
167EXPORT_SYMBOL(pci_unmap_sg);
168EXPORT_SYMBOL(pci_map_page);
169EXPORT_SYMBOL(pci_unmap_page);
170/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
171EXPORT_SYMBOL(ioremap);
172EXPORT_SYMBOL(iounmap);
173#endif
174
175/* in arch/sparc/mm/highmem.c */
176#ifdef CONFIG_HIGHMEM
177EXPORT_SYMBOL(kmap_atomic);
178EXPORT_SYMBOL(kunmap_atomic);
179#endif
180
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181/* prom symbols */
182EXPORT_SYMBOL(idprom);
183EXPORT_SYMBOL(prom_root_node);
184EXPORT_SYMBOL(prom_getchild);
185EXPORT_SYMBOL(prom_getsibling);
186EXPORT_SYMBOL(prom_searchsiblings);
187EXPORT_SYMBOL(prom_firstprop);
188EXPORT_SYMBOL(prom_nextprop);
189EXPORT_SYMBOL(prom_getproplen);
190EXPORT_SYMBOL(prom_getproperty);
191EXPORT_SYMBOL(prom_node_has_property);
192EXPORT_SYMBOL(prom_setprop);
193EXPORT_SYMBOL(saved_command_line);
194EXPORT_SYMBOL(prom_apply_obio_ranges);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195EXPORT_SYMBOL(prom_feval);
196EXPORT_SYMBOL(prom_getbool);
197EXPORT_SYMBOL(prom_getstring);
198EXPORT_SYMBOL(prom_getint);
199EXPORT_SYMBOL(prom_getintdefault);
200EXPORT_SYMBOL(prom_finddevice);
201EXPORT_SYMBOL(romvec);
202EXPORT_SYMBOL(__prom_getchild);
203EXPORT_SYMBOL(__prom_getsibling);
204
205/* sparc library symbols */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206EXPORT_SYMBOL(memscan);
207EXPORT_SYMBOL(strlen);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208EXPORT_SYMBOL(strncmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209EXPORT_SYMBOL(page_kernel);
210
211/* Special internal versions of library functions. */
212EXPORT_SYMBOL(__copy_1page);
213EXPORT_SYMBOL(__memcpy);
214EXPORT_SYMBOL(__memset);
215EXPORT_SYMBOL(bzero_1page);
216EXPORT_SYMBOL(__bzero);
217EXPORT_SYMBOL(__memscan_zero);
218EXPORT_SYMBOL(__memscan_generic);
219EXPORT_SYMBOL(__memcmp);
220EXPORT_SYMBOL(__strncmp);
221EXPORT_SYMBOL(__memmove);
222
223/* Moving data to/from userspace. */
224EXPORT_SYMBOL(__copy_user);
225EXPORT_SYMBOL(__strncpy_from_user);
Al Viro86ac92e2007-07-22 00:38:24 -0700226EXPORT_SYMBOL(__strnlen_user);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227
228/* Networking helper routines. */
229EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
230EXPORT_SYMBOL(csum_partial);
231
232/* Cache flushing. */
233EXPORT_SYMBOL(sparc_flush_page_to_ram);
234
235/* For when serial stuff is built as modules. */
236EXPORT_SYMBOL(sun_do_break);
237
238EXPORT_SYMBOL(__ret_efault);
239
240EXPORT_SYMBOL(memcmp);
241EXPORT_SYMBOL(memcpy);
242EXPORT_SYMBOL(memset);
243EXPORT_SYMBOL(memmove);
244EXPORT_SYMBOL(__ashrdi3);
245EXPORT_SYMBOL(__ashldi3);
246EXPORT_SYMBOL(__lshrdi3);
247EXPORT_SYMBOL(__muldi3);
248EXPORT_SYMBOL(__divdi3);
249
Al Viro7caaeab2005-09-11 20:14:07 -0700250EXPORT_SYMBOL(_Rem);
251EXPORT_SYMBOL(_Urem);
252EXPORT_SYMBOL(_Mul);
253EXPORT_SYMBOL(_Umul);
254EXPORT_SYMBOL(_Div);
255EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
257#ifdef CONFIG_DEBUG_BUGVERBOSE
258EXPORT_SYMBOL(do_BUG);
259#endif
260
261/* Sun Power Management Idle Handler */
262EXPORT_SYMBOL(pm_idle);
Aneesh Kumar K.V35802c02008-04-29 08:11:12 -0400263
264EXPORT_SYMBOL(empty_zero_page);