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

microblaze: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi 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: Michal Simek <monstr@monstr.eu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20250314071013.1575167-19-thuth@redhat.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

authored by

Thomas Huth and committed by
Michal Simek
438f7cd4 f0bff4e4

+43 -43
+1 -1
arch/microblaze/include/asm/asm-compat.h
··· 4 4 5 5 #include <asm/types.h> 6 6 7 - #ifdef __ASSEMBLY__ 7 + #ifdef __ASSEMBLER__ 8 8 # define stringify_in_c(...) __VA_ARGS__ 9 9 # define ASM_CONST(x) x 10 10 #else
+2 -2
arch/microblaze/include/asm/current.h
··· 14 14 * but check asm/microblaze/kernel/entry.S to be sure. 15 15 */ 16 16 #define CURRENT_TASK r31 17 - # ifndef __ASSEMBLY__ 17 + # ifndef __ASSEMBLER__ 18 18 /* 19 19 * Dedicate r31 to keeping the current task pointer 20 20 */ 21 21 register struct task_struct *current asm("r31"); 22 22 23 23 # define get_current() current 24 - # endif /* __ASSEMBLY__ */ 24 + # endif /* __ASSEMBLER__ */ 25 25 26 26 #endif /* _ASM_MICROBLAZE_CURRENT_H */
+2 -2
arch/microblaze/include/asm/entry.h
··· 21 21 22 22 #define PER_CPU(var) var 23 23 24 - # ifndef __ASSEMBLY__ 24 + # ifndef __ASSEMBLER__ 25 25 DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */ 26 26 DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */ 27 27 DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */ ··· 29 29 DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ 30 30 31 31 extern asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall); 32 - # endif /* __ASSEMBLY__ */ 32 + # endif /* __ASSEMBLER__ */ 33 33 34 34 #endif /* _ASM_MICROBLAZE_ENTRY_H */
+2 -2
arch/microblaze/include/asm/exceptions.h
··· 11 11 #define _ASM_MICROBLAZE_EXCEPTIONS_H 12 12 13 13 #ifdef __KERNEL__ 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 /* Macros to enable and disable HW exceptions in the MSR */ 17 17 /* Define MSR enable bit for HW exceptions */ ··· 64 64 void die(const char *str, struct pt_regs *fp, long err); 65 65 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 66 66 67 - #endif /*__ASSEMBLY__ */ 67 + #endif /*__ASSEMBLER__ */ 68 68 #endif /* __KERNEL__ */ 69 69 #endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
+2 -2
arch/microblaze/include/asm/fixmap.h
··· 15 15 #ifndef _ASM_FIXMAP_H 16 16 #define _ASM_FIXMAP_H 17 17 18 - #ifndef __ASSEMBLY__ 18 + #ifndef __ASSEMBLER__ 19 19 #include <linux/kernel.h> 20 20 #include <asm/page.h> 21 21 #ifdef CONFIG_HIGHMEM ··· 62 62 63 63 #include <asm-generic/fixmap.h> 64 64 65 - #endif /* !__ASSEMBLY__ */ 65 + #endif /* !__ASSEMBLER__ */ 66 66 #endif
+1 -1
arch/microblaze/include/asm/ftrace.h
··· 7 7 #define MCOUNT_ADDR ((unsigned long)(_mcount)) 8 8 #define MCOUNT_INSN_SIZE 8 /* sizeof mcount call */ 9 9 10 - #ifndef __ASSEMBLY__ 10 + #ifndef __ASSEMBLER__ 11 11 extern void _mcount(void); 12 12 extern void ftrace_call_graph(void); 13 13 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);
+2 -2
arch/microblaze/include/asm/kgdb.h
··· 3 3 #ifndef __MICROBLAZE_KGDB_H__ 4 4 #define __MICROBLAZE_KGDB_H__ 5 5 6 - #ifndef __ASSEMBLY__ 6 + #ifndef __ASSEMBLER__ 7 7 8 8 #define CACHE_FLUSH_IS_SAFE 1 9 9 #define BUFMAX 2048 ··· 27 27 struct pt_regs; 28 28 asmlinkage void microblaze_kgdb_break(struct pt_regs *regs); 29 29 30 - #endif /* __ASSEMBLY__ */ 30 + #endif /* __ASSEMBLER__ */ 31 31 #endif /* __MICROBLAZE_KGDB_H__ */ 32 32 #endif /* __KERNEL__ */
+2 -2
arch/microblaze/include/asm/mmu.h
··· 9 9 #define _ASM_MICROBLAZE_MMU_H 10 10 11 11 # ifdef __KERNEL__ 12 - # ifndef __ASSEMBLY__ 12 + # ifndef __ASSEMBLER__ 13 13 14 14 /* Default "unsigned long" context */ 15 15 typedef unsigned long mm_context_t; ··· 56 56 * mapping has to increase tlb_skip size. 57 57 */ 58 58 extern u32 tlb_skip; 59 - # endif /* __ASSEMBLY__ */ 59 + # endif /* __ASSEMBLER__ */ 60 60 61 61 /* 62 62 * The MicroBlaze processor has a TLB architecture identical to PPC-40x. The
+4 -4
arch/microblaze/include/asm/page.h
··· 25 25 26 26 #define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */ 27 27 28 - #ifndef __ASSEMBLY__ 28 + #ifndef __ASSEMBLER__ 29 29 30 30 /* 31 31 * PAGE_OFFSET -- the first address of the first page of memory. With MMU ··· 100 100 # define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) 101 101 102 102 # define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT) 103 - # endif /* __ASSEMBLY__ */ 103 + # endif /* __ASSEMBLER__ */ 104 104 105 105 /* Convert between virtual and physical address for MMU. */ 106 106 /* Handle MicroBlaze processor with virtual memory. */ ··· 113 113 #define tovirt(rd, rs) \ 114 114 addik rd, rs, (CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR) 115 115 116 - #ifndef __ASSEMBLY__ 116 + #ifndef __ASSEMBLER__ 117 117 118 118 # define __pa(x) __virt_to_phys((unsigned long)(x)) 119 119 # define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) ··· 130 130 131 131 #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr))) 132 132 133 - #endif /* __ASSEMBLY__ */ 133 + #endif /* __ASSEMBLER__ */ 134 134 135 135 #define TOPHYS(addr) __virt_to_phys(addr) 136 136
+9 -9
arch/microblaze/include/asm/pgtable.h
··· 10 10 11 11 #include <asm/setup.h> 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 extern int mem_init_done; 15 15 #endif 16 16 17 17 #include <asm-generic/pgtable-nopmd.h> 18 18 19 19 #ifdef __KERNEL__ 20 - #ifndef __ASSEMBLY__ 20 + #ifndef __ASSEMBLER__ 21 21 22 22 #include <linux/sched.h> 23 23 #include <linux/threads.h> ··· 39 39 #define VMALLOC_START (CONFIG_KERNEL_START + CONFIG_LOWMEM_SIZE) 40 40 #define VMALLOC_END ioremap_bot 41 41 42 - #endif /* __ASSEMBLY__ */ 42 + #endif /* __ASSEMBLER__ */ 43 43 44 44 /* 45 45 * Macro to mark a page protection value as "uncacheable". ··· 208 208 * Also, write permissions imply read permissions. 209 209 */ 210 210 211 - #ifndef __ASSEMBLY__ 211 + #ifndef __ASSEMBLER__ 212 212 /* 213 213 * ZERO_PAGE is a global shared page that is always zero: used 214 214 * for zero-mapped memory areas etc.. ··· 216 216 extern unsigned long empty_zero_page[1024]; 217 217 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) 218 218 219 - #endif /* __ASSEMBLY__ */ 219 + #endif /* __ASSEMBLER__ */ 220 220 221 221 #define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0) 222 222 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) ··· 237 237 #define pfn_pte(pfn, prot) \ 238 238 __pte(((pte_basic_t)(pfn) << PFN_PTE_SHIFT) | pgprot_val(prot)) 239 239 240 - #ifndef __ASSEMBLY__ 240 + #ifndef __ASSEMBLER__ 241 241 /* 242 242 * The following only work if pte_present() is true. 243 243 * Undefined behaviour if not.. ··· 436 436 437 437 asmlinkage void __init mmu_init(void); 438 438 439 - #endif /* __ASSEMBLY__ */ 439 + #endif /* __ASSEMBLER__ */ 440 440 #endif /* __KERNEL__ */ 441 441 442 - #ifndef __ASSEMBLY__ 442 + #ifndef __ASSEMBLER__ 443 443 extern unsigned long ioremap_bot, ioremap_base; 444 444 445 445 void setup_memory(void); 446 - #endif /* __ASSEMBLY__ */ 446 + #endif /* __ASSEMBLER__ */ 447 447 448 448 #endif /* _ASM_MICROBLAZE_PGTABLE_H */
+4 -4
arch/microblaze/include/asm/processor.h
··· 14 14 #include <asm/entry.h> 15 15 #include <asm/current.h> 16 16 17 - # ifndef __ASSEMBLY__ 17 + # ifndef __ASSEMBLER__ 18 18 /* from kernel/cpu/mb.c */ 19 19 extern const struct seq_operations cpuinfo_op; 20 20 ··· 29 29 extern void ret_from_fork(void); 30 30 extern void ret_from_kernel_thread(void); 31 31 32 - # endif /* __ASSEMBLY__ */ 32 + # endif /* __ASSEMBLER__ */ 33 33 34 34 /* 35 35 * This is used to define STACK_TOP, and with MMU it must be below ··· 45 45 46 46 # define THREAD_KSP 0 47 47 48 - # ifndef __ASSEMBLY__ 48 + # ifndef __ASSEMBLER__ 49 49 50 50 /* If you change this, you must change the associated assembly-languages 51 51 * constants defined below, THREAD_*. ··· 88 88 extern struct dentry *of_debugfs_root; 89 89 #endif 90 90 91 - # endif /* __ASSEMBLY__ */ 91 + # endif /* __ASSEMBLER__ */ 92 92 #endif /* _ASM_MICROBLAZE_PROCESSOR_H */
+2 -2
arch/microblaze/include/asm/ptrace.h
··· 7 7 8 8 #include <uapi/asm/ptrace.h> 9 9 10 - #ifndef __ASSEMBLY__ 10 + #ifndef __ASSEMBLER__ 11 11 #define kernel_mode(regs) ((regs)->pt_mode) 12 12 #define user_mode(regs) (!kernel_mode(regs)) 13 13 ··· 20 20 return regs->r3; 21 21 } 22 22 23 - #endif /* __ASSEMBLY__ */ 23 + #endif /* __ASSEMBLER__ */ 24 24 #endif /* _ASM_MICROBLAZE_PTRACE_H */
+2 -2
arch/microblaze/include/asm/sections.h
··· 10 10 11 11 #include <asm-generic/sections.h> 12 12 13 - # ifndef __ASSEMBLY__ 13 + # ifndef __ASSEMBLER__ 14 14 extern char _ssbss[], _esbss[]; 15 15 extern unsigned long __ivt_start[], __ivt_end[]; 16 16 17 17 extern u32 _fdt_start[], _fdt_end[]; 18 18 19 - # endif /* !__ASSEMBLY__ */ 19 + # endif /* !__ASSEMBLER__ */ 20 20 #endif /* _ASM_MICROBLAZE_SECTIONS_H */
+2 -2
arch/microblaze/include/asm/setup.h
··· 9 9 10 10 #include <uapi/asm/setup.h> 11 11 12 - # ifndef __ASSEMBLY__ 12 + # ifndef __ASSEMBLER__ 13 13 extern char cmd_line[COMMAND_LINE_SIZE]; 14 14 15 15 extern char *klimit; ··· 25 25 void machine_halt(void); 26 26 void machine_power_off(void); 27 27 28 - # endif /* __ASSEMBLY__ */ 28 + # endif /* __ASSEMBLER__ */ 29 29 #endif /* _ASM_MICROBLAZE_SETUP_H */
+2 -2
arch/microblaze/include/asm/thread_info.h
··· 13 13 #define THREAD_SIZE (1 << THREAD_SHIFT) 14 14 #define THREAD_SIZE_ORDER 1 15 15 16 - #ifndef __ASSEMBLY__ 16 + #ifndef __ASSEMBLER__ 17 17 # include <linux/types.h> 18 18 # include <asm/processor.h> 19 19 ··· 86 86 } 87 87 88 88 /* thread information allocation */ 89 - #endif /* __ASSEMBLY__ */ 89 + #endif /* __ASSEMBLER__ */ 90 90 91 91 /* 92 92 * thread information flags
+2 -2
arch/microblaze/include/asm/unistd.h
··· 8 8 9 9 #include <uapi/asm/unistd.h> 10 10 11 - #ifndef __ASSEMBLY__ 11 + #ifndef __ASSEMBLER__ 12 12 13 13 /* #define __ARCH_WANT_OLD_READDIR */ 14 14 /* #define __ARCH_WANT_OLD_STAT */ ··· 33 33 #define __ARCH_WANT_SYS_VFORK 34 34 #define __ARCH_WANT_SYS_FORK 35 35 36 - #endif /* __ASSEMBLY__ */ 36 + #endif /* __ASSEMBLER__ */ 37 37 38 38 #endif /* _ASM_MICROBLAZE_UNISTD_H */
+2 -2
arch/microblaze/include/asm/xilinx_mb_manager.h
··· 5 5 #ifndef _XILINX_MB_MANAGER_H 6 6 #define _XILINX_MB_MANAGER_H 7 7 8 - # ifndef __ASSEMBLY__ 8 + # ifndef __ASSEMBLER__ 9 9 10 10 #include <linux/of_address.h> 11 11 ··· 21 21 void *priv, void (*reset_callback)(void *data)); 22 22 asmlinkage void xmb_inject_err(void); 23 23 24 - # endif /* __ASSEMBLY__ */ 24 + # endif /* __ASSEMBLER__ */ 25 25 26 26 /* Error injection offset */ 27 27 #define XMB_INJECT_ERR_OFFSET 0x200