1 /* 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/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> 22 #include <linux/syscalls.h> 23 #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> 39 #include <asm/head.h> 40 #include <asm/smp.h> 41 #include <asm/mostek.h> 42 #include <asm/ptrace.h> 43 #include <asm/uaccess.h> 44 #include <asm/checksum.h> 45 #ifdef CONFIG_SBUS 46 #include <asm/sbus.h> 47 #include <asm/dma.h> 48 #endif 49 #ifdef CONFIG_PCI 50 #include <asm/ebus.h> 51 #endif 52 #include <asm/io-unit.h> 53 #include <asm/bug.h> 54 55 extern spinlock_t rtc_lock; 56 57 struct poll { 58 int fd; 59 short events; 60 short revents; 61 }; 62 63 extern void (*__copy_1page)(void *, const void *); 64 extern void __memmove(void *, const void *, __kernel_size_t); 65 extern void (*bzero_1page)(void *); 66 extern void *__bzero(void *, size_t); 67 extern void *__memscan_zero(void *, size_t); 68 extern void *__memscan_generic(void *, int, size_t); 69 extern int __memcmp(const void *, const void *, __kernel_size_t); 70 extern int __strncmp(const char *, const char *, __kernel_size_t); 71 72 extern int __ashrdi3(int, int); 73 extern int __ashldi3(int, int); 74 extern int __lshrdi3(int, int); 75 extern int __muldi3(int, int); 76 extern int __divdi3(int, int); 77 78 /* Private functions with odd calling conventions. */ 79 extern void ___atomic24_add(void); 80 extern void ___atomic24_sub(void); 81 extern void ___rw_read_enter(void); 82 extern void ___rw_read_try(void); 83 extern void ___rw_read_exit(void); 84 extern void ___rw_write_enter(void); 85 86 /* Alias functions whose names begin with "." and export the aliases. 87 * The module references will be fixed up by module_frob_arch_sections. 88 */ 89 extern int _Div(int, int); 90 extern int _Mul(int, int); 91 extern int _Rem(int, int); 92 extern unsigned _Udiv(unsigned, unsigned); 93 extern unsigned _Umul(unsigned, unsigned); 94 extern unsigned _Urem(unsigned, unsigned); 95 96 /* used by various drivers */ 97 EXPORT_SYMBOL(sparc_cpu_model); 98 EXPORT_SYMBOL(kernel_thread); 99 #ifdef CONFIG_SMP 100 // XXX find what uses (or used) these. AV: see asm/spinlock.h 101 EXPORT_SYMBOL(___rw_read_enter); 102 EXPORT_SYMBOL(___rw_read_try); 103 EXPORT_SYMBOL(___rw_read_exit); 104 EXPORT_SYMBOL(___rw_write_enter); 105 #endif 106 107 EXPORT_SYMBOL(sparc_valid_addr_bitmap); 108 EXPORT_SYMBOL(phys_base); 109 EXPORT_SYMBOL(pfn_base); 110 111 /* Atomic operations. */ 112 EXPORT_SYMBOL(___atomic24_add); 113 EXPORT_SYMBOL(___atomic24_sub); 114 115 /* Per-CPU information table */ 116 EXPORT_PER_CPU_SYMBOL(__cpu_data); 117 118 #ifdef CONFIG_SMP 119 /* IRQ implementation. */ 120 EXPORT_SYMBOL(synchronize_irq); 121 122 /* CPU online map and active count. */ 123 EXPORT_SYMBOL(cpu_online_map); 124 EXPORT_SYMBOL(phys_cpu_present_map); 125 #endif 126 127 EXPORT_SYMBOL(__udelay); 128 EXPORT_SYMBOL(__ndelay); 129 EXPORT_SYMBOL(rtc_lock); 130 EXPORT_SYMBOL(mostek_lock); 131 EXPORT_SYMBOL(mstk48t02_regs); 132 #ifdef CONFIG_SUN_AUXIO 133 EXPORT_SYMBOL(set_auxio); 134 EXPORT_SYMBOL(get_auxio); 135 #endif 136 EXPORT_SYMBOL(io_remap_pfn_range); 137 /* P3: iounit_xxx may be needed, sun4d users */ 138 /* EXPORT_SYMBOL(iounit_map_dma_init); */ 139 /* EXPORT_SYMBOL(iounit_map_dma_page); */ 140 141 #ifndef CONFIG_SMP 142 EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); 143 #else 144 EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); 145 #endif 146 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); 147 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea)); 148 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); 149 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); 150 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); 151 EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); 152 153 EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached)); 154 155 #ifdef CONFIG_SBUS 156 EXPORT_SYMBOL(sbus_root); 157 EXPORT_SYMBOL(dma_chain); 158 EXPORT_SYMBOL(sbus_set_sbus64); 159 EXPORT_SYMBOL(sbus_alloc_consistent); 160 EXPORT_SYMBOL(sbus_free_consistent); 161 EXPORT_SYMBOL(sbus_map_single); 162 EXPORT_SYMBOL(sbus_unmap_single); 163 EXPORT_SYMBOL(sbus_map_sg); 164 EXPORT_SYMBOL(sbus_unmap_sg); 165 EXPORT_SYMBOL(sbus_dma_sync_single_for_cpu); 166 EXPORT_SYMBOL(sbus_dma_sync_single_for_device); 167 EXPORT_SYMBOL(sbus_dma_sync_sg_for_cpu); 168 EXPORT_SYMBOL(sbus_dma_sync_sg_for_device); 169 EXPORT_SYMBOL(sbus_iounmap); 170 EXPORT_SYMBOL(sbus_ioremap); 171 #endif 172 #ifdef CONFIG_PCI 173 EXPORT_SYMBOL(ebus_chain); 174 EXPORT_SYMBOL(insb); 175 EXPORT_SYMBOL(outsb); 176 EXPORT_SYMBOL(insw); 177 EXPORT_SYMBOL(outsw); 178 EXPORT_SYMBOL(insl); 179 EXPORT_SYMBOL(outsl); 180 EXPORT_SYMBOL(pci_alloc_consistent); 181 EXPORT_SYMBOL(pci_free_consistent); 182 EXPORT_SYMBOL(pci_map_single); 183 EXPORT_SYMBOL(pci_unmap_single); 184 EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); 185 EXPORT_SYMBOL(pci_dma_sync_single_for_device); 186 EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); 187 EXPORT_SYMBOL(pci_dma_sync_sg_for_device); 188 EXPORT_SYMBOL(pci_map_sg); 189 EXPORT_SYMBOL(pci_unmap_sg); 190 EXPORT_SYMBOL(pci_map_page); 191 EXPORT_SYMBOL(pci_unmap_page); 192 /* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */ 193 EXPORT_SYMBOL(ioremap); 194 EXPORT_SYMBOL(iounmap); 195 #endif 196 197 /* in arch/sparc/mm/highmem.c */ 198 #ifdef CONFIG_HIGHMEM 199 EXPORT_SYMBOL(kmap_atomic); 200 EXPORT_SYMBOL(kunmap_atomic); 201 #endif 202 203 /* prom symbols */ 204 EXPORT_SYMBOL(idprom); 205 EXPORT_SYMBOL(prom_root_node); 206 EXPORT_SYMBOL(prom_getchild); 207 EXPORT_SYMBOL(prom_getsibling); 208 EXPORT_SYMBOL(prom_searchsiblings); 209 EXPORT_SYMBOL(prom_firstprop); 210 EXPORT_SYMBOL(prom_nextprop); 211 EXPORT_SYMBOL(prom_getproplen); 212 EXPORT_SYMBOL(prom_getproperty); 213 EXPORT_SYMBOL(prom_node_has_property); 214 EXPORT_SYMBOL(prom_setprop); 215 EXPORT_SYMBOL(saved_command_line); 216 EXPORT_SYMBOL(prom_apply_obio_ranges); 217 EXPORT_SYMBOL(prom_feval); 218 EXPORT_SYMBOL(prom_getbool); 219 EXPORT_SYMBOL(prom_getstring); 220 EXPORT_SYMBOL(prom_getint); 221 EXPORT_SYMBOL(prom_getintdefault); 222 EXPORT_SYMBOL(prom_finddevice); 223 EXPORT_SYMBOL(romvec); 224 EXPORT_SYMBOL(__prom_getchild); 225 EXPORT_SYMBOL(__prom_getsibling); 226 227 /* sparc library symbols */ 228 EXPORT_SYMBOL(memscan); 229 EXPORT_SYMBOL(strlen); 230 EXPORT_SYMBOL(strncmp); 231 EXPORT_SYMBOL(page_kernel); 232 233 /* Special internal versions of library functions. */ 234 EXPORT_SYMBOL(__copy_1page); 235 EXPORT_SYMBOL(__memcpy); 236 EXPORT_SYMBOL(__memset); 237 EXPORT_SYMBOL(bzero_1page); 238 EXPORT_SYMBOL(__bzero); 239 EXPORT_SYMBOL(__memscan_zero); 240 EXPORT_SYMBOL(__memscan_generic); 241 EXPORT_SYMBOL(__memcmp); 242 EXPORT_SYMBOL(__strncmp); 243 EXPORT_SYMBOL(__memmove); 244 245 /* Moving data to/from userspace. */ 246 EXPORT_SYMBOL(__copy_user); 247 EXPORT_SYMBOL(__strncpy_from_user); 248 EXPORT_SYMBOL(__strnlen_user); 249 250 /* Networking helper routines. */ 251 EXPORT_SYMBOL(__csum_partial_copy_sparc_generic); 252 EXPORT_SYMBOL(csum_partial); 253 254 /* Cache flushing. */ 255 EXPORT_SYMBOL(sparc_flush_page_to_ram); 256 257 /* For when serial stuff is built as modules. */ 258 EXPORT_SYMBOL(sun_do_break); 259 260 EXPORT_SYMBOL(__ret_efault); 261 262 EXPORT_SYMBOL(memcmp); 263 EXPORT_SYMBOL(memcpy); 264 EXPORT_SYMBOL(memset); 265 EXPORT_SYMBOL(memmove); 266 EXPORT_SYMBOL(__ashrdi3); 267 EXPORT_SYMBOL(__ashldi3); 268 EXPORT_SYMBOL(__lshrdi3); 269 EXPORT_SYMBOL(__muldi3); 270 EXPORT_SYMBOL(__divdi3); 271 272 EXPORT_SYMBOL(_Rem); 273 EXPORT_SYMBOL(_Urem); 274 EXPORT_SYMBOL(_Mul); 275 EXPORT_SYMBOL(_Umul); 276 EXPORT_SYMBOL(_Div); 277 EXPORT_SYMBOL(_Udiv); 278 279 #ifdef CONFIG_DEBUG_BUGVERBOSE 280 EXPORT_SYMBOL(do_BUG); 281 #endif 282 283 /* Sun Power Management Idle Handler */ 284 EXPORT_SYMBOL(pm_idle); 285 286 EXPORT_SYMBOL(empty_zero_page); 287