Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc64: move EXPORT_SYMBOL to the symbols definition

Move all applicable EXPORT_SYMBOL()s to the file where the respective
symbol is defined.

Removed all the includes that are no longer needed in sparc_ksyms_64.c

Comment all remaining EXPORT_SYMBOL()s in sparc_ksyms_64.c

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Additions by Julian Calaby:
* Moved EXPORT_SYMBOL()s for prom functions to their rightful places.
* Made some minor cleanups to the includes and comments of sparc_ksyms_64.c
* Updated and tidied commit message.
* Rebased patch over sparc-2.6.git HEAD.
* Ensured that all modified files have the correct includes.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sam Ravnborg and committed by
David S. Miller
917c3660 6943f3da

+66 -126
+2
arch/sparc/kernel/auxio_64.c
··· 72 72 bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED); 73 73 __auxio_set_bit(bit, on, ebus); 74 74 } 75 + EXPORT_SYMBOL(auxio_set_led); 75 76 76 77 static void __auxio_sbus_set_lte(int on) 77 78 { ··· 91 90 break; 92 91 } 93 92 } 93 + EXPORT_SYMBOL(auxio_set_lte); 94 94 95 95 static struct of_device_id __initdata auxio_match[] = { 96 96 {
+1
arch/sparc/kernel/pci.c
··· 1077 1077 1078 1078 return (device_mask & dma_addr_mask) == dma_addr_mask; 1079 1079 } 1080 + EXPORT_SYMBOL(pci_dma_supported); 1080 1081 1081 1082 void pci_resource_to_user(const struct pci_dev *pdev, int bar, 1082 1083 const struct resource *rp, resource_size_t *start,
+2
arch/sparc/kernel/process_64.c
··· 678 678 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 679 679 return retval; 680 680 } 681 + EXPORT_SYMBOL(kernel_thread); 681 682 682 683 typedef struct { 683 684 union { ··· 744 743 } 745 744 return 1; 746 745 } 746 + EXPORT_SYMBOL(dump_fpu); 747 747 748 748 /* 749 749 * sparc_execve() executes a new program after the asm stub has set
+1
arch/sparc/kernel/sbus.c
··· 117 117 val |= (1UL << 4UL); 118 118 upa_writeq(val, cfg_reg); 119 119 } 120 + EXPORT_SYMBOL(sbus_set_sbus64); 120 121 121 122 /* INO number to IMAP register offset for SYSIO external IRQ's. 122 123 * This should conform to both Sunfire/Wildfire server and Fusion
+3
arch/sparc/kernel/setup_64.c
··· 58 58 * operations in asm/ns87303.h 59 59 */ 60 60 DEFINE_SPINLOCK(ns87303_lock); 61 + EXPORT_SYMBOL(ns87303_lock); 61 62 62 63 struct screen_info screen_info = { 63 64 0, 0, /* orig-x, orig-y */ ··· 426 425 427 426 prom_cmdline(); 428 427 } 428 + EXPORT_SYMBOL(sun_do_break); 429 429 430 430 int stop_a_enabled = 1; 431 + EXPORT_SYMBOL(stop_a_enabled);
+12 -124
arch/sparc/kernel/sparc_ksyms_64.c
··· 8 8 #define PROMLIB_INTERNAL 9 9 10 10 #include <linux/module.h> 11 - #include <linux/types.h> 12 - #include <linux/sched.h> 13 - #include <linux/in6.h> 14 11 #include <linux/pci.h> 15 - #include <linux/interrupt.h> 16 - #include <linux/fs_struct.h> 17 - #include <linux/fs.h> 18 - #include <linux/mm.h> 19 - #include <linux/socket.h> 20 - #include <linux/syscalls.h> 21 - #include <linux/percpu.h> 22 12 #include <linux/init.h> 23 - #include <linux/rwsem.h> 24 - #include <net/compat.h> 25 13 26 - #include <asm/oplib.h> 14 + #include <asm/spinlock.h> 27 15 #include <asm/system.h> 28 - #include <asm/auxio.h> 29 - #include <asm/pgtable.h> 30 - #include <asm/io.h> 31 - #include <asm/irq.h> 32 - #include <asm/elf.h> 33 - #include <asm/head.h> 34 - #include <asm/smp.h> 35 - #include <asm/ptrace.h> 36 - #include <asm/uaccess.h> 37 - #include <asm/checksum.h> 38 - #include <asm/fpumacro.h> 39 - #include <asm/pgalloc.h> 40 - #include <asm/cacheflush.h> 41 - #ifdef CONFIG_SBUS 42 - #include <asm/dma.h> 43 - #endif 44 - #include <asm/ns87303.h> 45 - #include <asm/timer.h> 46 16 #include <asm/cpudata.h> 47 - #include <asm/ftrace.h> 17 + #include <asm/uaccess.h> 18 + #include <asm/spitfire.h> 19 + #include <asm/oplib.h> 48 20 #include <asm/hypervisor.h> 49 21 50 22 struct poll { ··· 24 52 short events; 25 53 short revents; 26 54 }; 27 - 28 - extern void die_if_kernel(char *str, struct pt_regs *regs); 29 - extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 30 - extern void sys_sigsuspend(void); 31 - extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); 32 - extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); 33 - extern long sparc32_open(const char __user * filename, int flags, int mode); 34 - extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 35 - unsigned long pfn, unsigned long size, pgprot_t prot); 36 - 37 - extern int __ashrdi3(int, int); 38 - 39 - extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs); 40 55 41 56 /* used by various drivers */ 42 57 #ifdef CONFIG_SMP ··· 35 76 EXPORT_SYMBOL(__write_trylock); 36 77 #endif /* CONFIG_SMP */ 37 78 38 - EXPORT_SYMBOL(sparc64_get_clock_tick); 39 - 79 + /* from helpers.S */ 40 80 EXPORT_SYMBOL(__flushw_user); 81 + EXPORT_SYMBOL_GPL(real_hard_smp_processor_id); 41 82 83 + /* from head_64.S */ 84 + EXPORT_SYMBOL(__ret_efault); 42 85 EXPORT_SYMBOL(tlb_type); 43 86 EXPORT_SYMBOL(sun4v_chip_type); 44 - EXPORT_SYMBOL(get_fb_unmapped_area); 45 - EXPORT_SYMBOL(flush_icache_range); 87 + EXPORT_SYMBOL(prom_root_node); 46 88 47 - EXPORT_SYMBOL(flush_dcache_page); 48 - #ifdef DCACHE_ALIASING_POSSIBLE 49 - EXPORT_SYMBOL(__flush_dcache_range); 50 - #endif 51 - 89 + /* from hvcalls.S */ 52 90 EXPORT_SYMBOL(sun4v_niagara_getperf); 53 91 EXPORT_SYMBOL(sun4v_niagara_setperf); 54 92 EXPORT_SYMBOL(sun4v_niagara2_getperf); 55 93 EXPORT_SYMBOL(sun4v_niagara2_setperf); 56 94 57 - EXPORT_SYMBOL(auxio_set_led); 58 - EXPORT_SYMBOL(auxio_set_lte); 59 - #ifdef CONFIG_SBUS 60 - EXPORT_SYMBOL(sbus_set_sbus64); 61 - #endif 62 - EXPORT_SYMBOL(outsb); 63 - EXPORT_SYMBOL(outsw); 64 - EXPORT_SYMBOL(outsl); 65 - EXPORT_SYMBOL(insb); 66 - EXPORT_SYMBOL(insw); 67 - EXPORT_SYMBOL(insl); 68 95 #ifdef CONFIG_PCI 96 + /* inline functions in asm/pci_64.h */ 69 97 EXPORT_SYMBOL(pci_alloc_consistent); 70 98 EXPORT_SYMBOL(pci_free_consistent); 71 99 EXPORT_SYMBOL(pci_map_single); ··· 61 115 EXPORT_SYMBOL(pci_unmap_sg); 62 116 EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); 63 117 EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); 64 - EXPORT_SYMBOL(pci_dma_supported); 65 118 #endif 66 119 67 - /* I/O device mmaping on Sparc64. */ 68 - EXPORT_SYMBOL(io_remap_pfn_range); 69 - 70 - EXPORT_SYMBOL(dump_fpu); 71 - 72 - /* math-emu wants this */ 73 - EXPORT_SYMBOL(die_if_kernel); 74 - 75 - /* Kernel thread creation. */ 76 - EXPORT_SYMBOL(kernel_thread); 77 - 78 - /* prom symbols */ 79 - EXPORT_SYMBOL(prom_root_node); 80 - EXPORT_SYMBOL(prom_getchild); 81 - EXPORT_SYMBOL(prom_getsibling); 82 - EXPORT_SYMBOL(prom_searchsiblings); 83 - EXPORT_SYMBOL(prom_firstprop); 84 - EXPORT_SYMBOL(prom_nextprop); 85 - EXPORT_SYMBOL(prom_getproplen); 86 - EXPORT_SYMBOL(prom_getproperty); 87 - EXPORT_SYMBOL(prom_node_has_property); 88 - EXPORT_SYMBOL(prom_setprop); 120 + /* Exporting a symbol from /init/main.c */ 89 121 EXPORT_SYMBOL(saved_command_line); 90 - EXPORT_SYMBOL(prom_finddevice); 91 - EXPORT_SYMBOL(prom_feval); 92 - EXPORT_SYMBOL(prom_getbool); 93 - EXPORT_SYMBOL(prom_getstring); 94 - EXPORT_SYMBOL(prom_getint); 95 - EXPORT_SYMBOL(prom_getintdefault); 96 - EXPORT_SYMBOL(__prom_getchild); 97 - EXPORT_SYMBOL(__prom_getsibling); 98 - 99 - /* Moving data to/from/in userspace. */ 100 - EXPORT_SYMBOL(copy_to_user_fixup); 101 - EXPORT_SYMBOL(copy_from_user_fixup); 102 - EXPORT_SYMBOL(copy_in_user_fixup); 103 - 104 - /* Various address conversion macros use this. */ 105 - EXPORT_SYMBOL(sparc64_valid_addr_bitmap); 106 - 107 - /* No version information on this, heavily used in inline asm, 108 - * and will always be 'void __ret_efault(void)'. 109 - */ 110 - EXPORT_SYMBOL(__ret_efault); 111 - 112 - /* for input/keybdev */ 113 - EXPORT_SYMBOL(sun_do_break); 114 - EXPORT_SYMBOL(stop_a_enabled); 115 - 116 - #ifdef CONFIG_DEBUG_BUGVERBOSE 117 - EXPORT_SYMBOL(do_BUG); 118 - #endif 119 - 120 - /* for ns8703 */ 121 - EXPORT_SYMBOL(ns87303_lock); 122 - 123 - EXPORT_SYMBOL(tick_ops); 124 - 125 - EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
+2
arch/sparc/kernel/sys_sparc_64.c
··· 23 23 #include <linux/ipc.h> 24 24 #include <linux/personality.h> 25 25 #include <linux/random.h> 26 + #include <linux/module.h> 26 27 27 28 #include <asm/uaccess.h> 28 29 #include <asm/utrap.h> ··· 355 354 356 355 return addr; 357 356 } 357 + EXPORT_SYMBOL(get_fb_unmapped_area); 358 358 359 359 /* Essentially the same as PowerPC... */ 360 360 void arch_pick_mmap_layout(struct mm_struct *mm)
+2
arch/sparc/kernel/time_64.c
··· 176 176 }; 177 177 178 178 struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; 179 + EXPORT_SYMBOL(tick_ops); 179 180 180 181 static void stick_disable_irq(void) 181 182 { ··· 640 639 return ft->clock_tick_ref; 641 640 return cpu_data(cpu).clock_tick; 642 641 } 642 + EXPORT_SYMBOL(sparc64_get_clock_tick); 643 643 644 644 #ifdef CONFIG_CPU_FREQ 645 645
+2
arch/sparc/kernel/traps_64.c
··· 128 128 bust_spinlocks(1); 129 129 printk("kernel BUG at %s:%d!\n", file, line); 130 130 } 131 + EXPORT_SYMBOL(do_BUG); 131 132 #endif 132 133 133 134 static DEFINE_SPINLOCK(dimm_handler_lock); ··· 2262 2261 do_exit(SIGKILL); 2263 2262 do_exit(SIGSEGV); 2264 2263 } 2264 + EXPORT_SYMBOL(die_if_kernel); 2265 2265 2266 2266 #define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) 2267 2267 #define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19))
+8
arch/sparc/lib/PeeCeeI.c
··· 4 4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 5 5 */ 6 6 7 + #include <linux/module.h> 8 + 7 9 #include <asm/io.h> 8 10 #include <asm/byteorder.h> 9 11 ··· 17 15 while (count--) 18 16 outb(*p++, addr); 19 17 } 18 + EXPORT_SYMBOL(outsb); 20 19 21 20 void outsw(unsigned long __addr, const void *src, unsigned long count) 22 21 { ··· 28 25 src += sizeof(u16); 29 26 } 30 27 } 28 + EXPORT_SYMBOL(outsw); 31 29 32 30 void outsl(unsigned long __addr, const void *src, unsigned long count) 33 31 { ··· 82 78 break; 83 79 } 84 80 } 81 + EXPORT_SYMBOL(outsl); 85 82 86 83 void insb(unsigned long __addr, void *dst, unsigned long count) 87 84 { ··· 110 105 *pb++ = inb(addr); 111 106 } 112 107 } 108 + EXPORT_SYMBOL(insb); 113 109 114 110 void insw(unsigned long __addr, void *dst, unsigned long count) 115 111 { ··· 138 132 *ps = le16_to_cpu(inw(addr)); 139 133 } 140 134 } 135 + EXPORT_SYMBOL(insw); 141 136 142 137 void insl(unsigned long __addr, void *dst, unsigned long count) 143 138 { ··· 207 200 } 208 201 } 209 202 } 203 + EXPORT_SYMBOL(insl); 210 204
+5
arch/sparc/lib/user_fixup.c
··· 7 7 #include <linux/kernel.h> 8 8 #include <linux/string.h> 9 9 #include <linux/errno.h> 10 + #include <linux/module.h> 11 + 10 12 #include <asm/uaccess.h> 11 13 12 14 /* Calculating the exact fault address when using ··· 42 40 43 41 return size; 44 42 } 43 + EXPORT_SYMBOL(copy_from_user_fixup); 45 44 46 45 unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) 47 46 { ··· 50 47 51 48 return compute_size((unsigned long) to, size, &offset); 52 49 } 50 + EXPORT_SYMBOL(copy_to_user_fixup); 53 51 54 52 unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) 55 53 { ··· 68 64 69 65 return size; 70 66 } 67 + EXPORT_SYMBOL(copy_in_user_fixup);
+1
arch/sparc/mm/generic_64.c
··· 161 161 flush_tlb_range(vma, beg, end); 162 162 return error; 163 163 } 164 + EXPORT_SYMBOL(io_remap_pfn_range);
+4
arch/sparc/mm/init_64.c
··· 146 146 } 147 147 148 148 unsigned long *sparc64_valid_addr_bitmap __read_mostly; 149 + EXPORT_SYMBOL(sparc64_valid_addr_bitmap); 149 150 150 151 /* Kernel physical address base and size in bytes. */ 151 152 unsigned long kern_base __read_mostly; ··· 370 369 out: 371 370 put_cpu(); 372 371 } 372 + EXPORT_SYMBOL(flush_dcache_page); 373 373 374 374 void __kprobes flush_icache_range(unsigned long start, unsigned long end) 375 375 { ··· 398 396 } 399 397 } 400 398 } 399 + EXPORT_SYMBOL(flush_icache_range); 401 400 402 401 void mmu_info(struct seq_file *m) 403 402 { ··· 602 599 "i" (ASI_DCACHE_INVALIDATE)); 603 600 } 604 601 } 602 + EXPORT_SYMBOL(__flush_dcache_range); 605 603 606 604 /* get_new_mmu_context() uses "cache + 1". */ 607 605 DEFINE_SPINLOCK(ctx_alloc_lock);
+3
arch/sparc/prom/misc_64.c
··· 11 11 #include <linux/sched.h> 12 12 #include <linux/interrupt.h> 13 13 #include <linux/delay.h> 14 + #include <linux/module.h> 15 + 14 16 #include <asm/openprom.h> 15 17 #include <asm/oplib.h> 16 18 #include <asm/system.h> ··· 56 54 p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) | 57 55 P1275_INOUT(1, 1), fstring); 58 56 } 57 + EXPORT_SYMBOL(prom_feval); 59 58 60 59 #ifdef CONFIG_SMP 61 60 extern void smp_capture(void);
+18 -2
arch/sparc/prom/tree_64.c
··· 10 10 #include <linux/types.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/sched.h> 13 + #include <linux/module.h> 13 14 14 15 #include <asm/openprom.h> 15 16 #include <asm/oplib.h> ··· 23 22 { 24 23 return p1275_cmd ("child", P1275_INOUT(1, 1), node); 25 24 } 25 + EXPORT_SYMBOL(__prom_getchild); 26 26 27 27 inline int prom_getchild(int node) 28 28 { ··· 34 32 if(cnode == -1) return 0; 35 33 return (int)cnode; 36 34 } 35 + EXPORT_SYMBOL(prom_getchild); 37 36 38 37 inline int prom_getparent(int node) 39 38 { ··· 53 50 { 54 51 return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node); 55 52 } 53 + EXPORT_SYMBOL(__prom_getsibling); 56 54 57 55 inline int prom_getsibling(int node) 58 56 { ··· 67 63 68 64 return sibnode; 69 65 } 66 + EXPORT_SYMBOL(prom_getsibling); 70 67 71 68 /* Return the length in bytes of property 'prop' at node 'node'. 72 69 * Return -1 on error. ··· 80 75 P1275_INOUT(2, 1), 81 76 node, prop); 82 77 } 78 + EXPORT_SYMBOL(prom_getproplen); 83 79 84 80 /* Acquire a property 'prop' at node 'node' and place it in 85 81 * 'buffer' which has a size of 'bufsize'. If the acquisition ··· 103 97 node, prop, buffer, P1275_SIZE(plen)); 104 98 } 105 99 } 100 + EXPORT_SYMBOL(prom_getproperty); 106 101 107 102 /* Acquire an integer property and return its value. Returns -1 108 103 * on failure. ··· 117 110 118 111 return -1; 119 112 } 113 + EXPORT_SYMBOL(prom_getint); 120 114 121 115 /* Acquire an integer property, upon error return the passed default 122 116 * integer. ··· 132 124 133 125 return retval; 134 126 } 127 + EXPORT_SYMBOL(prom_getintdefault); 135 128 136 129 /* Acquire a boolean property, 1=TRUE 0=FALSE. */ 137 130 int prom_getbool(int node, const char *prop) ··· 143 134 if(retval == -1) return 0; 144 135 return 1; 145 136 } 137 + EXPORT_SYMBOL(prom_getbool); 146 138 147 139 /* Acquire a property whose value is a string, returns a null 148 140 * string on error. The char pointer is the user supplied string ··· 158 148 user_buf[0] = 0; 159 149 return; 160 150 } 161 - 151 + EXPORT_SYMBOL(prom_getstring); 162 152 163 153 /* Does the device at node 'node' have name 'name'? 164 154 * YES = 1 NO = 0 ··· 191 181 192 182 return 0; 193 183 } 184 + EXPORT_SYMBOL(prom_searchsiblings); 194 185 195 186 /* Return the first property type for node 'node'. 196 187 * buffer should be at least 32B in length ··· 205 194 node, (char *) 0x0, buffer); 206 195 return buffer; 207 196 } 197 + EXPORT_SYMBOL(prom_firstprop); 208 198 209 199 /* Return the property type string after property type 'oprop' 210 200 * at node 'node' . Returns NULL string if no more ··· 229 217 node, oprop, buffer); 230 218 return buffer; 231 219 } 220 + EXPORT_SYMBOL(prom_nextprop); 232 221 233 222 int 234 223 prom_finddevice(const char *name) ··· 241 228 P1275_INOUT(1, 1), 242 229 name); 243 230 } 231 + EXPORT_SYMBOL(prom_finddevice); 244 232 245 233 int prom_node_has_property(int node, const char *prop) 246 234 { ··· 255 241 } while (*buf); 256 242 return 0; 257 243 } 258 - 244 + EXPORT_SYMBOL(prom_node_has_property); 245 + 259 246 /* Set property 'pname' at node 'node' to value 'value' which has a length 260 247 * of 'size' bytes. Return the number of bytes the prom accepted. 261 248 */ ··· 279 264 P1275_INOUT(4, 1), 280 265 node, pname, value, P1275_SIZE(size)); 281 266 } 267 + EXPORT_SYMBOL(prom_setprop); 282 268 283 269 inline int prom_inst2pkg(int inst) 284 270 {