Commit 6b57ba8e authored by Zong Li's avatar Zong Li Committed by Paul Walmsley

riscv: clean up the macro format in each header file

There are many different formats in each header now, such as
_ASM_XXX_H, __ASM_XXX_H, _ASM_RISCV_XXX_H, RISCV_XXX_H, etc., This patch
tries to unify the format by using _ASM_RISCV_XXX_H, because the most
header use it now. This patch also adds the conditional to the headers
if they lost it.
Signed-off-by: default avatarZong Li <zong.li@sifive.com>
Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
parent 0fdc636c
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_RISCV_PROTOTYPES_H #ifndef _ASM_RISCV_PROTOTYPES_H
#define _ASM_RISCV_PROTOTYPES_H
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <asm-generic/asm-prototypes.h> #include <asm-generic/asm-prototypes.h>
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
*/ */
#ifndef __ASM_CURRENT_H #ifndef _ASM_RISCV_CURRENT_H
#define __ASM_CURRENT_H #define _ASM_RISCV_CURRENT_H
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/compiler.h> #include <linux/compiler.h>
...@@ -34,4 +34,4 @@ static __always_inline struct task_struct *get_current(void) ...@@ -34,4 +34,4 @@ static __always_inline struct task_struct *get_current(void)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_CURRENT_H */ #endif /* _ASM_RISCV_CURRENT_H */
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2017 Andes Technology Corporation */ /* Copyright (C) 2017 Andes Technology Corporation */
#ifndef _ASM_RISCV_FTRACE_H
#define _ASM_RISCV_FTRACE_H
/* /*
* The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled. * The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled.
* Check arch/riscv/kernel/mcount.S for detail. * Check arch/riscv/kernel/mcount.S for detail.
...@@ -64,3 +67,5 @@ do { \ ...@@ -64,3 +67,5 @@ do { \
*/ */
#define MCOUNT_INSN_SIZE 8 #define MCOUNT_INSN_SIZE 8
#endif #endif
#endif /* _ASM_RISCV_FTRACE_H */
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* Copyright (c) 2018 Jim Wilson (jimw@sifive.com) * Copyright (c) 2018 Jim Wilson (jimw@sifive.com)
*/ */
#ifndef _ASM_FUTEX_H #ifndef _ASM_RISCV_FUTEX_H
#define _ASM_FUTEX_H #define _ASM_RISCV_FUTEX_H
#include <linux/futex.h> #include <linux/futex.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
...@@ -112,4 +112,4 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, ...@@ -112,4 +112,4 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
return ret; return ret;
} }
#endif /* _ASM_FUTEX_H */ #endif /* _ASM_RISCV_FUTEX_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Copyright (C) 2012 ARM Ltd. * Copyright (C) 2012 ARM Ltd.
* Copyright (C) 2017 SiFive * Copyright (C) 2017 SiFive
*/ */
#ifndef __ASM_HWCAP_H #ifndef _ASM_RISCV_HWCAP_H
#define __ASM_HWCAP_H #define _ASM_RISCV_HWCAP_H
#include <uapi/asm/hwcap.h> #include <uapi/asm/hwcap.h>
...@@ -23,4 +23,5 @@ enum { ...@@ -23,4 +23,5 @@ enum {
extern unsigned long elf_hwcap; extern unsigned long elf_hwcap;
#endif #endif
#endif
#endif /* _ASM_RISCV_HWCAP_H */
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_IMAGE_H #ifndef _ASM_RISCV_IMAGE_H
#define __ASM_IMAGE_H #define _ASM_RISCV_IMAGE_H
#define RISCV_IMAGE_MAGIC "RISCV\0\0\0" #define RISCV_IMAGE_MAGIC "RISCV\0\0\0"
#define RISCV_IMAGE_MAGIC2 "RSC\x05" #define RISCV_IMAGE_MAGIC2 "RSC\x05"
...@@ -62,4 +62,4 @@ struct riscv_image_header { ...@@ -62,4 +62,4 @@ struct riscv_image_header {
u32 res4; u32 res4;
}; };
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_IMAGE_H */ #endif /* _ASM_RISCV_IMAGE_H */
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* Copyright (C) 2017 SiFive * Copyright (C) 2017 SiFive
*/ */
#ifndef _RISCV_KPROBES_H #ifndef _ASM_RISCV_KPROBES_H
#define _RISCV_KPROBES_H #define _ASM_RISCV_KPROBES_H
#include <asm-generic/kprobes.h> #include <asm-generic/kprobes.h>
#endif /* _RISCV_KPROBES_H */ #endif /* _ASM_RISCV_KPROBES_H */
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
#include <asm-generic/mmiowb.h> #include <asm-generic/mmiowb.h>
#endif /* ASM_RISCV_MMIOWB_H */ #endif /* _ASM_RISCV_MMIOWB_H */
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Copyright (C) 2016 SiFive * Copyright (C) 2016 SiFive
*/ */
#ifndef __ASM_RISCV_PCI_H #ifndef _ASM_RISCV_PCI_H
#define __ASM_RISCV_PCI_H #define _ASM_RISCV_PCI_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -34,4 +34,4 @@ static inline int pci_proc_domain(struct pci_bus *bus) ...@@ -34,4 +34,4 @@ static inline int pci_proc_domain(struct pci_bus *bus)
} }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
#endif /* __ASM_PCI_H */ #endif /* _ASM_RISCV_PCI_H */
...@@ -94,4 +94,4 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, ...@@ -94,4 +94,4 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid); SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid);
} }
#endif #endif /* _ASM_RISCV_SBI_H */
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_SPARSEMEM_H #ifndef _ASM_RISCV_SPARSEMEM_H
#define __ASM_SPARSEMEM_H #define _ASM_RISCV_SPARSEMEM_H
#ifdef CONFIG_SPARSEMEM #ifdef CONFIG_SPARSEMEM
#define MAX_PHYSMEM_BITS CONFIG_PA_BITS #define MAX_PHYSMEM_BITS CONFIG_PA_BITS
#define SECTION_SIZE_BITS 27 #define SECTION_SIZE_BITS 27
#endif /* CONFIG_SPARSEMEM */ #endif /* CONFIG_SPARSEMEM */
#endif /* __ASM_SPARSEMEM_H */ #endif /* _ASM_RISCV_SPARSEMEM_H */
...@@ -22,4 +22,4 @@ typedef struct { ...@@ -22,4 +22,4 @@ typedef struct {
#define __ARCH_RW_LOCK_UNLOCKED { 0 } #define __ARCH_RW_LOCK_UNLOCKED { 0 }
#endif #endif /* _ASM_RISCV_SPINLOCK_TYPES_H */
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifndef _UAPI_ASM_ELF_H #ifndef _UAPI_ASM_RISCV_ELF_H
#define _UAPI_ASM_ELF_H #define _UAPI_ASM_RISCV_ELF_H
#include <asm/ptrace.h> #include <asm/ptrace.h>
...@@ -95,4 +95,4 @@ typedef union __riscv_fp_state elf_fpregset_t; ...@@ -95,4 +95,4 @@ typedef union __riscv_fp_state elf_fpregset_t;
#define R_RISCV_32_PCREL 57 #define R_RISCV_32_PCREL 57
#endif /* _UAPI_ASM_ELF_H */ #endif /* _UAPI_ASM_RISCV_ELF_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Copyright (C) 2012 ARM Ltd. * Copyright (C) 2012 ARM Ltd.
* Copyright (C) 2017 SiFive * Copyright (C) 2017 SiFive
*/ */
#ifndef __UAPI_ASM_HWCAP_H #ifndef _UAPI_ASM_RISCV_HWCAP_H
#define __UAPI_ASM_HWCAP_H #define _UAPI_ASM_RISCV_HWCAP_H
/* /*
* Linux saves the floating-point registers according to the ISA Linux is * Linux saves the floating-point registers according to the ISA Linux is
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A')) #define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A')) #define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
#endif #endif /* _UAPI_ASM_RISCV_HWCAP_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* *
* This file was copied from arch/arm64/include/uapi/asm/ucontext.h * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
*/ */
#ifndef _UAPI__ASM_UCONTEXT_H #ifndef _UAPI_ASM_RISCV_UCONTEXT_H
#define _UAPI__ASM_UCONTEXT_H #define _UAPI_ASM_RISCV_UCONTEXT_H
#include <linux/types.h> #include <linux/types.h>
...@@ -31,4 +31,4 @@ struct ucontext { ...@@ -31,4 +31,4 @@ struct ucontext {
struct sigcontext uc_mcontext; struct sigcontext uc_mcontext;
}; };
#endif /* _UAPI__ASM_UCONTEXT_H */ #endif /* _UAPI_ASM_RISCV_UCONTEXT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment