Skip to content

Commit 438f7cd

Browse files
huthmichalsimek
authored andcommitted
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>
1 parent f0bff4e commit 438f7cd

17 files changed

Lines changed: 43 additions & 43 deletions

File tree

arch/microblaze/include/asm/asm-compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <asm/types.h>
66

7-
#ifdef __ASSEMBLY__
7+
#ifdef __ASSEMBLER__
88
# define stringify_in_c(...) __VA_ARGS__
99
# define ASM_CONST(x) x
1010
#else

arch/microblaze/include/asm/current.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
* but check asm/microblaze/kernel/entry.S to be sure.
1515
*/
1616
#define CURRENT_TASK r31
17-
# ifndef __ASSEMBLY__
17+
# ifndef __ASSEMBLER__
1818
/*
1919
* Dedicate r31 to keeping the current task pointer
2020
*/
2121
register struct task_struct *current asm("r31");
2222

2323
# define get_current() current
24-
# endif /* __ASSEMBLY__ */
24+
# endif /* __ASSEMBLER__ */
2525

2626
#endif /* _ASM_MICROBLAZE_CURRENT_H */

arch/microblaze/include/asm/entry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
#define PER_CPU(var) var
2323

24-
# ifndef __ASSEMBLY__
24+
# ifndef __ASSEMBLER__
2525
DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */
2626
DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */
2727
DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
2828
DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
2929
DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
3030

3131
extern asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall);
32-
# endif /* __ASSEMBLY__ */
32+
# endif /* __ASSEMBLER__ */
3333

3434
#endif /* _ASM_MICROBLAZE_ENTRY_H */

arch/microblaze/include/asm/exceptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define _ASM_MICROBLAZE_EXCEPTIONS_H
1212

1313
#ifdef __KERNEL__
14-
#ifndef __ASSEMBLY__
14+
#ifndef __ASSEMBLER__
1515

1616
/* Macros to enable and disable HW exceptions in the MSR */
1717
/* Define MSR enable bit for HW exceptions */
@@ -64,6 +64,6 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig);
6464
void die(const char *str, struct pt_regs *fp, long err);
6565
void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
6666

67-
#endif /*__ASSEMBLY__ */
67+
#endif /*__ASSEMBLER__ */
6868
#endif /* __KERNEL__ */
6969
#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */

arch/microblaze/include/asm/fixmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef _ASM_FIXMAP_H
1616
#define _ASM_FIXMAP_H
1717

18-
#ifndef __ASSEMBLY__
18+
#ifndef __ASSEMBLER__
1919
#include <linux/kernel.h>
2020
#include <asm/page.h>
2121
#ifdef CONFIG_HIGHMEM
@@ -62,5 +62,5 @@ extern void __set_fixmap(enum fixed_addresses idx,
6262

6363
#include <asm-generic/fixmap.h>
6464

65-
#endif /* !__ASSEMBLY__ */
65+
#endif /* !__ASSEMBLER__ */
6666
#endif

arch/microblaze/include/asm/ftrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define MCOUNT_ADDR ((unsigned long)(_mcount))
88
#define MCOUNT_INSN_SIZE 8 /* sizeof mcount call */
99

10-
#ifndef __ASSEMBLY__
10+
#ifndef __ASSEMBLER__
1111
extern void _mcount(void);
1212
extern void ftrace_call_graph(void);
1313
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);

arch/microblaze/include/asm/kgdb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef __MICROBLAZE_KGDB_H__
44
#define __MICROBLAZE_KGDB_H__
55

6-
#ifndef __ASSEMBLY__
6+
#ifndef __ASSEMBLER__
77

88
#define CACHE_FLUSH_IS_SAFE 1
99
#define BUFMAX 2048
@@ -27,6 +27,6 @@ static inline void arch_kgdb_breakpoint(void)
2727
struct pt_regs;
2828
asmlinkage void microblaze_kgdb_break(struct pt_regs *regs);
2929

30-
#endif /* __ASSEMBLY__ */
30+
#endif /* __ASSEMBLER__ */
3131
#endif /* __MICROBLAZE_KGDB_H__ */
3232
#endif /* __KERNEL__ */

arch/microblaze/include/asm/mmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define _ASM_MICROBLAZE_MMU_H
1010

1111
# ifdef __KERNEL__
12-
# ifndef __ASSEMBLY__
12+
# ifndef __ASSEMBLER__
1313

1414
/* Default "unsigned long" context */
1515
typedef unsigned long mm_context_t;
@@ -56,7 +56,7 @@ extern void _tlbia(void); /* invalidate all TLB entries */
5656
* mapping has to increase tlb_skip size.
5757
*/
5858
extern u32 tlb_skip;
59-
# endif /* __ASSEMBLY__ */
59+
# endif /* __ASSEMBLER__ */
6060

6161
/*
6262
* The MicroBlaze processor has a TLB architecture identical to PPC-40x. The

arch/microblaze/include/asm/page.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
2727

28-
#ifndef __ASSEMBLY__
28+
#ifndef __ASSEMBLER__
2929

3030
/*
3131
* PAGE_OFFSET -- the first address of the first page of memory. With MMU
@@ -100,7 +100,7 @@ extern int page_is_ram(unsigned long pfn);
100100
# define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
101101

102102
# define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
103-
# endif /* __ASSEMBLY__ */
103+
# endif /* __ASSEMBLER__ */
104104

105105
/* Convert between virtual and physical address for MMU. */
106106
/* Handle MicroBlaze processor with virtual memory. */
@@ -113,7 +113,7 @@ extern int page_is_ram(unsigned long pfn);
113113
#define tovirt(rd, rs) \
114114
addik rd, rs, (CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR)
115115

116-
#ifndef __ASSEMBLY__
116+
#ifndef __ASSEMBLER__
117117

118118
# define __pa(x) __virt_to_phys((unsigned long)(x))
119119
# define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
@@ -130,7 +130,7 @@ static inline const void *pfn_to_virt(unsigned long pfn)
130130

131131
#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
132132

133-
#endif /* __ASSEMBLY__ */
133+
#endif /* __ASSEMBLER__ */
134134

135135
#define TOPHYS(addr) __virt_to_phys(addr)
136136

arch/microblaze/include/asm/pgtable.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
#include <asm/setup.h>
1212

13-
#ifndef __ASSEMBLY__
13+
#ifndef __ASSEMBLER__
1414
extern int mem_init_done;
1515
#endif
1616

1717
#include <asm-generic/pgtable-nopmd.h>
1818

1919
#ifdef __KERNEL__
20-
#ifndef __ASSEMBLY__
20+
#ifndef __ASSEMBLER__
2121

2222
#include <linux/sched.h>
2323
#include <linux/threads.h>
@@ -39,7 +39,7 @@ extern pte_t *va_to_pte(unsigned long address);
3939
#define VMALLOC_START (CONFIG_KERNEL_START + CONFIG_LOWMEM_SIZE)
4040
#define VMALLOC_END ioremap_bot
4141

42-
#endif /* __ASSEMBLY__ */
42+
#endif /* __ASSEMBLER__ */
4343

4444
/*
4545
* Macro to mark a page protection value as "uncacheable".
@@ -208,15 +208,15 @@ extern pte_t *va_to_pte(unsigned long address);
208208
* Also, write permissions imply read permissions.
209209
*/
210210

211-
#ifndef __ASSEMBLY__
211+
#ifndef __ASSEMBLER__
212212
/*
213213
* ZERO_PAGE is a global shared page that is always zero: used
214214
* for zero-mapped memory areas etc..
215215
*/
216216
extern unsigned long empty_zero_page[1024];
217217
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
218218

219-
#endif /* __ASSEMBLY__ */
219+
#endif /* __ASSEMBLER__ */
220220

221221
#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
222222
#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
@@ -237,7 +237,7 @@ extern unsigned long empty_zero_page[1024];
237237
#define pfn_pte(pfn, prot) \
238238
__pte(((pte_basic_t)(pfn) << PFN_PTE_SHIFT) | pgprot_val(prot))
239239

240-
#ifndef __ASSEMBLY__
240+
#ifndef __ASSEMBLER__
241241
/*
242242
* The following only work if pte_present() is true.
243243
* Undefined behaviour if not..
@@ -436,13 +436,13 @@ extern int mem_init_done;
436436

437437
asmlinkage void __init mmu_init(void);
438438

439-
#endif /* __ASSEMBLY__ */
439+
#endif /* __ASSEMBLER__ */
440440
#endif /* __KERNEL__ */
441441

442-
#ifndef __ASSEMBLY__
442+
#ifndef __ASSEMBLER__
443443
extern unsigned long ioremap_bot, ioremap_base;
444444

445445
void setup_memory(void);
446-
#endif /* __ASSEMBLY__ */
446+
#endif /* __ASSEMBLER__ */
447447

448448
#endif /* _ASM_MICROBLAZE_PGTABLE_H */

0 commit comments

Comments
 (0)