m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
v2 cover m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
The kernel Makefiles define the __ASSEMBLY__ macro to provide a way to use headers in both, assembly and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro __ASSEMBLER__ automatically already when compiling assembly code, so some kernel headers are using __ASSEMBLER__ instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:
https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199
To avoid confusion in the future, it would make sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurances of __ASSEMBLY__ into __ASSEMBLER__.
I split the patches per architecture to ease the review, and I also split the uapi headers from the normal ones in case we decide that uapi needs to be treated differently from the normal headers here.
The x86, parisc and sh patches already got merged via their specific architecture tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefda
So I assume the m68k patches should go via the m68k tree.
v2:
- Split the m68k patches from the global series
(see https://lore.kernel.org/all/[email protected]/)
- Rebased the patches on linux-next and fixed the conflicts
and new occurances of __ASSEMBLY__
Thomas Huth (2):
m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
arch/m68k/include/asm/adb_iop.h | 4 ++-- arch/m68k/include/asm/bootinfo.h | 4 ++-- arch/m68k/include/asm/entry.h | 4 ++-- arch/m68k/include/asm/kexec.h | 4 ++-- arch/m68k/include/asm/mac_baboon.h | 4 ++-- arch/m68k/include/asm/mac_iop.h | 4 ++-- arch/m68k/include/asm/mac_oss.h | 4 ++-- arch/m68k/include/asm/mac_psc.h | 4 ++-- arch/m68k/include/asm/mac_via.h | 4 ++-- arch/m68k/include/asm/math-emu.h | 6 +++--- arch/m68k/include/asm/mcf_pgtable.h | 4 ++-- arch/m68k/include/asm/mcfmmu.h | 2 +- arch/m68k/include/asm/motorola_pgtable.h | 4 ++-- arch/m68k/include/asm/nettel.h | 4 ++-- arch/m68k/include/asm/openprom.h | 4 ++-- arch/m68k/include/asm/page.h | 4 ++-- arch/m68k/include/asm/page_mm.h | 4 ++-- arch/m68k/include/asm/page_no.h | 4 ++-- arch/m68k/include/asm/pgtable.h | 2 +- arch/m68k/include/asm/pgtable_mm.h | 8 ++++---- arch/m68k/include/asm/ptrace.h | 4 ++-- arch/m68k/include/asm/setup.h | 10 +++++----- arch/m68k/include/asm/sun3_pgtable.h | 8 ++++---- arch/m68k/include/asm/sun3mmu.h | 4 ++-- arch/m68k/include/asm/thread_info.h | 6 +++--- arch/m68k/include/asm/traps.h | 6 +++--- arch/m68k/include/uapi/asm/bootinfo-vme.h | 4 ++-- arch/m68k/include/uapi/asm/bootinfo.h | 8 ++++---- arch/m68k/include/uapi/asm/ptrace.h | 4 ++-- arch/m68k/math-emu/fp_emu.h | 8 ++++---- 30 files changed, 72 insertions(+), 72 deletions(-)
Signature · 1 line
2.49.0
PATCH v2 1/2 m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
From: Thomas Huth <[email protected]>
__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembly code.
This is a completely mechanical patch (done with a simple "sed -i" statement).
--- arch/m68k/include/uapi/asm/bootinfo-vme.h | 4 ++-- arch/m68k/include/uapi/asm/bootinfo.h | 8 ++++---- arch/m68k/include/uapi/asm/ptrace.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/include/uapi/asm/bootinfo-vme.h +2 -2
@@ -33,7 +33,7 @@#define VME_TYPE_BVME6000 0x6000/* BVM Ltd. BVME6000 */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Board ID data structure - pointer to this retrieved from Bug by head.S
@@ -56,7 +56,7 @@ typedef struct { __be32 option2; } t_bdid, *p_bdid; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /*
arch/m68k/include/uapi/asm/bootinfo.h +4 -4
@@ -16,7 +16,7 @@#include <linux/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Bootinfo definitions
@@ -43,7 +43,7 @@ struct mem_info { __be32 size; /* length of memory chunk (in bytes) */ }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /*
@@ -167,7 +167,7 @@ struct mem_info {#define BI_VERSION_MAJOR (v) (((v) >> 16) & 0xffff)#define BI_VERSION_MINOR (v) ((v) & 0xffff) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct bootversion { __be16 branch;
@@ -178,7 +178,7 @@ struct bootversion { } machversions[]; } __packed; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_ASM_M68K_BOOTINFO_H */
arch/m68k/include/uapi/asm/ptrace.h +2 -2
@@ -22,7 +22,7 @@#define PT_SR 17#define PT_PC 18 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* this struct defines the way the registers are stored on the stack during a system call. */
@@ -81,5 +81,5 @@ struct switch_stack {#define PTRACE_GETFDPIC_EXEC 0#define PTRACE_GETFDPIC_INTERP 1 -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_M68K_PTRACE_H */
Signature · 1 line
2.49.0
PATCH v2 2/2 m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
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 almost a completely mechanical patch (done with a simple "sed -i" statement), with one comment tweaked manually in arch/m68k/include/asm/mac_baboon.h (which was missing underscores).
--- arch/m68k/include/asm/adb_iop.h | 4 ++-- arch/m68k/include/asm/bootinfo.h | 4 ++-- arch/m68k/include/asm/entry.h | 4 ++-- arch/m68k/include/asm/kexec.h | 4 ++-- arch/m68k/include/asm/mac_baboon.h | 4 ++-- arch/m68k/include/asm/mac_iop.h | 4 ++-- arch/m68k/include/asm/mac_oss.h | 4 ++-- arch/m68k/include/asm/mac_psc.h | 4 ++-- arch/m68k/include/asm/mac_via.h | 4 ++-- arch/m68k/include/asm/math-emu.h | 6 +++--- arch/m68k/include/asm/mcf_pgtable.h | 4 ++-- arch/m68k/include/asm/mcfmmu.h | 2 +- arch/m68k/include/asm/motorola_pgtable.h | 4 ++-- arch/m68k/include/asm/nettel.h | 4 ++-- arch/m68k/include/asm/openprom.h | 4 ++-- arch/m68k/include/asm/page.h | 4 ++-- arch/m68k/include/asm/page_mm.h | 4 ++-- arch/m68k/include/asm/page_no.h | 4 ++-- arch/m68k/include/asm/pgtable.h | 2 +- arch/m68k/include/asm/pgtable_mm.h | 8 ++++---- arch/m68k/include/asm/ptrace.h | 4 ++-- arch/m68k/include/asm/setup.h | 10 +++++----- arch/m68k/include/asm/sun3_pgtable.h | 8 ++++---- arch/m68k/include/asm/sun3mmu.h | 4 ++-- arch/m68k/include/asm/thread_info.h | 6 +++--- arch/m68k/include/asm/traps.h | 6 +++--- arch/m68k/math-emu/fp_emu.h | 8 ++++---- 27 files changed, 64 insertions(+), 64 deletions(-)
arch/m68k/include/asm/adb_iop.h +2 -2
@@ -33,7 +33,7 @@#define ADB_IOP_SRQ 0x04/* SRQ detected */ #define ADB_IOP_TIMEOUT 0x02/* nonzero if timeout */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct adb_iopmsg { __u8 flags; /* ADB flags */
@@ -43,4 +43,4 @@ struct adb_iopmsg { __u8 spare[21]; /* spare */ }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */
arch/m68k/include/asm/bootinfo.h +2 -2
@@ -14,7 +14,7 @@#include <uapi/asm/bootinfo.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_BOOTINFO_PROC extern void save_bootinfo (const struct bi_record *bi);
@@ -28,7 +28,7 @@ void process_uboot_commandline(char *commandp, int size);static inline void process_uboot_commandline (char *commandp,int size) {}#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _M68K_BOOTINFO_H */
arch/m68k/include/asm/entry.h +2 -2
@@ -4,7 +4,7 @@#include <asm/setup.h> #include <asm/page.h> -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#include <asm/thread_info.h> #endif
@@ -41,7 +41,7 @@#define ALLOWINT (~0x700)#endif /* machine compilation types */ -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__/* * This defines the normal kernel pt-regs layout. *
arch/m68k/include/asm/kexec.h +2 -2
@@ -15,7 +15,7 @@#define KEXEC_ARCH KEXEC_ARCH_68K -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__static inline void crash_setup_regs (struct pt_regs *newregs,struct pt_regs *oldregs)
@@ -23,7 +23,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs,/* Dummy implementation for now */ } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* CONFIG_KEXEC_CORE */
arch/m68k/include/asm/mac_baboon.h +2 -2
@@ -5,7 +5,7 @@#define BABOON_BASE (0x50F1A000)/* same as IDE controller base */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct baboon { char pad1[208]; /* generic IDE registers, not used here */
@@ -36,4 +36,4 @@ extern void baboon_register_interrupts(void);extern void baboon_irq_enable (int );extern void baboon_irq_disable (int ); -#endif /* __ASSEMBLY **/ +#endif /* __ASSEMBLER__ */
arch/m68k/include/asm/mac_iop.h +2 -2
@@ -66,7 +66,7 @@#define IOP_ADDR_ALIVE 0x031F#define IOP_ADDR_RECV_MSG 0x0320 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * IOP Control registers, staggered because in usual Apple style they were
@@ -163,4 +163,4 @@ extern void iop_ism_irq_poll(uint);extern void iop_register_interrupts (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */
arch/m68k/include/asm/mac_oss.h +2 -2
@@ -59,7 +59,7 @@#define OSS_POWEROFF 0x80 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct mac_oss { __u8 irq_level[0x10]; /* [0x000-0x00f] Interrupt levels */
@@ -77,4 +77,4 @@ extern void oss_register_interrupts(void);extern void oss_irq_enable (int );extern void oss_irq_disable (int ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */
arch/m68k/include/asm/mac_psc.h +2 -2
@@ -207,7 +207,7 @@* Unknown, always 0x0000. */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern volatile __u8 *psc;
@@ -249,4 +249,4 @@ static inline u32 psc_read_long(int offset) return *((volatile __u32 *)(psc + offset)); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */
arch/m68k/include/asm/mac_via.h +2 -2
@@ -250,7 +250,7 @@#define IER_SET_BIT (b) (0x80 | (1<<(b)) )#define IER_CLR_BIT (b) (0x7F & (1<<(b)) ) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern volatile __u8 *via1,*via2;extern int rbv_present,via_alt_mapping;
@@ -267,6 +267,6 @@ extern void via1_irq(struct irq_desc *desc);extern void via1_set_head (int );extern int via2_scsi_drq_pending (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_MAC_VIA_H_ */
arch/m68k/include/asm/math-emu.h +3 -3
@@ -67,7 +67,7 @@#define PMUNIMPL (1<<PUNIMPL)#define PMMOVEM (1<<PMOVEM) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/kernel.h> #include <linux/sched.h>
@@ -127,7 +127,7 @@ extern unsigned int fp_debugprint;#define FPDATA ((struct fp_data *)current->thread.fp) -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ #define FPDATA %a2
@@ -311,6 +311,6 @@ old_gas=old_gas+1 .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_M68K_SETUP_H */
arch/m68k/include/asm/mcf_pgtable.h +2 -2
@@ -92,7 +92,7 @@#define PTE_MASK PAGE_MASK#define CF_PAGE_CHG_MASK (PTE_MASK | CF_PAGE_ACCESSED | CF_PAGE_DIRTY) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define pmd_pgtable (pmd) pfn_to_virt(pmd_val(pmd) >> PAGE_SHIFT)
@@ -292,5 +292,5 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)#define pfn_pte (pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))#define pte_pfn (pte) (pte_val(pte) >> PAGE_SHIFT) -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* _MCF_PGTABLE_H */
arch/m68k/include/asm/mcfmmu.h +1 -1
@@ -88,7 +88,7 @@#define MMUDR_PAN 10/* Physical address */ #define MMUDR_PAMASK 0xfffffc00/* PA mask */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Simple access functions for the MMU registers. Nothing fancy
arch/m68k/include/asm/motorola_pgtable.h +2 -2
@@ -44,7 +44,7 @@/* We borrow bit 11 to store the exclusive marker in swap PTEs. */ #define _PAGE_SWP_EXCLUSIVE 0x800 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* This is the cache mode to be used for pages containing page descriptors for * processors >= '040. It is in pte_mknocache(), and the variable is defined
@@ -202,5 +202,5 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)return pte; } -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* _MOTOROLA_PGTABLE_H */
arch/m68k/include/asm/nettel.h +2 -2
@@ -38,7 +38,7 @@#define NETtel_LEDADDR 0x30400000 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern volatile unsigned short ppdata;
@@ -80,7 +80,7 @@ static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)#define MCFPP_DTR0 0x0040#define MCFPP_DTR1 0x0000/* Port 1 no DTR support */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * These functions defined to give quasi generic access to the * PPIO bits used for DTR/DCD.
arch/m68k/include/asm/openprom.h +2 -2
@@ -21,7 +21,7 @@#define LINUX_OPPROM_MAGIC 0x10010407#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ /* V0 prom device operations. */ struct linux_dev_v0_funcs { int (*v0_devopen)(char *device_str);
@@ -308,6 +308,6 @@ struct linux_prom_ranges {unsigned int or_size; }; -#endif /* !(__ASSEMBLY__) */ +#endif /* !(__ASSEMBLER__) */ #endif /* !(__SPARC_OPENPROM_H) */
arch/m68k/include/asm/page.h +2 -2
@@ -10,7 +10,7 @@#define PAGE_OFFSET (PAGE_OFFSET_RAW) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * These are used to make use of C type-checking..
@@ -48,7 +48,7 @@ extern unsigned long _rambase;extern unsigned long _ramstart;extern unsigned long _ramend; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #ifdef CONFIG_MMU #include <asm/page_mm.h>
arch/m68k/include/asm/page_mm.h +2 -2
@@ -2,7 +2,7 @@#ifndef _M68K_PAGE_MM_H#define _M68K_PAGE_MM_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler.h> #include <asm/module.h>
@@ -144,6 +144,6 @@ extern int m68k_virt_to_node_shift;#define virt_addr_valid (kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)#define pfn_valid (pfn) virt_addr_valid(pfn_to_virt(pfn)) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _M68K_PAGE_MM_H */
arch/m68k/include/asm/page_no.h +2 -2
@@ -2,7 +2,7 @@#ifndef _M68K_PAGE_NO_H#define _M68K_PAGE_NO_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned long memory_start;extern unsigned long memory_end;
@@ -37,6 +37,6 @@ static inline void *pfn_to_virt(unsigned long pfn)#define ARCH_PFN_OFFSET PHYS_PFN(PAGE_OFFSET_RAW) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _M68K_PAGE_NO_H */
arch/m68k/include/asm/pgtable.h +1 -1
@@ -10,7 +10,7 @@#include <asm/pgtable_mm.h> #endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern void paging_init (void );#endif
arch/m68k/include/asm/pgtable_mm.h +4 -4
@@ -11,7 +11,7 @@#include <asm/setup.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/processor.h> #include <linux/sched.h> #include <linux/threads.h>
@@ -145,7 +145,7 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf,#define update_mmu_cache (vma, addr, ptep) \ update_mmu_cache_range(NULL, vma, addr, ptep, 1) -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ /* MMU-specific headers */
@@ -157,7 +157,7 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf,#include <asm/motorola_pgtable.h> #endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Macro to mark a page protection value as "uncacheable". */
@@ -182,6 +182,6 @@ pgprot_t pgprot_dmacoherent(pgprot_t prot);#define pgprot_dmacoherent (prot) pgprot_dmacoherent(prot)#endif /* CONFIG_COLDFIRE */ -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* _M68K_PGTABLE_H */
arch/m68k/include/asm/ptrace.h +2 -2
@@ -4,7 +4,7 @@#include <uapi/asm/ptrace.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifndef PS_S #define PS_S (0x2000)
@@ -24,5 +24,5 @@#define arch_has_block_step () (1)#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _M68K_PTRACE_H */
arch/m68k/include/asm/setup.h +5 -5
@@ -28,9 +28,9 @@#define CL_SIZE COMMAND_LINE_SIZE -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned long m68k_machtype; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #if !defined(CONFIG_AMIGA )# define MACH_IS_AMIGA (0)
@@ -199,7 +199,7 @@ extern unsigned long m68k_machtype;#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned long m68k_cputype;extern unsigned long m68k_fputype;extern unsigned long m68k_mmutype;
@@ -213,7 +213,7 @@ extern unsigned long vme_brdtype;*/ extern int m68k_is040or060; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #if !defined(CONFIG_M68020 )# define CPU_IS_020 (0)
@@ -321,7 +321,7 @@ extern int m68k_is040or060;#define NUM_MEMINFO 4 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct m68k_mem_info { unsigned long addr; /* physical address of memory chunk */ unsigned long size; /* length of memory chunk (in bytes) */
arch/m68k/include/asm/sun3_pgtable.h +4 -4
@@ -4,7 +4,7 @@#include <asm/sun3mmu.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/virtconvert.h> #include <linux/linkage.h>
@@ -19,7 +19,7 @@#define PTOV (addr) __va(addr) -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ /* These need to be defined for compatibility although the sun3 doesn't use them */ #define _PAGE_NOCACHE030 0x040
@@ -74,7 +74,7 @@/* We borrow bit 6 to store the exclusive marker in swap PTEs. */ #define _PAGE_SWP_EXCLUSIVE 0x040 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__static inline pte_t pte_modify (pte_t pte,pgprot_t newprot) {
@@ -186,5 +186,5 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)return pte; } -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* !_SUN3_PGTABLE_H */
arch/m68k/include/asm/sun3mmu.h +2 -2
@@ -67,7 +67,7 @@#define SUN3_BUSERR_PROTERR (0x40)#define SUN3_BUSERR_INVALID (0x80) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* Read bus error status register (implicitly clearing it). */ static inline unsigned char sun3_get_buserr (void )
@@ -167,6 +167,6 @@ extern void __iomem *sun3_ioremap(unsigned long phys, unsigned long size,extern int sun3_map_test (unsigned long addr,char *val); -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* !__SUN3_MMU_H__ */
arch/m68k/include/asm/thread_info.h +3 -3
@@ -22,7 +22,7 @@#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct thread_info { struct task_struct *task; /* main task structure */
@@ -31,7 +31,7 @@ struct thread_info {__u32 cpu;/* should always be 0 on m68k */ unsigned long tp_value;/* thread pointer */ }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #define INIT_THREAD_INFO (tsk) \ { \
@@ -39,7 +39,7 @@ struct thread_info { .preempt_count = INIT_PREEMPT_COUNT, \ } -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* how to get the thread information struct from C */ static inline struct thread_info *current_thread_info (void ) {
arch/m68k/include/asm/traps.h +3 -3
@@ -11,7 +11,7 @@#ifndef _M68K_TRAPS_H#define _M68K_TRAPS_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/linkage.h> #include <asm/ptrace.h>
@@ -94,7 +94,7 @@ asmlinkage void bad_inthandler(void);#define VECOFF (vec) ((vec)<<2) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* Status register bits */ #define PS_T (0x8000)
@@ -271,6 +271,6 @@ struct frame { asmlinkage void berr_040cleanup(struct frame *fp);#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _M68K_TRAPS_H */
arch/m68k/math-emu/fp_emu.h +4 -4
@@ -38,12 +38,12 @@#ifndef _FP_EMU_H#define _FP_EMU_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#include <asm/asm-offsets.h> #endif #include <asm/math-emu.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define IS_INF (a) ((a)->exp == 0x7fff)#define IS_ZERO (a) ((a)->mant.m64 == 0)
@@ -124,7 +124,7 @@ extern const struct fp_ext fp_Inf; : "a1", "d1", "d2", "memory"); \ }) -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ /* * set, reset or clear a bit in the fp status register
@@ -141,6 +141,6 @@ extern const struct fp_ext fp_Inf; btst #(\bit&7),(FPD_FPSR+3-(\bit/8),FPDATA) .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _FP_EMU_H */
Signature · 1 line
2.49.0
Hi Thomas,
Quoted 24 lines · Thomas Huth
The kernel Makefiles define the
__ASSEMBLY__macro to provide a way to use headers in both, assembly and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro__ASSEMBLER__automatically already when compiling assembly code, so some kernel headers are using__ASSEMBLER__instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199To avoid confusion in the future, it would make sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurances of
__ASSEMBLY__into__ASSEMBLER__.I split the patches per architecture to ease the review, and I also split the uapi headers from the normal ones in case we decide that uapi needs to be treated differently from the normal headers here.
The x86, parisc and sh patches already got merged via their specific architecture tree:
Quoted 7 lines
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefdaSo I assume the m68k patches should go via the m68k tree.
Looks good to me, for the whole series:
Thanks
Greg
Quoted 42 lines
v2:
- Split the m68k patches from the global series
(see https://lore.kernel.org/all/[email protected]/)
- Rebased the patches on linux-next and fixed the conflicts
and new occurances of__ASSEMBLY__Thomas Huth (2):
m68k: Replace__ASSEMBLY__with__ASSEMBLER__in uapi headers
m68k: Replace__ASSEMBLY__with__ASSEMBLER__in non-uapi headersarch/m68k/include/asm/adb_iop.h | 4 ++-- arch/m68k/include/asm/bootinfo.h | 4 ++-- arch/m68k/include/asm/entry.h | 4 ++-- arch/m68k/include/asm/kexec.h | 4 ++-- arch/m68k/include/asm/mac_baboon.h | 4 ++-- arch/m68k/include/asm/mac_iop.h | 4 ++-- arch/m68k/include/asm/mac_oss.h | 4 ++-- arch/m68k/include/asm/mac_psc.h | 4 ++-- arch/m68k/include/asm/mac_via.h | 4 ++-- arch/m68k/include/asm/math-emu.h | 6 +++--- arch/m68k/include/asm/mcf_pgtable.h | 4 ++-- arch/m68k/include/asm/mcfmmu.h | 2 +- arch/m68k/include/asm/motorola_pgtable.h | 4 ++-- arch/m68k/include/asm/nettel.h | 4 ++-- arch/m68k/include/asm/openprom.h | 4 ++-- arch/m68k/include/asm/page.h | 4 ++-- arch/m68k/include/asm/page_mm.h | 4 ++-- arch/m68k/include/asm/page_no.h | 4 ++-- arch/m68k/include/asm/pgtable.h | 2 +- arch/m68k/include/asm/pgtable_mm.h | 8 ++++---- arch/m68k/include/asm/ptrace.h | 4 ++-- arch/m68k/include/asm/setup.h | 10 +++++----- arch/m68k/include/asm/sun3_pgtable.h | 8 ++++---- arch/m68k/include/asm/sun3mmu.h | 4 ++-- arch/m68k/include/asm/thread_info.h | 6 +++--- arch/m68k/include/asm/traps.h | 6 +++--- arch/m68k/include/uapi/asm/bootinfo-vme.h | 4 ++-- arch/m68k/include/uapi/asm/bootinfo.h | 8 ++++---- arch/m68k/include/uapi/asm/ptrace.h | 4 ++-- arch/m68k/math-emu/fp_emu.h | 8 ++++---- 30 files changed, 72 insertions(+), 72 deletions(-)
Quoted 38 lines · Thomas Huth
The kernel Makefiles define the
__ASSEMBLY__macro to provide a way to use headers in both, assembly and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro__ASSEMBLER__automatically already when compiling assembly code, so some kernel headers are using__ASSEMBLER__instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199To avoid confusion in the future, it would make sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurances of
__ASSEMBLY__into__ASSEMBLER__.I split the patches per architecture to ease the review, and I also split the uapi headers from the normal ones in case we decide that uapi needs to be treated differently from the normal headers here.
The x86, parisc and sh patches already got merged via their specific architecture tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefdaSo I assume the m68k patches should go via the m68k tree.
v2:
- Split the m68k patches from the global series
(see https://lore.kernel.org/all/[email protected]/)
- Rebased the patches on linux-next and fixed the conflicts
and new occurances of__ASSEMBLY__
Quoted 3 lines
Thomas Huth (2):
m68k: Replace__ASSEMBLY__with__ASSEMBLER__in uapi headers
m68k: Replace__ASSEMBLY__with__ASSEMBLER__in non-uapi headers
i.e. will queue in the m68k tree for v6.17.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds