Skip to contentSkip to conversation

powerpc: Move adb symbol exports next to function definitions

PATCH In review Anton Blanchard 2 participants 8 messages Aug 19, 2014 – Sep 11, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 powerpc: Move adb symbol exports next to function definitions

---
 arch/powerpc/kernel/ppc_ksyms.c | 7 -------
 drivers/macintosh/adb.c         | 5 +++++
 2 files changed, 5 insertions(+), 7 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +0 -7
index 48d17d6f..351f447 100644
@@ -128,13 +128,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-#ifdef CONFIG_ADB
-EXPORT_SYMBOL(adb_request);
-EXPORT_SYMBOL(adb_register);
-EXPORT_SYMBOL(adb_unregister);
-EXPORT_SYMBOL(adb_poll);
-EXPORT_SYMBOL(adb_try_handler_change);
-#endif /* CONFIG_ADB */
 #ifdef CONFIG_ADB_CUDA
 EXPORT_SYMBOL(cuda_request);
 EXPORT_SYMBOL(cuda_poll);
drivers/macintosh/adb.c +5 -0
index 9e9c567..226179b 100644
@@ -411,6 +411,7 @@ adb_poll(void)
 		return;
 	adb_controller->poll();
 }
+EXPORT_SYMBOL(adb_poll);
 
 static void adb_sync_req_done(struct adb_request *req)
 {
@@ -460,6 +461,7 @@ adb_request(struct adb_request *req, void (*done)(struct adb_request *),
 
 	return rc;
 }
+EXPORT_SYMBOL(adb_request);
 
  /* Ultimately this should return the number of devices with
     the given default id.
@@ -495,6 +497,7 @@ adb_register(int default_id, int handler_id, struct adb_ids *ids,
 	mutex_unlock(&adb_handler_mutex);
 	return ids->nids;
 }
+EXPORT_SYMBOL(adb_register);
 
 int
 adb_unregister(int index)
@@ -516,6 +519,7 @@ adb_unregister(int index)
 	mutex_unlock(&adb_handler_mutex);
 	return ret;
 }
+EXPORT_SYMBOL(adb_unregister);
 
 void
 adb_input(unsigned char *buf, int nb, int autopoll)
@@ -582,6 +586,7 @@ adb_try_handler_change(int address, int new_id)
 	mutex_unlock(&adb_handler_mutex);
 	return ret;
 }
+EXPORT_SYMBOL(adb_try_handler_change);
 
 int
 adb_get_infos(int address, int *original_address, int *handler_id)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/6 powerpc: Move via-cuda symbol exports next to function definitions

---
 arch/powerpc/kernel/ppc_ksyms.c | 4 ----
 drivers/macintosh/via-cuda.c    | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +0 -4
index 351f447..521291d 100644
@@ -128,10 +128,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-#ifdef CONFIG_ADB_CUDA
-EXPORT_SYMBOL(cuda_request);
-EXPORT_SYMBOL(cuda_poll);
-#endif /* CONFIG_ADB_CUDA */
 EXPORT_SYMBOL(to_tm);
 
 #ifdef CONFIG_PPC32
drivers/macintosh/via-cuda.c +2 -0
index d61f271..bad1813 100644
@@ -379,6 +379,7 @@ cuda_request(struct adb_request *req, void (*done)(struct adb_request *),
     req->reply_expected = 1;
     return cuda_write(req);
 }
+EXPORT_SYMBOL(cuda_request);
 
 static int
 cuda_write(struct adb_request *req)
@@ -441,6 +442,7 @@ cuda_poll(void)
     if (cuda_irq)
 	enable_irq(cuda_irq);
 }
+EXPORT_SYMBOL(cuda_poll);
 
 static irqreturn_t
 cuda_interrupt(int irq, void *arg)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/6 powerpc: Move more symbol exports next to function definitions

In reply to Anton Blanchard
---
 arch/powerpc/kernel/ppc_ksyms.c    | 14 --------------
 arch/powerpc/kernel/process.c      |  2 ++
 arch/powerpc/kernel/setup-common.c |  3 +++
 arch/powerpc/kernel/time.c         |  1 +
 arch/powerpc/mm/hash_utils_64.c    |  1 +
 5 files changed, 7 insertions(+), 14 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +0 -14
index 521291d..4a42a1f 100644
@@ -5,7 +5,6 @@
 #include <linux/elfcore.h>
 #include <linux/string.h>
 #include <linux/interrupt.h>
-#include <linux/screen_info.h>
 #include <linux/vt_kern.h>
 #include <linux/nvram.h>
 #include <linux/irq.h>
@@ -96,8 +95,6 @@ EXPORT_SYMBOL(isa_mem_base);
 EXPORT_SYMBOL(pci_dram_offset);
 #endif /* CONFIG_PCI */
 
-EXPORT_SYMBOL(start_thread);
-
 #ifdef CONFIG_PPC_FPU
 EXPORT_SYMBOL(giveup_fpu);
 EXPORT_SYMBOL(load_fp_state);
@@ -109,7 +106,6 @@ EXPORT_SYMBOL(load_vr_state);
 EXPORT_SYMBOL(store_vr_state);
 #endif /* CONFIG_ALTIVEC */
 #ifdef CONFIG_VSX
-EXPORT_SYMBOL(giveup_vsx);
 EXPORT_SYMBOL_GPL(__giveup_vsx);
 #endif /* CONFIG_VSX */
 #ifdef CONFIG_SPE
@@ -128,8 +124,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-EXPORT_SYMBOL(to_tm);
-
 #ifdef CONFIG_PPC32
 long long __ashrdi3(long long, int);
 long long __ashldi3(long long, int);
@@ -150,10 +144,6 @@ EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memcmp);
 EXPORT_SYMBOL(memchr);
 
-#if defined(CONFIG_FB_VGA16_MODULE)
-EXPORT_SYMBOL(screen_info);
-#endif
-
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
@@ -189,10 +179,6 @@ EXPORT_SYMBOL(__arch_hweight32);
 EXPORT_SYMBOL(__arch_hweight64);
 #endif
 
-#ifdef CONFIG_PPC_BOOK3S_64
-EXPORT_SYMBOL_GPL(mmu_psize_defs);
-#endif
-
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
arch/powerpc/kernel/process.c +2 -0
index bf44ae9..aa1df89 100644
@@ -228,6 +228,7 @@ void giveup_vsx(struct task_struct *tsk)
 	giveup_altivec_maybe_transactional(tsk);
 	__giveup_vsx(tsk);
 }
+EXPORT_SYMBOL(giveup_vsx);
 
 void flush_vsx_to_thread(struct task_struct *tsk)
 {
@@ -1316,6 +1317,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
 	current->thread.tm_tfiar = 0;
 #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
 }
+EXPORT_SYMBOL(start_thread);
 
 #define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \
 		| PR_FP_EXC_RES | PR_FP_EXC_INV)
arch/powerpc/kernel/setup-common.c +3 -0
index 1b0e260..c933acd 100644
@@ -94,6 +94,9 @@ struct screen_info screen_info = {
 	.orig_video_isVGA = 1,
 	.orig_video_points = 16
 };
+#if defined(CONFIG_FB_VGA16_MODULE)
+EXPORT_SYMBOL(screen_info);
+#endif
 
 /* Variables required to store legacy IO irq routing */
 int of_i8042_kbd_irq;
arch/powerpc/kernel/time.c +1 -0
index 368ab37..055558b 100644
@@ -1024,6 +1024,7 @@ void to_tm(int tim, struct rtc_time * tm)
 	 */
 	GregorianDay(tm);
 }
+EXPORT_SYMBOL(to_tm);
 
 /*
  * Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit
arch/powerpc/mm/hash_utils_64.c +1 -0
index daee7f4..bc6cc2a 100644
@@ -92,6 +92,7 @@ extern unsigned long dart_tablebase;
 
 static unsigned long _SDR1;
 struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
+EXPORT_SYMBOL_GPL(mmu_psize_defs);
 
 struct hash_pte *htab_address;
 unsigned long htab_size_bytes;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/6 powerpc: Remove unused 32bit symbol exports

In reply to Anton Blanchard
---
 arch/powerpc/kernel/ppc_ksyms.c | 16 ----------------
 1 file changed, 16 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +0 -16
index 4a42a1f..ab4f0bc 100644
@@ -45,26 +45,10 @@
 #include <asm/epapr_hcalls.h>
 
 #ifdef CONFIG_PPC32
-extern void transfer_to_handler(void);
-extern void do_IRQ(struct pt_regs *regs);
-extern void machine_check_exception(struct pt_regs *regs);
-extern void alignment_exception(struct pt_regs *regs);
-extern void program_check_exception(struct pt_regs *regs);
-extern void single_step_exception(struct pt_regs *regs);
-extern int sys_sigreturn(struct pt_regs *regs);
-
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
 EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);
-
-EXPORT_SYMBOL(transfer_to_handler);
-EXPORT_SYMBOL(do_IRQ);
-EXPORT_SYMBOL(machine_check_exception);
-EXPORT_SYMBOL(alignment_exception);
-EXPORT_SYMBOL(program_check_exception);
-EXPORT_SYMBOL(single_step_exception);
-EXPORT_SYMBOL(sys_sigreturn);
 #endif
 
 #ifdef CONFIG_FUNCTION_TRACER
Signature · 1 line
1.9.1
#4 lore raw

PATCH 5/6 powerpc: Move lib symbol exports into arch/powerpc/lib/ppc_ksyms.c

In reply to Anton Blanchard

Move the lib symbol exports closer to their function definitions

---
 arch/powerpc/kernel/ppc_ksyms.c | 32 --------------------------------
 arch/powerpc/lib/Makefile       |  2 +-
 arch/powerpc/lib/ppc_ksyms.c    | 39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 33 deletions(-)
 create mode 100644 arch/powerpc/lib/ppc_ksyms.c
arch/powerpc/kernel/ppc_ksyms.c +0 -32
index ab4f0bc..aba41f3 100644
@@ -55,24 +55,6 @@ EXPORT_SYMBOL(DMA_MODE_WRITE);
 EXPORT_SYMBOL(_mcount);
 #endif
 
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-
-#ifndef CONFIG_GENERIC_CSUM
-EXPORT_SYMBOL(csum_partial);
-EXPORT_SYMBOL(csum_partial_copy_generic);
-EXPORT_SYMBOL(ip_fast_csum);
-EXPORT_SYMBOL(csum_tcpudp_magic);
-#endif
-
-EXPORT_SYMBOL(__copy_tofrom_user);
-EXPORT_SYMBOL(__clear_user);
-EXPORT_SYMBOL(copy_page);
-
 #if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
 EXPORT_SYMBOL(isa_io_base);
 EXPORT_SYMBOL(isa_mem_base);
@@ -122,17 +104,10 @@ EXPORT_SYMBOL(__cmpdi2);
 #endif
 long long __bswapdi2(long long);
 EXPORT_SYMBOL(__bswapdi2);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memchr);
 
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
-EXPORT_SYMBOL(cacheable_memcpy);
-EXPORT_SYMBOL(cacheable_memzero);
 #endif
 
 #ifdef CONFIG_PPC32
@@ -156,13 +131,6 @@ EXPORT_SYMBOL(__mfdcr);
 #endif
 EXPORT_SYMBOL(empty_zero_page);
 
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(__arch_hweight8);
-EXPORT_SYMBOL(__arch_hweight16);
-EXPORT_SYMBOL(__arch_hweight32);
-EXPORT_SYMBOL(__arch_hweight64);
-#endif
-
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
arch/powerpc/lib/Makefile +1 -1
index 59fa2de..9f342f1 100644
@@ -10,7 +10,7 @@ CFLAGS_REMOVE_code-patching.o = -pg
 CFLAGS_REMOVE_feature-fixups.o = -pg
 
 obj-y			:= string.o alloc.o \
-			   crtsavres.o
+			   crtsavres.o ppc_ksyms.o
 obj-$(CONFIG_PPC32)	+= div64.o copy_32.o
 obj-$(CONFIG_HAS_IOMEM)	+= devres.o
 
arch/powerpc/lib/ppc_ksyms.c new file +39 -0
new file mode 100644
index 0000000..f993959
@@ -0,0 +1,39 @@
+#include <linux/string.h>
+#include <linux/uaccess.h>
+#include <linux/bitops.h>
+#include <net/checksum.h>
+
+EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(memcmp);
+EXPORT_SYMBOL(memchr);
+#ifdef CONFIG_PPC32
+EXPORT_SYMBOL(cacheable_memcpy);
+EXPORT_SYMBOL(cacheable_memzero);
+#endif
+
+EXPORT_SYMBOL(strcpy);
+EXPORT_SYMBOL(strncpy);
+EXPORT_SYMBOL(strcat);
+EXPORT_SYMBOL(strlen);
+EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
+
+#ifndef CONFIG_GENERIC_CSUM
+EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy_generic);
+EXPORT_SYMBOL(ip_fast_csum);
+EXPORT_SYMBOL(csum_tcpudp_magic);
+#endif
+
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(copy_page);
+
+#ifdef CONFIG_PPC64
+EXPORT_SYMBOL(__arch_hweight8);
+EXPORT_SYMBOL(__arch_hweight16);
+EXPORT_SYMBOL(__arch_hweight32);
+EXPORT_SYMBOL(__arch_hweight64);
+#endif
Signature · 1 line
1.9.1
#5 lore raw

PATCH 6/6 powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c

In reply to Anton Blanchard

Simplify things considerably by moving all the ppc32 specific symbol exports into its own file.

---
 arch/powerpc/kernel/Makefile       |   3 +
 arch/powerpc/kernel/ppc_ksyms.c    | 123 +++++--------------------------------
 arch/powerpc/kernel/ppc_ksyms_32.c |  61 ++++++++++++++++++
 3 files changed, 79 insertions(+), 108 deletions(-)
 create mode 100644 arch/powerpc/kernel/ppc_ksyms_32.c
arch/powerpc/kernel/Makefile +3 -0
index 670c312..502cf69 100644
@@ -93,6 +93,9 @@ obj-$(CONFIG_PPC32)		+= entry_32.o setup_32.o
 obj-$(CONFIG_PPC64)		+= dma-iommu.o iommu.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_MODULES)		+= ppc_ksyms.o
+ifeq ($(CONFIG_PPC32),y)
+obj-$(CONFIG_MODULES)		+= ppc_ksyms_32.o
+endif
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
arch/powerpc/kernel/ppc_ksyms.c +15 -108

150 lines not on this page · raw message

arch/powerpc/kernel/ppc_ksyms_32.c new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

Re: [PATCH 6/6] powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c

Hi Anton,

arch/powerpc/kernel/ppc_ksyms.c line 1

Quoted 7 lines · On Wed, 20 Aug 2014 08:00:05 +1000 Anton Blanchard <[email protected]> wrote:
arch/powerpc/kernel/ppc_ksyms.c +0 -1
index aba41f3..c4dfff6 100644
@@ -1,135 +1,42 @@
-#include <linux/export.h>

You removed export.h ...

arch/powerpc/kernel/ppc_ksyms.c line 10

Quoted 2 lines
arch/powerpc/kernel/ppc_ksyms.c +2 -0
+EXPORT_SYMBOL(flush_dcache_range);
+EXPORT_SYMBOL(flush_icache_range);

But still use EXPORT_SYMBOL ...

Or did I miss something?

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#7 lore raw

Re: [PATCH 6/6] powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c

Hi Stephen,

Quoted 6 lines

You removed export.h ...

arch/powerpc/kernel/ppc_ksyms.c line 10

Quoted 2 lines
arch/powerpc/kernel/ppc_ksyms.c +2 -0
+EXPORT_SYMBOL(flush_dcache_range);
+EXPORT_SYMBOL(flush_icache_range);

But still use EXPORT_SYMBOL ...

Thanks, fixed!

Anton