Message ID | 20230325130651.2457266-2-npiggin@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/2] powerpc: merge 32-bit and 64-bit _switch implementation | expand |
Le 25/03/2023 à 14:06, Nicholas Piggin a écrit : > This file contains only the enter_prom implementation now. > Trim includes and update header comment while we're here. > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > --- > arch/powerpc/kernel/Makefile | 8 +++-- > .../kernel/{entry_64.S => prom_entry.S} | 30 ++----------------- > scripts/head-object-list.txt | 2 +- > 3 files changed, 9 insertions(+), 31 deletions(-) > rename arch/powerpc/kernel/{entry_64.S => prom_entry.S} (73%) > > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile > index ec70a1748506..ebba0896998a 100644 > --- a/arch/powerpc/kernel/Makefile > +++ b/arch/powerpc/kernel/Makefile > @@ -209,10 +209,12 @@ CFLAGS_paca.o += -fno-stack-protector > > obj-$(CONFIG_PPC_FPU) += fpu.o > obj-$(CONFIG_ALTIVEC) += vector.o > -obj-$(CONFIG_PPC64) += entry_64.o > -obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o > > -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > +ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE You don't need that ifdef construct, you can do: obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry.o > +obj-y += prom_init.o > +obj-$(CONFIG_PPC64) += prom_entry.o > +extra-y += prom_init_check > +endif > > quiet_cmd_prom_init_check = PROMCHK $@ > cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" $(obj)/prom_init.o; touch $@ Christophe
On Tue Mar 28, 2023 at 3:48 AM AEST, Christophe Leroy wrote: > > > Le 25/03/2023 à 14:06, Nicholas Piggin a écrit : > > This file contains only the enter_prom implementation now. > > Trim includes and update header comment while we're here. > > > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > > --- > > arch/powerpc/kernel/Makefile | 8 +++-- > > .../kernel/{entry_64.S => prom_entry.S} | 30 ++----------------- > > scripts/head-object-list.txt | 2 +- > > 3 files changed, 9 insertions(+), 31 deletions(-) > > rename arch/powerpc/kernel/{entry_64.S => prom_entry.S} (73%) > > > > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile > > index ec70a1748506..ebba0896998a 100644 > > --- a/arch/powerpc/kernel/Makefile > > +++ b/arch/powerpc/kernel/Makefile > > @@ -209,10 +209,12 @@ CFLAGS_paca.o += -fno-stack-protector > > > > obj-$(CONFIG_PPC_FPU) += fpu.o > > obj-$(CONFIG_ALTIVEC) += vector.o > > -obj-$(CONFIG_PPC64) += entry_64.o > > -obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o > > > > -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > > +ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE > > You don't need that ifdef construct, you can do: > > obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry.o Nice. So that could have been obj64-y from the start? Thanks, Nick > > > +obj-y += prom_init.o > > +obj-$(CONFIG_PPC64) += prom_entry.o > > +extra-y += prom_init_check > > +endif > > > > quiet_cmd_prom_init_check = PROMCHK $@ > > cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" $(obj)/prom_init.o; touch $@ > > > Christophe
Le 28/03/2023 à 08:51, Nicholas Piggin a écrit : > On Tue Mar 28, 2023 at 3:48 AM AEST, Christophe Leroy wrote: >> >> >> Le 25/03/2023 à 14:06, Nicholas Piggin a écrit : >>> This file contains only the enter_prom implementation now. >>> Trim includes and update header comment while we're here. >>> >>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> >>> --- >>> arch/powerpc/kernel/Makefile | 8 +++-- >>> .../kernel/{entry_64.S => prom_entry.S} | 30 ++----------------- >>> scripts/head-object-list.txt | 2 +- >>> 3 files changed, 9 insertions(+), 31 deletions(-) >>> rename arch/powerpc/kernel/{entry_64.S => prom_entry.S} (73%) >>> >>> diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile >>> index ec70a1748506..ebba0896998a 100644 >>> --- a/arch/powerpc/kernel/Makefile >>> +++ b/arch/powerpc/kernel/Makefile >>> @@ -209,10 +209,12 @@ CFLAGS_paca.o += -fno-stack-protector >>> >>> obj-$(CONFIG_PPC_FPU) += fpu.o >>> obj-$(CONFIG_ALTIVEC) += vector.o >>> -obj-$(CONFIG_PPC64) += entry_64.o >>> -obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o >>> >>> -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check >>> +ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE >> >> You don't need that ifdef construct, you can do: >> >> obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry.o > > Nice. So that could have been obj64-y from the start? Yes, allthought it is not used that way in ppc/kernel/Makefile: $ git grep -e obj64 -e obj32 arch/powerpc/kernel/Makefile arch/powerpc/kernel/Makefile:obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o arch/powerpc/kernel/Makefile:obj64-$(CONFIG_AUDIT) += compat_audit.o arch/powerpc/kernel/Makefile:obj64-$(CONFIG_PPC_TRANSACTIONAL_MEM) += tm.o arch/powerpc/kernel/Makefile:obj-$(CONFIG_PPC64) += $(obj64-y) arch/powerpc/kernel/Makefile:obj-$(CONFIG_PPC32) += $(obj32-y) But it is in ppc/lib/Makefile: $ git grep -e obj64 -e obj32 arch/powerpc/lib/Makefile arch/powerpc/lib/Makefile:obj64-y += copypage_64.o copyuser_64.o mem_64.o hweight_64.o \ arch/powerpc/lib/Makefile:obj64-$(CONFIG_SMP) += locks.o arch/powerpc/lib/Makefile:obj64-$(CONFIG_ALTIVEC) += vmx-helper.o arch/powerpc/lib/Makefile:obj64-$(CONFIG_KPROBES_SANITY_TEST) += test_emulate_step.o \ arch/powerpc/lib/Makefile:obj64-y += quad.o arch/powerpc/lib/Makefile:obj-$(CONFIG_PPC64) += $(obj64-y) Christophe
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index ec70a1748506..ebba0896998a 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -209,10 +209,12 @@ CFLAGS_paca.o += -fno-stack-protector obj-$(CONFIG_PPC_FPU) += fpu.o obj-$(CONFIG_ALTIVEC) += vector.o -obj-$(CONFIG_PPC64) += entry_64.o -obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check +ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE +obj-y += prom_init.o +obj-$(CONFIG_PPC64) += prom_entry.o +extra-y += prom_init_check +endif quiet_cmd_prom_init_check = PROMCHK $@ cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" $(obj)/prom_init.o; touch $@ diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/prom_entry.S similarity index 73% rename from arch/powerpc/kernel/entry_64.S rename to arch/powerpc/kernel/prom_entry.S index f3d3885ee9fd..0b65b2150e37 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/prom_entry.S @@ -10,41 +10,17 @@ * Copyright (C) 1996 Paul Mackerras. * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net). * - * This file contains the system call entry code, context switch - * code, and exception/interrupt return code for PowerPC. + * This file contains the prom entry code. */ - -#include <linux/errno.h> -#include <linux/err.h> -#include <asm/cache.h> -#include <asm/unistd.h> -#include <asm/processor.h> -#include <asm/page.h> -#include <asm/mmu.h> -#include <asm/thread_info.h> -#include <asm/code-patching-asm.h> -#include <asm/ppc_asm.h> #include <asm/asm-offsets.h> -#include <asm/cputable.h> -#include <asm/firmware.h> -#include <asm/bug.h> -#include <asm/ptrace.h> -#include <asm/irqflags.h> -#include <asm/hw_irq.h> -#include <asm/context_tracking.h> -#include <asm/ppc-opcode.h> -#include <asm/barrier.h> -#include <asm/export.h> -#include <asm/asm-compat.h> #ifdef CONFIG_PPC_BOOK3S #include <asm/exception-64s.h> #else #include <asm/exception-64e.h> #endif -#include <asm/feature-fixups.h> -#include <asm/kup.h> +#include <asm/ppc_asm.h> - .section ".text" +.section ".text","ax",@progbits _GLOBAL(enter_prom) mflr r0 diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt index b2a0e21ea8d7..f0ee936872fc 100644 --- a/scripts/head-object-list.txt +++ b/scripts/head-object-list.txt @@ -34,7 +34,7 @@ arch/powerpc/kernel/head_64.o arch/powerpc/kernel/head_8xx.o arch/powerpc/kernel/head_85xx.o arch/powerpc/kernel/head_book3s_32.o -arch/powerpc/kernel/entry_64.o +arch/powerpc/kernel/prom_entry.o arch/powerpc/kernel/fpu.o arch/powerpc/kernel/vector.o arch/powerpc/kernel/prom_init.o
This file contains only the enter_prom implementation now. Trim includes and update header comment while we're here. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- arch/powerpc/kernel/Makefile | 8 +++-- .../kernel/{entry_64.S => prom_entry.S} | 30 ++----------------- scripts/head-object-list.txt | 2 +- 3 files changed, 9 insertions(+), 31 deletions(-) rename arch/powerpc/kernel/{entry_64.S => prom_entry.S} (73%)