sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers

While the GCC and Clang compilers already define __ASSEMBLER__
automatically when compiling assembly code, __ASSEMBLY__ is a
macro that only gets defined by the Makefiles in the kernel.
This can be very confusing when switching between userspace
and kernelspace coding, or when dealing with uapi headers that
rather should use __ASSEMBLER__ instead. So let's standardize on
the __ASSEMBLER__ macro that is provided by the compilers now.

This is a completely mechanical patch (done with a simple "sed -i"
statement).

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

authored by Thomas Huth and committed by John Paul Adrian Glaubitz 9cc64695 0af2f6be

+46 -46
+2 -2
arch/sh/include/asm/cache.h
··· 22 23 #define __read_mostly __section(".data..read_mostly") 24 25 - #ifndef __ASSEMBLY__ 26 struct cache_info { 27 unsigned int ways; /* Number of cache ways */ 28 unsigned int sets; /* Number of cache sets */ ··· 48 49 unsigned long flags; 50 }; 51 - #endif /* __ASSEMBLY__ */ 52 #endif /* __ASM_SH_CACHE_H */
··· 22 23 #define __read_mostly __section(".data..read_mostly") 24 25 + #ifndef __ASSEMBLER__ 26 struct cache_info { 27 unsigned int ways; /* Number of cache ways */ 28 unsigned int sets; /* Number of cache sets */ ··· 48 49 unsigned long flags; 50 }; 51 + #endif /* __ASSEMBLER__ */ 52 #endif /* __ASM_SH_CACHE_H */
+3 -3
arch/sh/include/asm/dwarf.h
··· 189 */ 190 #define DWARF_ARCH_RA_REG 17 191 192 - #ifndef __ASSEMBLY__ 193 194 #include <linux/compiler.h> 195 #include <linux/bug.h> ··· 379 struct module *); 380 extern void module_dwarf_cleanup(struct module *); 381 382 - #endif /* !__ASSEMBLY__ */ 383 384 #define CFI_STARTPROC .cfi_startproc 385 #define CFI_ENDPROC .cfi_endproc ··· 402 #define CFI_REL_OFFSET CFI_IGNORE 403 #define CFI_UNDEFINED CFI_IGNORE 404 405 - #ifndef __ASSEMBLY__ 406 static inline void dwarf_unwinder_init(void) 407 { 408 }
··· 189 */ 190 #define DWARF_ARCH_RA_REG 17 191 192 + #ifndef __ASSEMBLER__ 193 194 #include <linux/compiler.h> 195 #include <linux/bug.h> ··· 379 struct module *); 380 extern void module_dwarf_cleanup(struct module *); 381 382 + #endif /* !__ASSEMBLER__ */ 383 384 #define CFI_STARTPROC .cfi_startproc 385 #define CFI_ENDPROC .cfi_endproc ··· 402 #define CFI_REL_OFFSET CFI_IGNORE 403 #define CFI_UNDEFINED CFI_IGNORE 404 405 + #ifndef __ASSEMBLER__ 406 static inline void dwarf_unwinder_init(void) 407 { 408 }
+2 -2
arch/sh/include/asm/fpu.h
··· 2 #ifndef __ASM_SH_FPU_H 3 #define __ASM_SH_FPU_H 4 5 - #ifndef __ASSEMBLY__ 6 7 #include <asm/ptrace.h> 8 ··· 67 void float_raise(unsigned int flags); 68 int float_rounding_mode(void); 69 70 - #endif /* __ASSEMBLY__ */ 71 72 #endif /* __ASM_SH_FPU_H */
··· 2 #ifndef __ASM_SH_FPU_H 3 #define __ASM_SH_FPU_H 4 5 + #ifndef __ASSEMBLER__ 6 7 #include <asm/ptrace.h> 8 ··· 67 void float_raise(unsigned int flags); 68 int float_rounding_mode(void); 69 70 + #endif /* __ASSEMBLER__ */ 71 72 #endif /* __ASM_SH_FPU_H */
+4 -4
arch/sh/include/asm/ftrace.h
··· 7 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 8 #define FTRACE_SYSCALL_MAX NR_syscalls 9 10 - #ifndef __ASSEMBLY__ 11 extern void mcount(void); 12 13 #define MCOUNT_ADDR ((unsigned long)(mcount)) ··· 35 36 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr); 37 38 - #endif /* __ASSEMBLY__ */ 39 #endif /* CONFIG_FUNCTION_TRACER */ 40 41 - #ifndef __ASSEMBLY__ 42 43 /* arch/sh/kernel/return_address.c */ 44 extern void *return_address(unsigned int); ··· 53 static inline void arch_ftrace_nmi_exit(void) { } 54 #endif 55 56 - #endif /* __ASSEMBLY__ */ 57 58 #endif /* __ASM_SH_FTRACE_H */
··· 7 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 8 #define FTRACE_SYSCALL_MAX NR_syscalls 9 10 + #ifndef __ASSEMBLER__ 11 extern void mcount(void); 12 13 #define MCOUNT_ADDR ((unsigned long)(mcount)) ··· 35 36 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr); 37 38 + #endif /* __ASSEMBLER__ */ 39 #endif /* CONFIG_FUNCTION_TRACER */ 40 41 + #ifndef __ASSEMBLER__ 42 43 /* arch/sh/kernel/return_address.c */ 44 extern void *return_address(unsigned int); ··· 53 static inline void arch_ftrace_nmi_exit(void) { } 54 #endif 55 56 + #endif /* __ASSEMBLER__ */ 57 58 #endif /* __ASM_SH_FTRACE_H */
+2 -2
arch/sh/include/asm/mmu.h
··· 33 34 #define PMB_NO_ENTRY (-1) 35 36 - #ifndef __ASSEMBLY__ 37 #include <linux/errno.h> 38 #include <linux/threads.h> 39 #include <asm/page.h> ··· 102 return pmb_remap_caller(phys, size, prot, __builtin_return_address(0)); 103 } 104 105 - #endif /* __ASSEMBLY__ */ 106 107 #endif /* __MMU_H */
··· 33 34 #define PMB_NO_ENTRY (-1) 35 36 + #ifndef __ASSEMBLER__ 37 #include <linux/errno.h> 38 #include <linux/threads.h> 39 #include <asm/page.h> ··· 102 return pmb_remap_caller(phys, size, prot, __builtin_return_address(0)); 103 } 104 105 + #endif /* __ASSEMBLER__ */ 106 107 #endif /* __MMU_H */
+4 -4
arch/sh/include/asm/page.h
··· 30 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) 31 #endif 32 33 - #ifndef __ASSEMBLY__ 34 #include <asm/uncached.h> 35 36 extern unsigned long shm_align_mask; ··· 85 86 #define pte_pgprot(x) __pgprot(pte_val(x) & PTE_FLAGS_MASK) 87 88 - #endif /* !__ASSEMBLY__ */ 89 90 /* 91 * __MEMORY_START and SIZE are the physical addresses and size of RAM. ··· 126 #define ___va(x) ((x)+PAGE_OFFSET) 127 #endif 128 129 - #ifndef __ASSEMBLY__ 130 #define __pa(x) ___pa((unsigned long)x) 131 #define __va(x) (void *)___va((unsigned long)x) 132 - #endif /* !__ASSEMBLY__ */ 133 134 #ifdef CONFIG_UNCACHED_MAPPING 135 #if defined(CONFIG_29BIT)
··· 30 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) 31 #endif 32 33 + #ifndef __ASSEMBLER__ 34 #include <asm/uncached.h> 35 36 extern unsigned long shm_align_mask; ··· 85 86 #define pte_pgprot(x) __pgprot(pte_val(x) & PTE_FLAGS_MASK) 87 88 + #endif /* !__ASSEMBLER__ */ 89 90 /* 91 * __MEMORY_START and SIZE are the physical addresses and size of RAM. ··· 126 #define ___va(x) ((x)+PAGE_OFFSET) 127 #endif 128 129 + #ifndef __ASSEMBLER__ 130 #define __pa(x) ___pa((unsigned long)x) 131 #define __va(x) (void *)___va((unsigned long)x) 132 + #endif /* !__ASSEMBLER__ */ 133 134 #ifdef CONFIG_UNCACHED_MAPPING 135 #if defined(CONFIG_29BIT)
+2 -2
arch/sh/include/asm/pgtable.h
··· 17 #include <asm/page.h> 18 #include <asm/mmu.h> 19 20 - #ifndef __ASSEMBLY__ 21 #include <asm/addrspace.h> 22 #include <asm/fixmap.h> 23 ··· 28 extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; 29 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) 30 31 - #endif /* !__ASSEMBLY__ */ 32 33 /* 34 * Effective and physical address definitions, to aid with sign
··· 17 #include <asm/page.h> 18 #include <asm/mmu.h> 19 20 + #ifndef __ASSEMBLER__ 21 #include <asm/addrspace.h> 22 #include <asm/fixmap.h> 23 ··· 28 extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; 29 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) 30 31 + #endif /* !__ASSEMBLER__ */ 32 33 /* 34 * Effective and physical address definitions, to aid with sign
+4 -4
arch/sh/include/asm/pgtable_32.h
··· 170 (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | \ 171 _PAGE_DIRTY | _PAGE_SPECIAL) 172 173 - #ifndef __ASSEMBLY__ 174 175 #if defined(CONFIG_X2TLB) /* SH-X2 TLB */ 176 #define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \ ··· 287 __pgprot(0) 288 #endif 289 290 - #endif /* __ASSEMBLY__ */ 291 292 - #ifndef __ASSEMBLY__ 293 294 /* 295 * Certain architectures need to do special things when PTEs ··· 486 PTE_BIT_FUNC(low, swp_mkexclusive, |= _PAGE_SWP_EXCLUSIVE); 487 PTE_BIT_FUNC(low, swp_clear_exclusive, &= ~_PAGE_SWP_EXCLUSIVE); 488 489 - #endif /* __ASSEMBLY__ */ 490 #endif /* __ASM_SH_PGTABLE_32_H */
··· 170 (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | \ 171 _PAGE_DIRTY | _PAGE_SPECIAL) 172 173 + #ifndef __ASSEMBLER__ 174 175 #if defined(CONFIG_X2TLB) /* SH-X2 TLB */ 176 #define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE | \ ··· 287 __pgprot(0) 288 #endif 289 290 + #endif /* __ASSEMBLER__ */ 291 292 + #ifndef __ASSEMBLER__ 293 294 /* 295 * Certain architectures need to do special things when PTEs ··· 486 PTE_BIT_FUNC(low, swp_mkexclusive, |= _PAGE_SWP_EXCLUSIVE); 487 PTE_BIT_FUNC(low, swp_clear_exclusive, &= ~_PAGE_SWP_EXCLUSIVE); 488 489 + #endif /* __ASSEMBLER__ */ 490 #endif /* __ASM_SH_PGTABLE_32_H */
+2 -2
arch/sh/include/asm/processor.h
··· 5 #include <asm/cpu-features.h> 6 #include <asm/cache.h> 7 8 - #ifndef __ASSEMBLY__ 9 /* 10 * CPU type and hardware bug flags. Kept separately for each CPU. 11 * ··· 168 169 void select_idle_routine(void); 170 171 - #endif /* __ASSEMBLY__ */ 172 173 #include <asm/processor_32.h> 174
··· 5 #include <asm/cpu-features.h> 6 #include <asm/cache.h> 7 8 + #ifndef __ASSEMBLER__ 9 /* 10 * CPU type and hardware bug flags. Kept separately for each CPU. 11 * ··· 168 169 void select_idle_routine(void); 170 171 + #endif /* __ASSEMBLER__ */ 172 173 #include <asm/processor_32.h> 174
+2 -2
arch/sh/include/asm/smc37c93x.h
··· 67 #define UART_DLL 0x0 /* Divisor Latch (LS) */ 68 #define UART_DLM 0x2 /* Divisor Latch (MS) */ 69 70 - #ifndef __ASSEMBLY__ 71 typedef struct uart_reg { 72 volatile __u16 rbr; 73 volatile __u16 ier; ··· 78 volatile __u16 msr; 79 volatile __u16 scr; 80 } uart_reg; 81 - #endif /* ! __ASSEMBLY__ */ 82 83 /* Alias for Write Only Register */ 84
··· 67 #define UART_DLL 0x0 /* Divisor Latch (LS) */ 68 #define UART_DLM 0x2 /* Divisor Latch (MS) */ 69 70 + #ifndef __ASSEMBLER__ 71 typedef struct uart_reg { 72 volatile __u16 rbr; 73 volatile __u16 ier; ··· 78 volatile __u16 msr; 79 volatile __u16 scr; 80 } uart_reg; 81 + #endif /* ! __ASSEMBLER__ */ 82 83 /* Alias for Write Only Register */ 84
+1 -1
arch/sh/include/asm/suspend.h
··· 2 #ifndef _ASM_SH_SUSPEND_H 3 #define _ASM_SH_SUSPEND_H 4 5 - #ifndef __ASSEMBLY__ 6 #include <linux/notifier.h> 7 8 #include <asm/ptrace.h>
··· 2 #ifndef _ASM_SH_SUSPEND_H 3 #define _ASM_SH_SUSPEND_H 4 5 + #ifndef __ASSEMBLER__ 6 #include <linux/notifier.h> 7 8 #include <asm/ptrace.h>
+5 -5
arch/sh/include/asm/thread_info.h
··· 21 #define FAULT_CODE_PROT (1 << 3) /* protection fault */ 22 #define FAULT_CODE_USER (1 << 4) /* user-mode access */ 23 24 - #ifndef __ASSEMBLY__ 25 #include <asm/processor.h> 26 27 struct thread_info { ··· 49 /* 50 * macros/functions for gaining access to the thread information structure 51 */ 52 - #ifndef __ASSEMBLY__ 53 #define INIT_THREAD_INFO(tsk) \ 54 { \ 55 .task = &tsk, \ ··· 86 87 extern void init_thread_xstate(void); 88 89 - #endif /* __ASSEMBLY__ */ 90 91 /* 92 * Thread information flags ··· 144 */ 145 #define TS_USEDFPU 0x0002 /* FPU used by this task this quantum */ 146 147 - #ifndef __ASSEMBLY__ 148 149 #define TI_FLAG_FAULT_CODE_SHIFT 24 150 ··· 164 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT; 165 } 166 167 - #endif /* !__ASSEMBLY__ */ 168 #endif /* __ASM_SH_THREAD_INFO_H */
··· 21 #define FAULT_CODE_PROT (1 << 3) /* protection fault */ 22 #define FAULT_CODE_USER (1 << 4) /* user-mode access */ 23 24 + #ifndef __ASSEMBLER__ 25 #include <asm/processor.h> 26 27 struct thread_info { ··· 49 /* 50 * macros/functions for gaining access to the thread information structure 51 */ 52 + #ifndef __ASSEMBLER__ 53 #define INIT_THREAD_INFO(tsk) \ 54 { \ 55 .task = &tsk, \ ··· 86 87 extern void init_thread_xstate(void); 88 89 + #endif /* __ASSEMBLER__ */ 90 91 /* 92 * Thread information flags ··· 144 */ 145 #define TS_USEDFPU 0x0002 /* FPU used by this task this quantum */ 146 147 + #ifndef __ASSEMBLER__ 148 149 #define TI_FLAG_FAULT_CODE_SHIFT 24 150 ··· 164 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT; 165 } 166 167 + #endif /* !__ASSEMBLER__ */ 168 #endif /* __ASM_SH_THREAD_INFO_H */
+2 -2
arch/sh/include/asm/tlb.h
··· 2 #ifndef __ASM_SH_TLB_H 3 #define __ASM_SH_TLB_H 4 5 - #ifndef __ASSEMBLY__ 6 #include <linux/pagemap.h> 7 #include <asm-generic/tlb.h> 8 ··· 29 unsigned long address); 30 31 #endif /* CONFIG_MMU */ 32 - #endif /* __ASSEMBLY__ */ 33 #endif /* __ASM_SH_TLB_H */
··· 2 #ifndef __ASM_SH_TLB_H 3 #define __ASM_SH_TLB_H 4 5 + #ifndef __ASSEMBLER__ 6 #include <linux/pagemap.h> 7 #include <asm-generic/tlb.h> 8 ··· 29 unsigned long address); 30 31 #endif /* CONFIG_MMU */ 32 + #endif /* __ASSEMBLER__ */ 33 #endif /* __ASM_SH_TLB_H */
+2 -2
arch/sh/include/asm/types.h
··· 7 /* 8 * These aren't exported outside the kernel to avoid name space clashes 9 */ 10 - #ifndef __ASSEMBLY__ 11 12 typedef u16 insn_size_t; 13 typedef u32 reg_size_t; 14 15 - #endif /* __ASSEMBLY__ */ 16 #endif /* __ASM_SH_TYPES_H */
··· 7 /* 8 * These aren't exported outside the kernel to avoid name space clashes 9 */ 10 + #ifndef __ASSEMBLER__ 11 12 typedef u16 insn_size_t; 13 typedef u32 reg_size_t; 14 15 + #endif /* __ASSEMBLER__ */ 16 #endif /* __ASM_SH_TYPES_H */
+3 -3
arch/sh/include/mach-common/mach/romimage.h
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifdef __ASSEMBLY__ 3 4 /* do nothing here by default */ 5 6 - #else /* __ASSEMBLY__ */ 7 8 static inline void mmcif_update_progress(int nr) 9 { 10 } 11 12 - #endif /* __ASSEMBLY__ */
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifdef __ASSEMBLER__ 3 4 /* do nothing here by default */ 5 6 + #else /* __ASSEMBLER__ */ 7 8 static inline void mmcif_update_progress(int nr) 9 { 10 } 11 12 + #endif /* __ASSEMBLER__ */
+3 -3
arch/sh/include/mach-ecovec24/mach/romimage.h
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifdef __ASSEMBLY__ 3 4 /* EcoVec board specific boot code: 5 * converts the "partner-jet-script.txt" script into assembly ··· 22 1 : .long 0xa8000000 23 2 : 24 25 - #else /* __ASSEMBLY__ */ 26 27 /* Ecovec board specific information: 28 * ··· 45 __raw_writeb(1 << (nr - 1), PGDR); 46 } 47 48 - #endif /* __ASSEMBLY__ */
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifdef __ASSEMBLER__ 3 4 /* EcoVec board specific boot code: 5 * converts the "partner-jet-script.txt" script into assembly ··· 22 1 : .long 0xa8000000 23 2 : 24 25 + #else /* __ASSEMBLER__ */ 26 27 /* Ecovec board specific information: 28 * ··· 45 __raw_writeb(1 << (nr - 1), PGDR); 46 } 47 48 + #endif /* __ASSEMBLER__ */
+3 -3
arch/sh/include/mach-kfr2r09/mach/romimage.h
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifdef __ASSEMBLY__ 3 4 /* kfr2r09 board specific boot code: 5 * converts the "partner-jet-script.txt" script into assembly ··· 22 1: .long 0xa8000000 23 2: 24 25 - #else /* __ASSEMBLY__ */ 26 27 static inline void mmcif_update_progress(int nr) 28 { 29 } 30 31 - #endif /* __ASSEMBLY__ */
··· 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifdef __ASSEMBLER__ 3 4 /* kfr2r09 board specific boot code: 5 * converts the "partner-jet-script.txt" script into assembly ··· 22 1: .long 0xa8000000 23 2: 24 25 + #else /* __ASSEMBLER__ */ 26 27 static inline void mmcif_update_progress(int nr) 28 { 29 } 30 31 + #endif /* __ASSEMBLER__ */