Skip to content

Commit

Permalink
powerpc: move ASM_CONST and stringify_in_c() into asm-const.h
Browse files Browse the repository at this point in the history
This patch moves ASM_CONST() and stringify_in_c() into
dedicated asm-const.h, then cleans all related inclusions.

Signed-off-by: Christophe Leroy <[email protected]>
[mpe: asm-compat.h should include asm-const.h]
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
chleroy authored and mpe committed Jul 30, 2018
1 parent 36a7eea commit ec0c464
Show file tree
Hide file tree
Showing 57 changed files with 73 additions and 33 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/crypto/md5-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/asm-compat.h>

#define rHP r3
#define rWP r4
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/crypto/sha1-powerpc-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/asm-compat.h>

#ifdef __BIG_ENDIAN__
#define LWZ(rt, d, ra) \
Expand Down
13 changes: 1 addition & 12 deletions arch/powerpc/include/asm/asm-compat.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
#ifndef _ASM_POWERPC_ASM_COMPAT_H
#define _ASM_POWERPC_ASM_COMPAT_H

#include <asm/asm-const.h>
#include <asm/types.h>
#include <asm/ppc-opcode.h>

#ifdef __ASSEMBLY__
# define stringify_in_c(...) __VA_ARGS__
# define ASM_CONST(x) x
#else
/* This version of stringify will deal with commas... */
# define __stringify_in_c(...) #__VA_ARGS__
# define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
# define __ASM_CONST(x) x##UL
# define ASM_CONST(x) __ASM_CONST(x)
#endif


#ifdef __powerpc64__

/* operations for longs and pointers */
Expand Down
14 changes: 14 additions & 0 deletions arch/powerpc/include/asm/asm-const.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _ASM_POWERPC_ASM_CONST_H
#define _ASM_POWERPC_ASM_CONST_H

#ifdef __ASSEMBLY__
# define stringify_in_c(...) __VA_ARGS__
# define ASM_CONST(x) x
#else
/* This version of stringify will deal with commas... */
# define __stringify_in_c(...) #__VA_ARGS__
# define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
# define __ASM_CONST(x) x##UL
# define ASM_CONST(x) __ASM_CONST(x)
#endif
#endif /* _ASM_POWERPC_ASM_CONST_H */
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef _ASM_POWERPC_BARRIER_H
#define _ASM_POWERPC_BARRIER_H

#include <asm/asm-const.h>

/*
* Memory barrier.
* The sync instruction guarantees that all memory accesses initiated
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/book3s/64/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define _ASM_POWERPC_BOOK3S_64_HASH_H
#ifdef __KERNEL__

#include <asm/asm-const.h>

/*
* Common bits between 4K and 64K pages in a linux-style PTE.
* Additional bits may be defined in pgtable-hash64-*.h
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/book3s/64/mmu-hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* 2 of the License, or (at your option) any later version.
*/

#include <asm/asm-compat.h>
#include <asm/page.h>
#include <asm/bug.h>
#include <asm/asm-const.h>

/*
* This is necessary to get the definition of PGTABLE_RANGE which we
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/book3s/64/radix.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _ASM_POWERPC_PGTABLE_RADIX_H
#define _ASM_POWERPC_PGTABLE_RADIX_H

#include <asm/asm-const.h>

#ifndef __ASSEMBLY__
#include <asm/cmpxchg.h>
#endif
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifdef __KERNEL__
#include <linux/compiler.h>
#include <asm/synch.h>
#include <asm/asm-compat.h>
#include <linux/bug.h>
#include <asm/asm-405.h>

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/code-patching.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/ppc-opcode.h>
#include <linux/string.h>
#include <linux/kallsyms.h>
#include <asm/asm-compat.h>

/* Flags for create_branch:
* "b" == create_branch(addr, target, 0);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@


#include <linux/types.h>
#include <asm/asm-compat.h>
#include <asm/feature-fixups.h>
#include <uapi/asm/cputable.h>
#include <asm/asm-const.h>

#ifndef __ASSEMBLY__

Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/dt_cpu_ftrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

#include <linux/types.h>
#include <asm/asm-compat.h>
#include <asm/feature-fixups.h>
#include <uapi/asm/cputable.h>

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/feature-fixups.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef __ASM_POWERPC_FEATURE_FIXUPS_H
#define __ASM_POWERPC_FEATURE_FIXUPS_H

#include <asm/asm-const.h>

/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#ifdef __KERNEL__

#include <asm/asm-compat.h>
#include <asm/feature-fixups.h>
#include <asm/asm-const.h>

/* firmware feature bitmask values */

Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/uaccess.h>
#include <asm/errno.h>
#include <asm/synch.h>
#include <asm/asm-compat.h>
#include <asm/asm-405.h>

#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <asm/machdep.h>
#include <asm/types.h>
#include <asm/pci-bridge.h>
#include <asm/asm-const.h>

#define IOMMU_PAGE_SHIFT_4K 12
#define IOMMU_PAGE_SIZE_4K (ASM_CONST(1) << IOMMU_PAGE_SHIFT_4K)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/jump_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/types.h>

#include <asm/feature-fixups.h>
#include <asm/asm-compat.h>
#include <asm/asm-const.h>

#define JUMP_ENTRY_TYPE stringify_in_c(FTR_ENTRY_LONG)
#define JUMP_LABEL_NOP_SIZE 4
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/mmu-44x.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <asm/page.h>
#include <asm/asm-const.h>

#define PPC44x_MMUCR_TID 0x000000ff
#define PPC44x_MMUCR_STS 0x00010000
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include <linux/types.h>

#include <asm/asm-compat.h>
#include <asm/feature-fixups.h>
#include <asm/asm-const.h>

/*
* MMU features bit definitions
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/nohash/64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <asm/nohash/64/pgtable-4k.h>
#include <asm/barrier.h>
#include <asm/asm-const.h>

#ifdef CONFIG_PPC_64K_PAGES
#error "Page size not supported"
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#else
#include <asm/types.h>
#endif
#include <asm/asm-compat.h>
#include <asm/asm-const.h>

/*
* On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/page_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* 2 of the License, or (at your option) any later version.
*/

#include <asm/asm-const.h>

/*
* We always define HW_PAGE_SHIFT to 12 as use of 64K pages remains Linux
* specific, every notion of page number shared with the firmware, TCEs,
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/ppc-opcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define _ASM_POWERPC_PPC_OPCODE_H

#include <linux/stringify.h>
#include <asm/asm-compat.h>
#include <asm/asm-const.h>

#define __REG_R0 0
#define __REG_R1 1
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define _ASM_POWERPC_PTRACE_H

#include <uapi/asm/ptrace.h>
#include <asm/asm-const.h>


#ifdef __powerpc64__
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <linux/stringify.h>
#include <asm/cputable.h>
#include <asm/asm-const.h>

/* Pickup Book E specific registers. */
#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/reg_a2.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef __ASM_POWERPC_REG_A2_H__
#define __ASM_POWERPC_REG_A2_H__

#include <asm/asm-const.h>

#define SPRN_TENSR 0x1b5
#define SPRN_TENS 0x1b6 /* Thread ENable Set */
#define SPRN_TENC 0x1b7 /* Thread ENable Clear */
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <asm/paca.h>
#include <asm/hvcall.h>
#endif
#include <asm/asm-compat.h>
#include <asm/synch.h>
#include <asm/ppc-opcode.h>
#include <asm/asm-405.h>
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/synch.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <linux/stringify.h>
#include <asm/feature-fixups.h>
#include <asm/asm-const.h>

#ifndef __ASSEMBLY__
extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef _ASM_POWERPC_THREAD_INFO_H
#define _ASM_POWERPC_THREAD_INFO_H

#include <asm/asm-const.h>

#ifdef __KERNEL__

#define THREAD_SHIFT CONFIG_THREAD_SHIFT
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef _ARCH_POWERPC_UACCESS_H
#define _ARCH_POWERPC_UACCESS_H

#include <asm/asm-compat.h>
#include <asm/ppc_asm.h>
#include <asm/processor.h>
#include <asm/page.h>
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#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
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/fpu.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
#include <asm/export.h>
#include <asm/asm-compat.h>

#ifdef CONFIG_VSX
#define __REST_32FPVSRS(n,c,base) \
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/idle_book3s.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/exception-64s.h>
#include <asm/book3s/64/mmu-hash.h>
#include <asm/mmu.h>
#include <asm/asm-compat.h>

#undef DEBUG

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/kvm_emul.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/asm-offsets.h>
#include <asm/asm-compat.h>

#define KVM_MAGIC_PAGE (-4096)

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/ppc_save_regs.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
#include <asm/asm-compat.h>

/*
* Grab the register values as they are now.
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/vector.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/export.h>
#include <asm/asm-compat.h>

/*
* Load state from memory into VMX registers including VSCR.
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kvm/book3s_64_slb.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* Authors: Alexander Graf <[email protected]>
*/

#include <asm/asm-compat.h>

#define SHADOW_SLB_ENTRY_LEN 0x10
#define OFFSET_ESID(x) (SHADOW_SLB_ENTRY_LEN * x)
#define OFFSET_VSID(x) ((SHADOW_SLB_ENTRY_LEN * x) + 8)
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_hv_interrupts.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/asm-offsets.h>
#include <asm/exception-64s.h>
#include <asm/ppc-opcode.h>
#include <asm/asm-compat.h>

/*****************************************************************************
* *
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_hv_rmhandlers.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/opal.h>
#include <asm/xive-regs.h>
#include <asm/thread_info.h>
#include <asm/asm-compat.h>

/* Sign-extend HDEC if not on POWER9 */
#define EXTEND_HDEC(reg) \
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_interrupts.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/page.h>
#include <asm/asm-offsets.h>
#include <asm/exception-64s.h>
#include <asm/asm-compat.h>

#if defined(CONFIG_PPC_BOOK3S_64)
#ifdef PPC64_ELF_ABI_v2
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_rmhandlers.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/mmu.h>
#include <asm/page.h>
#include <asm/asm-offsets.h>
#include <asm/asm-compat.h>

#ifdef CONFIG_PPC_BOOK3S_64
#include <asm/exception-64s.h>
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kvm/book3s_segment.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

/* Real mode helpers */

#include <asm/asm-compat.h>

#if defined(CONFIG_PPC_BOOK3S_64)

#define GET_SHADOW_VCPU(reg) \
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/lib/copyuser_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/export.h>
#include <asm/asm-compat.h>

#ifdef __BIG_ENDIAN__
#define sLd sld /* Shift towards low-numbered address. */
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/lib/feature-fixups-test.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <asm/feature-fixups.h>
#include <asm/ppc_asm.h>
#include <asm/synch.h>
#include <asm/asm-compat.h>

.text

Expand Down
Loading

0 comments on commit ec0c464

Please sign in to comment.