blob: b0dfff84865365a595e39283e480b1ccbd9eb850 [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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#include <asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#include <asm/uaccess.h>
43#include <asm/checksum.h>
44#ifdef CONFIG_SBUS
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#include <asm/dma.h>
46#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#include <asm/io-unit.h>
48#include <asm/bug.h>
49
50extern spinlock_t rtc_lock;
51
52struct poll {
53 int fd;
54 short events;
55 short revents;
56};
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058extern void (*__copy_1page)(void *, const void *);
59extern void __memmove(void *, const void *, __kernel_size_t);
60extern void (*bzero_1page)(void *);
61extern void *__bzero(void *, size_t);
62extern void *__memscan_zero(void *, size_t);
63extern void *__memscan_generic(void *, int, size_t);
64extern int __memcmp(const void *, const void *, __kernel_size_t);
65extern int __strncmp(const char *, const char *, __kernel_size_t);
66
67extern int __ashrdi3(int, int);
68extern int __ashldi3(int, int);
69extern int __lshrdi3(int, int);
70extern int __muldi3(int, int);
71extern int __divdi3(int, int);
72
Linus Torvalds1da177e2005-04-16 15:20:36 -070073/* Private functions with odd calling conventions. */
74extern void ___atomic24_add(void);
75extern void ___atomic24_sub(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070076extern void ___rw_read_enter(void);
Al Viro7a39f522006-10-08 14:32:15 +010077extern void ___rw_read_try(void);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070078extern void ___rw_read_exit(void);
79extern void ___rw_write_enter(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
81/* Alias functions whose names begin with "." and export the aliases.
82 * The module references will be fixed up by module_frob_arch_sections.
83 */
Al Viro7caaeab2005-09-11 20:14:07 -070084extern int _Div(int, int);
85extern int _Mul(int, int);
86extern int _Rem(int, int);
87extern unsigned _Udiv(unsigned, unsigned);
88extern unsigned _Umul(unsigned, unsigned);
89extern unsigned _Urem(unsigned, unsigned);
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
91/* used by various drivers */
92EXPORT_SYMBOL(sparc_cpu_model);
93EXPORT_SYMBOL(kernel_thread);
Linus Torvalds1da177e2005-04-16 15:20:36 -070094#ifdef CONFIG_SMP
Al Viro7a39f522006-10-08 14:32:15 +010095// XXX find what uses (or used) these. AV: see asm/spinlock.h
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070096EXPORT_SYMBOL(___rw_read_enter);
Al Viro7a39f522006-10-08 14:32:15 +010097EXPORT_SYMBOL(___rw_read_try);
Tom 'spot' Callaway77a6a222005-04-24 20:41:45 -070098EXPORT_SYMBOL(___rw_read_exit);
99EXPORT_SYMBOL(___rw_write_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102EXPORT_SYMBOL(sparc_valid_addr_bitmap);
103EXPORT_SYMBOL(phys_base);
104EXPORT_SYMBOL(pfn_base);
105
106/* Atomic operations. */
107EXPORT_SYMBOL(___atomic24_add);
108EXPORT_SYMBOL(___atomic24_sub);
109
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700110/* Per-CPU information table */
111EXPORT_PER_CPU_SYMBOL(__cpu_data);
112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113#ifdef CONFIG_SMP
114/* IRQ implementation. */
115EXPORT_SYMBOL(synchronize_irq);
116
Tom 'spot' Callaway962bd562005-04-24 20:45:06 -0700117/* CPU online map and active count. */
118EXPORT_SYMBOL(cpu_online_map);
119EXPORT_SYMBOL(phys_cpu_present_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120#endif
121
122EXPORT_SYMBOL(__udelay);
123EXPORT_SYMBOL(__ndelay);
124EXPORT_SYMBOL(rtc_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125#ifdef CONFIG_SUN_AUXIO
126EXPORT_SYMBOL(set_auxio);
127EXPORT_SYMBOL(get_auxio);
128#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129EXPORT_SYMBOL(io_remap_pfn_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130
131#ifndef CONFIG_SMP
132EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
133#else
134EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
135#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
137EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
138EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
139EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
140EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
141EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
142
Al Viro86ac92e2007-07-22 00:38:24 -0700143EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached));
144
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145#ifdef CONFIG_SBUS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146EXPORT_SYMBOL(sbus_set_sbus64);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147#endif
148#ifdef CONFIG_PCI
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149EXPORT_SYMBOL(insb);
150EXPORT_SYMBOL(outsb);
151EXPORT_SYMBOL(insw);
152EXPORT_SYMBOL(outsw);
153EXPORT_SYMBOL(insl);
154EXPORT_SYMBOL(outsl);
155EXPORT_SYMBOL(pci_alloc_consistent);
156EXPORT_SYMBOL(pci_free_consistent);
157EXPORT_SYMBOL(pci_map_single);
158EXPORT_SYMBOL(pci_unmap_single);
159EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
160EXPORT_SYMBOL(pci_dma_sync_single_for_device);
161EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
162EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
163EXPORT_SYMBOL(pci_map_sg);
164EXPORT_SYMBOL(pci_unmap_sg);
165EXPORT_SYMBOL(pci_map_page);
166EXPORT_SYMBOL(pci_unmap_page);
167/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
168EXPORT_SYMBOL(ioremap);
169EXPORT_SYMBOL(iounmap);
170#endif
171
172/* in arch/sparc/mm/highmem.c */
173#ifdef CONFIG_HIGHMEM
174EXPORT_SYMBOL(kmap_atomic);
175EXPORT_SYMBOL(kunmap_atomic);
176#endif
177
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178/* prom symbols */
179EXPORT_SYMBOL(idprom);
180EXPORT_SYMBOL(prom_root_node);
181EXPORT_SYMBOL(prom_getchild);
182EXPORT_SYMBOL(prom_getsibling);
183EXPORT_SYMBOL(prom_searchsiblings);
184EXPORT_SYMBOL(prom_firstprop);
185EXPORT_SYMBOL(prom_nextprop);
186EXPORT_SYMBOL(prom_getproplen);
187EXPORT_SYMBOL(prom_getproperty);
188EXPORT_SYMBOL(prom_node_has_property);
189EXPORT_SYMBOL(prom_setprop);
190EXPORT_SYMBOL(saved_command_line);
191EXPORT_SYMBOL(prom_apply_obio_ranges);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192EXPORT_SYMBOL(prom_feval);
193EXPORT_SYMBOL(prom_getbool);
194EXPORT_SYMBOL(prom_getstring);
195EXPORT_SYMBOL(prom_getint);
196EXPORT_SYMBOL(prom_getintdefault);
197EXPORT_SYMBOL(prom_finddevice);
198EXPORT_SYMBOL(romvec);
199EXPORT_SYMBOL(__prom_getchild);
200EXPORT_SYMBOL(__prom_getsibling);
201
202/* sparc library symbols */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203EXPORT_SYMBOL(memscan);
204EXPORT_SYMBOL(strlen);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205EXPORT_SYMBOL(strncmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206EXPORT_SYMBOL(page_kernel);
207
208/* Special internal versions of library functions. */
209EXPORT_SYMBOL(__copy_1page);
210EXPORT_SYMBOL(__memcpy);
211EXPORT_SYMBOL(__memset);
212EXPORT_SYMBOL(bzero_1page);
213EXPORT_SYMBOL(__bzero);
214EXPORT_SYMBOL(__memscan_zero);
215EXPORT_SYMBOL(__memscan_generic);
216EXPORT_SYMBOL(__memcmp);
217EXPORT_SYMBOL(__strncmp);
218EXPORT_SYMBOL(__memmove);
219
220/* Moving data to/from userspace. */
221EXPORT_SYMBOL(__copy_user);
222EXPORT_SYMBOL(__strncpy_from_user);
Al Viro86ac92e2007-07-22 00:38:24 -0700223EXPORT_SYMBOL(__strnlen_user);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
225/* Networking helper routines. */
226EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
227EXPORT_SYMBOL(csum_partial);
228
229/* Cache flushing. */
230EXPORT_SYMBOL(sparc_flush_page_to_ram);
231
232/* For when serial stuff is built as modules. */
233EXPORT_SYMBOL(sun_do_break);
234
235EXPORT_SYMBOL(__ret_efault);
236
237EXPORT_SYMBOL(memcmp);
238EXPORT_SYMBOL(memcpy);
239EXPORT_SYMBOL(memset);
240EXPORT_SYMBOL(memmove);
241EXPORT_SYMBOL(__ashrdi3);
242EXPORT_SYMBOL(__ashldi3);
243EXPORT_SYMBOL(__lshrdi3);
244EXPORT_SYMBOL(__muldi3);
245EXPORT_SYMBOL(__divdi3);
246
Al Viro7caaeab2005-09-11 20:14:07 -0700247EXPORT_SYMBOL(_Rem);
248EXPORT_SYMBOL(_Urem);
249EXPORT_SYMBOL(_Mul);
250EXPORT_SYMBOL(_Umul);
251EXPORT_SYMBOL(_Div);
252EXPORT_SYMBOL(_Udiv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253
254#ifdef CONFIG_DEBUG_BUGVERBOSE
255EXPORT_SYMBOL(do_BUG);
256#endif
257
258/* Sun Power Management Idle Handler */
259EXPORT_SYMBOL(pm_idle);
Aneesh Kumar K.V35802c02008-04-29 08:11:12 -0400260
261EXPORT_SYMBOL(empty_zero_page);