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

powerpc: move ASM_CONST and stringify_in_c() into asm-const.h

This patch moves ASM_CONST() and stringify_in_c() into
dedicated asm-const.h, then cleans all related inclusions.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: asm-compat.h should include asm-const.h]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Christophe Leroy and committed by
Michael Ellerman
ec0c464c 36a7eeaf

+72 -33
+1
arch/powerpc/crypto/md5-asm.S
··· 11 11 */ 12 12 #include <asm/ppc_asm.h> 13 13 #include <asm/asm-offsets.h> 14 + #include <asm/asm-compat.h> 14 15 15 16 #define rHP r3 16 17 #define rWP r4
+1
arch/powerpc/crypto/sha1-powerpc-asm.S
··· 7 7 8 8 #include <asm/ppc_asm.h> 9 9 #include <asm/asm-offsets.h> 10 + #include <asm/asm-compat.h> 10 11 11 12 #ifdef __BIG_ENDIAN__ 12 13 #define LWZ(rt, d, ra) \
+1 -12
arch/powerpc/include/asm/asm-compat.h
··· 1 1 #ifndef _ASM_POWERPC_ASM_COMPAT_H 2 2 #define _ASM_POWERPC_ASM_COMPAT_H 3 3 4 + #include <asm/asm-const.h> 4 5 #include <asm/types.h> 5 6 #include <asm/ppc-opcode.h> 6 - 7 - #ifdef __ASSEMBLY__ 8 - # define stringify_in_c(...) __VA_ARGS__ 9 - # define ASM_CONST(x) x 10 - #else 11 - /* This version of stringify will deal with commas... */ 12 - # define __stringify_in_c(...) #__VA_ARGS__ 13 - # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " " 14 - # define __ASM_CONST(x) x##UL 15 - # define ASM_CONST(x) __ASM_CONST(x) 16 - #endif 17 - 18 7 19 8 #ifdef __powerpc64__ 20 9
+14
arch/powerpc/include/asm/asm-const.h
··· 1 + #ifndef _ASM_POWERPC_ASM_CONST_H 2 + #define _ASM_POWERPC_ASM_CONST_H 3 + 4 + #ifdef __ASSEMBLY__ 5 + # define stringify_in_c(...) __VA_ARGS__ 6 + # define ASM_CONST(x) x 7 + #else 8 + /* This version of stringify will deal with commas... */ 9 + # define __stringify_in_c(...) #__VA_ARGS__ 10 + # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " " 11 + # define __ASM_CONST(x) x##UL 12 + # define ASM_CONST(x) __ASM_CONST(x) 13 + #endif 14 + #endif /* _ASM_POWERPC_ASM_CONST_H */
+2
arch/powerpc/include/asm/barrier.h
··· 5 5 #ifndef _ASM_POWERPC_BARRIER_H 6 6 #define _ASM_POWERPC_BARRIER_H 7 7 8 + #include <asm/asm-const.h> 9 + 8 10 /* 9 11 * Memory barrier. 10 12 * The sync instruction guarantees that all memory accesses initiated
+2
arch/powerpc/include/asm/book3s/64/hash.h
··· 3 3 #define _ASM_POWERPC_BOOK3S_64_HASH_H 4 4 #ifdef __KERNEL__ 5 5 6 + #include <asm/asm-const.h> 7 + 6 8 /* 7 9 * Common bits between 4K and 64K pages in a linux-style PTE. 8 10 * Additional bits may be defined in pgtable-hash64-*.h
+1 -1
arch/powerpc/include/asm/book3s/64/mmu-hash.h
··· 12 12 * 2 of the License, or (at your option) any later version. 13 13 */ 14 14 15 - #include <asm/asm-compat.h> 16 15 #include <asm/page.h> 17 16 #include <asm/bug.h> 17 + #include <asm/asm-const.h> 18 18 19 19 /* 20 20 * This is necessary to get the definition of PGTABLE_RANGE which we
+2
arch/powerpc/include/asm/book3s/64/radix.h
··· 2 2 #ifndef _ASM_POWERPC_PGTABLE_RADIX_H 3 3 #define _ASM_POWERPC_PGTABLE_RADIX_H 4 4 5 + #include <asm/asm-const.h> 6 + 5 7 #ifndef __ASSEMBLY__ 6 8 #include <asm/cmpxchg.h> 7 9 #endif
-1
arch/powerpc/include/asm/cmpxchg.h
··· 5 5 #ifdef __KERNEL__ 6 6 #include <linux/compiler.h> 7 7 #include <asm/synch.h> 8 - #include <asm/asm-compat.h> 9 8 #include <linux/bug.h> 10 9 #include <asm/asm-405.h> 11 10
+1
arch/powerpc/include/asm/code-patching.h
··· 14 14 #include <asm/ppc-opcode.h> 15 15 #include <linux/string.h> 16 16 #include <linux/kallsyms.h> 17 + #include <asm/asm-compat.h> 17 18 18 19 /* Flags for create_branch: 19 20 * "b" == create_branch(addr, target, 0);
+1 -1
arch/powerpc/include/asm/cputable.h
··· 4 4 5 5 6 6 #include <linux/types.h> 7 - #include <asm/asm-compat.h> 8 7 #include <asm/feature-fixups.h> 9 8 #include <uapi/asm/cputable.h> 9 + #include <asm/asm-const.h> 10 10 11 11 #ifndef __ASSEMBLY__ 12 12
-1
arch/powerpc/include/asm/dt_cpu_ftrs.h
··· 10 10 */ 11 11 12 12 #include <linux/types.h> 13 - #include <asm/asm-compat.h> 14 13 #include <asm/feature-fixups.h> 15 14 #include <uapi/asm/cputable.h> 16 15
+2
arch/powerpc/include/asm/feature-fixups.h
··· 1 1 #ifndef __ASM_POWERPC_FEATURE_FIXUPS_H 2 2 #define __ASM_POWERPC_FEATURE_FIXUPS_H 3 3 4 + #include <asm/asm-const.h> 5 + 4 6 /* 5 7 * This program is free software; you can redistribute it and/or 6 8 * modify it under the terms of the GNU General Public License
+1 -1
arch/powerpc/include/asm/firmware.h
··· 14 14 15 15 #ifdef __KERNEL__ 16 16 17 - #include <asm/asm-compat.h> 18 17 #include <asm/feature-fixups.h> 18 + #include <asm/asm-const.h> 19 19 20 20 /* firmware feature bitmask values */ 21 21
-1
arch/powerpc/include/asm/futex.h
··· 8 8 #include <linux/uaccess.h> 9 9 #include <asm/errno.h> 10 10 #include <asm/synch.h> 11 - #include <asm/asm-compat.h> 12 11 #include <asm/asm-405.h> 13 12 14 13 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
+1
arch/powerpc/include/asm/iommu.h
··· 30 30 #include <asm/machdep.h> 31 31 #include <asm/types.h> 32 32 #include <asm/pci-bridge.h> 33 + #include <asm/asm-const.h> 33 34 34 35 #define IOMMU_PAGE_SHIFT_4K 12 35 36 #define IOMMU_PAGE_SIZE_4K (ASM_CONST(1) << IOMMU_PAGE_SHIFT_4K)
+1 -1
arch/powerpc/include/asm/jump_label.h
··· 14 14 #include <linux/types.h> 15 15 16 16 #include <asm/feature-fixups.h> 17 - #include <asm/asm-compat.h> 17 + #include <asm/asm-const.h> 18 18 19 19 #define JUMP_ENTRY_TYPE stringify_in_c(FTR_ENTRY_LONG) 20 20 #define JUMP_LABEL_NOP_SIZE 4
+1
arch/powerpc/include/asm/mmu-44x.h
··· 6 6 */ 7 7 8 8 #include <asm/page.h> 9 + #include <asm/asm-const.h> 9 10 10 11 #define PPC44x_MMUCR_TID 0x000000ff 11 12 #define PPC44x_MMUCR_STS 0x00010000
+1 -1
arch/powerpc/include/asm/mmu.h
··· 5 5 6 6 #include <linux/types.h> 7 7 8 - #include <asm/asm-compat.h> 9 8 #include <asm/feature-fixups.h> 9 + #include <asm/asm-const.h> 10 10 11 11 /* 12 12 * MMU features bit definitions
+1
arch/powerpc/include/asm/nohash/64/pgtable.h
··· 8 8 9 9 #include <asm/nohash/64/pgtable-4k.h> 10 10 #include <asm/barrier.h> 11 + #include <asm/asm-const.h> 11 12 12 13 #ifdef CONFIG_PPC_64K_PAGES 13 14 #error "Page size not supported"
+1 -1
arch/powerpc/include/asm/page.h
··· 16 16 #else 17 17 #include <asm/types.h> 18 18 #endif 19 - #include <asm/asm-compat.h> 19 + #include <asm/asm-const.h> 20 20 21 21 /* 22 22 * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
+2
arch/powerpc/include/asm/page_64.h
··· 10 10 * 2 of the License, or (at your option) any later version. 11 11 */ 12 12 13 + #include <asm/asm-const.h> 14 + 13 15 /* 14 16 * We always define HW_PAGE_SHIFT to 12 as use of 64K pages remains Linux 15 17 * specific, every notion of page number shared with the firmware, TCEs,
+1 -1
arch/powerpc/include/asm/ppc-opcode.h
··· 13 13 #define _ASM_POWERPC_PPC_OPCODE_H 14 14 15 15 #include <linux/stringify.h> 16 - #include <asm/asm-compat.h> 16 + #include <asm/asm-const.h> 17 17 18 18 #define __REG_R0 0 19 19 #define __REG_R1 1
+1
arch/powerpc/include/asm/ptrace.h
··· 24 24 #define _ASM_POWERPC_PTRACE_H 25 25 26 26 #include <uapi/asm/ptrace.h> 27 + #include <asm/asm-const.h> 27 28 28 29 29 30 #ifdef __powerpc64__
+1
arch/powerpc/include/asm/reg.h
··· 13 13 14 14 #include <linux/stringify.h> 15 15 #include <asm/cputable.h> 16 + #include <asm/asm-const.h> 16 17 17 18 /* Pickup Book E specific registers. */ 18 19 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
+2
arch/powerpc/include/asm/reg_a2.h
··· 12 12 #ifndef __ASM_POWERPC_REG_A2_H__ 13 13 #define __ASM_POWERPC_REG_A2_H__ 14 14 15 + #include <asm/asm-const.h> 16 + 15 17 #define SPRN_TENSR 0x1b5 16 18 #define SPRN_TENS 0x1b6 /* Thread ENable Set */ 17 19 #define SPRN_TENC 0x1b7 /* Thread ENable Clear */
-1
arch/powerpc/include/asm/spinlock.h
··· 24 24 #include <asm/paca.h> 25 25 #include <asm/hvcall.h> 26 26 #endif 27 - #include <asm/asm-compat.h> 28 27 #include <asm/synch.h> 29 28 #include <asm/ppc-opcode.h> 30 29 #include <asm/asm-405.h>
+1
arch/powerpc/include/asm/synch.h
··· 5 5 6 6 #include <linux/stringify.h> 7 7 #include <asm/feature-fixups.h> 8 + #include <asm/asm-const.h> 8 9 9 10 #ifndef __ASSEMBLY__ 10 11 extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
+2
arch/powerpc/include/asm/thread_info.h
··· 9 9 #ifndef _ASM_POWERPC_THREAD_INFO_H 10 10 #define _ASM_POWERPC_THREAD_INFO_H 11 11 12 + #include <asm/asm-const.h> 13 + 12 14 #ifdef __KERNEL__ 13 15 14 16 #define THREAD_SHIFT CONFIG_THREAD_SHIFT
-1
arch/powerpc/include/asm/uaccess.h
··· 2 2 #ifndef _ARCH_POWERPC_UACCESS_H 3 3 #define _ARCH_POWERPC_UACCESS_H 4 4 5 - #include <asm/asm-compat.h> 6 5 #include <asm/ppc_asm.h> 7 6 #include <asm/processor.h> 8 7 #include <asm/page.h>
+1
arch/powerpc/kernel/entry_64.S
··· 38 38 #include <asm/ppc-opcode.h> 39 39 #include <asm/barrier.h> 40 40 #include <asm/export.h> 41 + #include <asm/asm-compat.h> 41 42 #ifdef CONFIG_PPC_BOOK3S 42 43 #include <asm/exception-64s.h> 43 44 #else
+1
arch/powerpc/kernel/fpu.S
··· 25 25 #include <asm/asm-offsets.h> 26 26 #include <asm/ptrace.h> 27 27 #include <asm/export.h> 28 + #include <asm/asm-compat.h> 28 29 29 30 #ifdef CONFIG_VSX 30 31 #define __REST_32FPVSRS(n,c,base) \
+1
arch/powerpc/kernel/idle_book3s.S
··· 23 23 #include <asm/exception-64s.h> 24 24 #include <asm/book3s/64/mmu-hash.h> 25 25 #include <asm/mmu.h> 26 + #include <asm/asm-compat.h> 26 27 27 28 #undef DEBUG 28 29
+1
arch/powerpc/kernel/kvm_emul.S
··· 23 23 #include <asm/reg.h> 24 24 #include <asm/page.h> 25 25 #include <asm/asm-offsets.h> 26 + #include <asm/asm-compat.h> 26 27 27 28 #define KVM_MAGIC_PAGE (-4096) 28 29
+1
arch/powerpc/kernel/ppc_save_regs.S
··· 12 12 #include <asm/ppc_asm.h> 13 13 #include <asm/asm-offsets.h> 14 14 #include <asm/ptrace.h> 15 + #include <asm/asm-compat.h> 15 16 16 17 /* 17 18 * Grab the register values as they are now.
+1
arch/powerpc/kernel/vector.S
··· 8 8 #include <asm/page.h> 9 9 #include <asm/ptrace.h> 10 10 #include <asm/export.h> 11 + #include <asm/asm-compat.h> 11 12 12 13 /* 13 14 * Load state from memory into VMX registers including VSCR.
+2
arch/powerpc/kvm/book3s_64_slb.S
··· 17 17 * Authors: Alexander Graf <agraf@suse.de> 18 18 */ 19 19 20 + #include <asm/asm-compat.h> 21 + 20 22 #define SHADOW_SLB_ENTRY_LEN 0x10 21 23 #define OFFSET_ESID(x) (SHADOW_SLB_ENTRY_LEN * x) 22 24 #define OFFSET_VSID(x) ((SHADOW_SLB_ENTRY_LEN * x) + 8)
+1
arch/powerpc/kvm/book3s_hv_interrupts.S
··· 27 27 #include <asm/asm-offsets.h> 28 28 #include <asm/exception-64s.h> 29 29 #include <asm/ppc-opcode.h> 30 + #include <asm/asm-compat.h> 30 31 31 32 /***************************************************************************** 32 33 * *
+1
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 32 32 #include <asm/opal.h> 33 33 #include <asm/xive-regs.h> 34 34 #include <asm/thread_info.h> 35 + #include <asm/asm-compat.h> 35 36 36 37 /* Sign-extend HDEC if not on POWER9 */ 37 38 #define EXTEND_HDEC(reg) \
+1
arch/powerpc/kvm/book3s_interrupts.S
··· 23 23 #include <asm/page.h> 24 24 #include <asm/asm-offsets.h> 25 25 #include <asm/exception-64s.h> 26 + #include <asm/asm-compat.h> 26 27 27 28 #if defined(CONFIG_PPC_BOOK3S_64) 28 29 #ifdef PPC64_ELF_ABI_v2
+1
arch/powerpc/kvm/book3s_rmhandlers.S
··· 23 23 #include <asm/mmu.h> 24 24 #include <asm/page.h> 25 25 #include <asm/asm-offsets.h> 26 + #include <asm/asm-compat.h> 26 27 27 28 #ifdef CONFIG_PPC_BOOK3S_64 28 29 #include <asm/exception-64s.h>
+2
arch/powerpc/kvm/book3s_segment.S
··· 19 19 20 20 /* Real mode helpers */ 21 21 22 + #include <asm/asm-compat.h> 23 + 22 24 #if defined(CONFIG_PPC_BOOK3S_64) 23 25 24 26 #define GET_SHADOW_VCPU(reg) \
+1
arch/powerpc/lib/copyuser_64.S
··· 9 9 #include <asm/processor.h> 10 10 #include <asm/ppc_asm.h> 11 11 #include <asm/export.h> 12 + #include <asm/asm-compat.h> 12 13 13 14 #ifdef __BIG_ENDIAN__ 14 15 #define sLd sld /* Shift towards low-numbered address. */
+1
arch/powerpc/lib/feature-fixups-test.S
··· 11 11 #include <asm/feature-fixups.h> 12 12 #include <asm/ppc_asm.h> 13 13 #include <asm/synch.h> 14 + #include <asm/asm-compat.h> 14 15 15 16 .text 16 17
+1
arch/powerpc/lib/ldstfp.S
··· 15 15 #include <asm/ppc-opcode.h> 16 16 #include <asm/reg.h> 17 17 #include <asm/asm-offsets.h> 18 + #include <asm/asm-compat.h> 18 19 #include <linux/errno.h> 19 20 20 21 #ifdef CONFIG_PPC_FPU
+1
arch/powerpc/lib/memcpy_64.S
··· 9 9 #include <asm/processor.h> 10 10 #include <asm/ppc_asm.h> 11 11 #include <asm/export.h> 12 + #include <asm/asm-compat.h> 12 13 13 14 .align 7 14 15 _GLOBAL_TOC(memcpy)
+1
arch/powerpc/mm/tlb_nohash_low.S
··· 34 34 #include <asm/asm-offsets.h> 35 35 #include <asm/processor.h> 36 36 #include <asm/bug.h> 37 + #include <asm/asm-compat.h> 37 38 38 39 #if defined(CONFIG_40x) 39 40
+1
arch/powerpc/net/bpf_jit32.h
··· 13 13 #ifndef _BPF_JIT32_H 14 14 #define _BPF_JIT32_H 15 15 16 + #include <asm/asm-compat.h> 16 17 #include "bpf_jit.h" 17 18 18 19 #ifdef CONFIG_PPC64
+1
arch/powerpc/net/bpf_jit_asm.S
··· 10 10 */ 11 11 12 12 #include <asm/ppc_asm.h> 13 + #include <asm/asm-compat.h> 13 14 #include "bpf_jit32.h" 14 15 15 16 /*
+1
arch/powerpc/net/bpf_jit_comp.c
··· 12 12 */ 13 13 #include <linux/moduleloader.h> 14 14 #include <asm/cacheflush.h> 15 + #include <asm/asm-compat.h> 15 16 #include <linux/netdevice.h> 16 17 #include <linux/filter.h> 17 18 #include <linux/if_vlan.h>
+1
arch/powerpc/net/bpf_jit_comp64.c
··· 13 13 */ 14 14 #include <linux/moduleloader.h> 15 15 #include <asm/cacheflush.h> 16 + #include <asm/asm-compat.h> 16 17 #include <linux/netdevice.h> 17 18 #include <linux/filter.h> 18 19 #include <linux/if_vlan.h>
+1
arch/powerpc/platforms/powernv/opal-wrappers.S
··· 14 14 #include <asm/hvcall.h> 15 15 #include <asm/asm-offsets.h> 16 16 #include <asm/opal.h> 17 + #include <asm/asm-compat.h> 17 18 18 19 .section ".text" 19 20
+1
arch/powerpc/platforms/pseries/setup.c
··· 69 69 #include <asm/kexec.h> 70 70 #include <asm/isa-bridge.h> 71 71 #include <asm/security_features.h> 72 + #include <asm/asm-const.h> 72 73 73 74 #include "pseries.h" 74 75
+1 -9
arch/powerpc/purgatory/trampoline.S
··· 12 12 * Software Foundation (version 2 of the License). 13 13 */ 14 14 15 - #if defined(__LITTLE_ENDIAN__) 16 - #define STWX_BE stwbrx 17 - #define LWZX_BE lwbrx 18 - #elif defined(__BIG_ENDIAN__) 19 - #define STWX_BE stwx 20 - #define LWZX_BE lwzx 21 - #else 22 - #error no endianness defined! 23 - #endif 15 + #include <asm/asm-compat.h> 24 16 25 17 .machine ppc64 26 18 .balign 256
+1
arch/powerpc/xmon/spr_access.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 #include <asm/ppc_asm.h> 3 + #include <asm/asm-compat.h> 3 4 4 5 /* unsigned long xmon_mfspr(sprn, default_value) */ 5 6 _GLOBAL(xmon_mfspr)
tools/testing/selftests/powerpc/copyloops/asm/asm-compat.h