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

Merge tag 'arc-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:

- arch_atomic64_cmpxchg relaxed variant [Jason]

- use of inbuilt swap in stack unwinder [Yu-Chun Lin]

- use of __ASSEMBLER__ in kernel headers [Thomas Huth]

* tag 'arc-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
ARC: Replace __ASSEMBLY__ with __ASSEMBLER__ in the non-uapi headers
ARC: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
ARC: unwind: Use built-in sort swap to reduce code size and improve performance
ARC: atomics: Implement arch_atomic64_cmpxchg using _relaxed

+53 -67
+1 -1
arch/arc/include/asm/arcregs.h
··· 144 144 #define ARC_AUX_AGU_MOD2 0x5E2 145 145 #define ARC_AUX_AGU_MOD3 0x5E3 146 146 147 - #ifndef __ASSEMBLY__ 147 + #ifndef __ASSEMBLER__ 148 148 149 149 #include <soc/arc/arc_aux.h> 150 150
+2 -2
arch/arc/include/asm/atomic.h
··· 6 6 #ifndef _ASM_ARC_ATOMIC_H 7 7 #define _ASM_ARC_ATOMIC_H 8 8 9 - #ifndef __ASSEMBLY__ 9 + #ifndef __ASSEMBLER__ 10 10 11 11 #include <linux/types.h> 12 12 #include <linux/compiler.h> ··· 31 31 #include <asm/atomic64-arcv2.h> 32 32 #endif 33 33 34 - #endif /* !__ASSEMBLY__ */ 34 + #endif /* !__ASSEMBLER__ */ 35 35 36 36 #endif
+5 -10
arch/arc/include/asm/atomic64-arcv2.h
··· 137 137 #undef ATOMIC64_OP_RETURN 138 138 #undef ATOMIC64_OP 139 139 140 - static inline s64 141 - arch_atomic64_cmpxchg(atomic64_t *ptr, s64 expected, s64 new) 140 + static inline u64 __arch_cmpxchg64_relaxed(volatile void *ptr, u64 old, u64 new) 142 141 { 143 - s64 prev; 144 - 145 - smp_mb(); 142 + u64 prev; 146 143 147 144 __asm__ __volatile__( 148 145 "1: llockd %0, [%1] \n" ··· 149 152 " bnz 1b \n" 150 153 "2: \n" 151 154 : "=&r"(prev) 152 - : "r"(ptr), "ir"(expected), "r"(new) 153 - : "cc"); /* memory clobber comes from smp_mb() */ 154 - 155 - smp_mb(); 155 + : "r"(ptr), "ir"(old), "r"(new) 156 + : "memory", "cc"); 156 157 157 158 return prev; 158 159 } 159 - #define arch_atomic64_cmpxchg arch_atomic64_cmpxchg 160 + #define arch_cmpxchg64_relaxed __arch_cmpxchg64_relaxed 160 161 161 162 static inline s64 arch_atomic64_xchg(atomic64_t *ptr, s64 new) 162 163 {
+2 -2
arch/arc/include/asm/bitops.h
··· 10 10 #error only <linux/bitops.h> can be included directly 11 11 #endif 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 15 15 #include <linux/types.h> 16 16 #include <linux/compiler.h> ··· 192 192 #include <asm-generic/bitops/le.h> 193 193 #include <asm-generic/bitops/ext2-atomic-setbit.h> 194 194 195 - #endif /* !__ASSEMBLY__ */ 195 + #endif /* !__ASSEMBLER__ */ 196 196 197 197 #endif
+2 -2
arch/arc/include/asm/bug.h
··· 6 6 #ifndef _ASM_ARC_BUG_H 7 7 #define _ASM_ARC_BUG_H 8 8 9 - #ifndef __ASSEMBLY__ 9 + #ifndef __ASSEMBLER__ 10 10 11 11 #include <asm/ptrace.h> 12 12 ··· 29 29 30 30 #include <asm-generic/bug.h> 31 31 32 - #endif /* !__ASSEMBLY__ */ 32 + #endif /* !__ASSEMBLER__ */ 33 33 34 34 #endif
+2 -2
arch/arc/include/asm/cache.h
··· 23 23 */ 24 24 #define ARC_UNCACHED_ADDR_SPACE 0xc0000000 25 25 26 - #ifndef __ASSEMBLY__ 26 + #ifndef __ASSEMBLER__ 27 27 28 28 #include <linux/build_bug.h> 29 29 ··· 65 65 extern int ioc_enable; 66 66 extern unsigned long perip_base, perip_end; 67 67 68 - #endif /* !__ASSEMBLY__ */ 68 + #endif /* !__ASSEMBLER__ */ 69 69 70 70 /* Instruction cache related Auxiliary registers */ 71 71 #define ARC_REG_IC_BCR 0x77 /* Build Config reg */
+2 -2
arch/arc/include/asm/current.h
··· 9 9 #ifndef _ASM_ARC_CURRENT_H 10 10 #define _ASM_ARC_CURRENT_H 11 11 12 - #ifndef __ASSEMBLY__ 12 + #ifndef __ASSEMBLER__ 13 13 14 14 #ifdef CONFIG_ARC_CURR_IN_REG 15 15 ··· 20 20 #include <asm-generic/current.h> 21 21 #endif /* ! CONFIG_ARC_CURR_IN_REG */ 22 22 23 - #endif /* ! __ASSEMBLY__ */ 23 + #endif /* ! __ASSEMBLER__ */ 24 24 25 25 #endif /* _ASM_ARC_CURRENT_H */
+1 -1
arch/arc/include/asm/dsp-impl.h
··· 11 11 12 12 #define DSP_CTRL_DISABLED_ALL 0 13 13 14 - #ifdef __ASSEMBLY__ 14 + #ifdef __ASSEMBLER__ 15 15 16 16 /* clobbers r5 register */ 17 17 .macro DSP_EARLY_INIT
+2 -2
arch/arc/include/asm/dsp.h
··· 7 7 #ifndef __ASM_ARC_DSP_H 8 8 #define __ASM_ARC_DSP_H 9 9 10 - #ifndef __ASSEMBLY__ 10 + #ifndef __ASSEMBLER__ 11 11 12 12 /* 13 13 * DSP-related saved registers - need to be saved only when you are ··· 24 24 #endif 25 25 }; 26 26 27 - #endif /* !__ASSEMBLY__ */ 27 + #endif /* !__ASSEMBLER__ */ 28 28 29 29 #endif /* __ASM_ARC_DSP_H */
+2 -2
arch/arc/include/asm/dwarf.h
··· 6 6 #ifndef _ASM_ARC_DWARF_H 7 7 #define _ASM_ARC_DWARF_H 8 8 9 - #ifdef __ASSEMBLY__ 9 + #ifdef __ASSEMBLER__ 10 10 11 11 #ifdef ARC_DW2_UNWIND_AS_CFI 12 12 ··· 38 38 39 39 #endif /* !ARC_DW2_UNWIND_AS_CFI */ 40 40 41 - #endif /* __ASSEMBLY__ */ 41 + #endif /* __ASSEMBLER__ */ 42 42 43 43 #endif /* _ASM_ARC_DWARF_H */
+2 -2
arch/arc/include/asm/entry.h
··· 13 13 #include <asm/processor.h> /* For VMALLOC_START */ 14 14 #include <asm/mmu.h> 15 15 16 - #ifdef __ASSEMBLY__ 16 + #ifdef __ASSEMBLER__ 17 17 18 18 #ifdef CONFIG_ISA_ARCOMPACT 19 19 #include <asm/entry-compact.h> /* ISA specific bits */ ··· 146 146 147 147 #endif /* CONFIG_ARC_CURR_IN_REG */ 148 148 149 - #else /* !__ASSEMBLY__ */ 149 + #else /* !__ASSEMBLER__ */ 150 150 151 151 extern void do_signal(struct pt_regs *); 152 152 extern void do_notify_resume(struct pt_regs *);
+2 -2
arch/arc/include/asm/irqflags-arcv2.h
··· 50 50 #define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | __AD_ENB | \ 51 51 (ARCV2_IRQ_DEF_PRIO << 1)) 52 52 53 - #ifndef __ASSEMBLY__ 53 + #ifndef __ASSEMBLER__ 54 54 55 55 /* 56 56 * Save IRQ state and disable IRQs ··· 170 170 seti 171 171 .endm 172 172 173 - #endif /* __ASSEMBLY__ */ 173 + #endif /* __ASSEMBLER__ */ 174 174 175 175 #endif
+2 -2
arch/arc/include/asm/irqflags-compact.h
··· 40 40 41 41 #define ISA_INIT_STATUS_BITS STATUS_IE_MASK 42 42 43 - #ifndef __ASSEMBLY__ 43 + #ifndef __ASSEMBLER__ 44 44 45 45 /****************************************************************** 46 46 * IRQ Control Macros ··· 196 196 flag \scratch 197 197 .endm 198 198 199 - #endif /* __ASSEMBLY__ */ 199 + #endif /* __ASSEMBLER__ */ 200 200 201 201 #endif
+2 -2
arch/arc/include/asm/jump_label.h
··· 2 2 #ifndef _ASM_ARC_JUMP_LABEL_H 3 3 #define _ASM_ARC_JUMP_LABEL_H 4 4 5 - #ifndef __ASSEMBLY__ 5 + #ifndef __ASSEMBLER__ 6 6 7 7 #include <linux/stringify.h> 8 8 #include <linux/types.h> ··· 68 68 jump_label_t key; 69 69 }; 70 70 71 - #endif /* __ASSEMBLY__ */ 71 + #endif /* __ASSEMBLER__ */ 72 72 #endif
+3 -3
arch/arc/include/asm/linkage.h
··· 12 12 #define __ALIGN .align 4 13 13 #define __ALIGN_STR __stringify(__ALIGN) 14 14 15 - #ifdef __ASSEMBLY__ 15 + #ifdef __ASSEMBLER__ 16 16 17 17 .macro ST2 e, o, off 18 18 #ifdef CONFIG_ARC_HAS_LL64 ··· 61 61 CFI_ENDPROC ASM_NL \ 62 62 .size name, .-name 63 63 64 - #else /* !__ASSEMBLY__ */ 64 + #else /* !__ASSEMBLER__ */ 65 65 66 66 #ifdef CONFIG_ARC_HAS_ICCM 67 67 #define __arcfp_code __section(".text.arcfp") ··· 75 75 #define __arcfp_data __section(".data") 76 76 #endif 77 77 78 - #endif /* __ASSEMBLY__ */ 78 + #endif /* __ASSEMBLER__ */ 79 79 80 80 #endif
+2 -2
arch/arc/include/asm/mmu-arcv2.h
··· 69 69 70 70 #define PTE_BITS_NON_RWX_IN_PD1 (PAGE_MASK_PHYS | _PAGE_CACHEABLE) 71 71 72 - #ifndef __ASSEMBLY__ 72 + #ifndef __ASSEMBLER__ 73 73 74 74 struct mm_struct; 75 75 extern int pae40_exist_but_not_enab(void); ··· 100 100 sr \reg, [ARC_REG_PID] 101 101 .endm 102 102 103 - #endif /* !__ASSEMBLY__ */ 103 + #endif /* !__ASSEMBLER__ */ 104 104 105 105 #endif
+1 -1
arch/arc/include/asm/mmu.h
··· 6 6 #ifndef _ASM_ARC_MMU_H 7 7 #define _ASM_ARC_MMU_H 8 8 9 - #ifndef __ASSEMBLY__ 9 + #ifndef __ASSEMBLER__ 10 10 11 11 #include <linux/threads.h> /* NR_CPUS */ 12 12
+2 -2
arch/arc/include/asm/page.h
··· 19 19 20 20 #endif /* CONFIG_ARC_HAS_PAE40 */ 21 21 22 - #ifndef __ASSEMBLY__ 22 + #ifndef __ASSEMBLER__ 23 23 24 24 #define clear_page(paddr) memset((paddr), 0, PAGE_SIZE) 25 25 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) ··· 136 136 #include <asm-generic/memory_model.h> /* page_to_pfn, pfn_to_page */ 137 137 #include <asm-generic/getorder.h> 138 138 139 - #endif /* !__ASSEMBLY__ */ 139 + #endif /* !__ASSEMBLER__ */ 140 140 141 141 #endif
+2 -2
arch/arc/include/asm/pgtable-bits-arcv2.h
··· 75 75 * This is to enable COW mechanism 76 76 */ 77 77 /* xwr */ 78 - #ifndef __ASSEMBLY__ 78 + #ifndef __ASSEMBLER__ 79 79 80 80 #define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) 81 81 #define pte_dirty(pte) (pte_val(pte) & _PAGE_DIRTY) ··· 142 142 #include <asm/hugepage.h> 143 143 #endif 144 144 145 - #endif /* __ASSEMBLY__ */ 145 + #endif /* __ASSEMBLER__ */ 146 146 147 147 #endif
+2 -2
arch/arc/include/asm/pgtable-levels.h
··· 85 85 86 86 #define PTRS_PER_PTE BIT(PMD_SHIFT - PAGE_SHIFT) 87 87 88 - #ifndef __ASSEMBLY__ 88 + #ifndef __ASSEMBLER__ 89 89 90 90 #if CONFIG_PGTABLE_LEVELS > 3 91 91 #include <asm-generic/pgtable-nop4d.h> ··· 181 181 #define pmd_leaf(x) (pmd_val(x) & _PAGE_HW_SZ) 182 182 #endif 183 183 184 - #endif /* !__ASSEMBLY__ */ 184 + #endif /* !__ASSEMBLER__ */ 185 185 186 186 #endif
+2 -2
arch/arc/include/asm/pgtable.h
··· 19 19 */ 20 20 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 21 21 22 - #ifndef __ASSEMBLY__ 22 + #ifndef __ASSEMBLER__ 23 23 24 24 extern char empty_zero_page[PAGE_SIZE]; 25 25 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) ··· 29 29 /* to cope with aliasing VIPT cache */ 30 30 #define HAVE_ARCH_UNMAPPED_AREA 31 31 32 - #endif /* __ASSEMBLY__ */ 32 + #endif /* __ASSEMBLER__ */ 33 33 34 34 #endif
+2 -2
arch/arc/include/asm/processor.h
··· 11 11 #ifndef __ASM_ARC_PROCESSOR_H 12 12 #define __ASM_ARC_PROCESSOR_H 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 #include <asm/ptrace.h> 17 17 #include <asm/dsp.h> ··· 66 66 67 67 extern unsigned int __get_wchan(struct task_struct *p); 68 68 69 - #endif /* !__ASSEMBLY__ */ 69 + #endif /* !__ASSEMBLER__ */ 70 70 71 71 /* 72 72 * Default System Memory Map on ARC
+2 -2
arch/arc/include/asm/ptrace.h
··· 10 10 #include <uapi/asm/ptrace.h> 11 11 #include <linux/compiler.h> 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifndef __ASSEMBLER__ 14 14 15 15 typedef union { 16 16 struct { ··· 172 172 extern int syscall_trace_enter(struct pt_regs *); 173 173 extern void syscall_trace_exit(struct pt_regs *); 174 174 175 - #endif /* !__ASSEMBLY__ */ 175 + #endif /* !__ASSEMBLER__ */ 176 176 177 177 #endif /* __ASM_PTRACE_H */
+1 -1
arch/arc/include/asm/switch_to.h
··· 6 6 #ifndef _ASM_ARC_SWITCH_TO_H 7 7 #define _ASM_ARC_SWITCH_TO_H 8 8 9 - #ifndef __ASSEMBLY__ 9 + #ifndef __ASSEMBLER__ 10 10 11 11 #include <linux/sched.h> 12 12 #include <asm/dsp-impl.h>
+2 -2
arch/arc/include/asm/thread_info.h
··· 24 24 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 25 25 #define THREAD_SHIFT (PAGE_SHIFT << THREAD_SIZE_ORDER) 26 26 27 - #ifndef __ASSEMBLY__ 27 + #ifndef __ASSEMBLER__ 28 28 29 29 #include <linux/thread_info.h> 30 30 ··· 62 62 return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); 63 63 } 64 64 65 - #endif /* !__ASSEMBLY__ */ 65 + #endif /* !__ASSEMBLER__ */ 66 66 67 67 /* 68 68 * thread information flags
+2 -2
arch/arc/include/uapi/asm/ptrace.h
··· 14 14 15 15 #define PTRACE_GET_THREAD_AREA 25 16 16 17 - #ifndef __ASSEMBLY__ 17 + #ifndef __ASSEMBLER__ 18 18 /* 19 19 * Userspace ABI: Register state needed by 20 20 * -ptrace (gdbserver) ··· 53 53 unsigned long r30, r58, r59; 54 54 }; 55 55 56 - #endif /* !__ASSEMBLY__ */ 56 + #endif /* !__ASSEMBLER__ */ 57 57 58 58 #endif /* _UAPI__ASM_ARC_PTRACE_H */
+1 -10
arch/arc/kernel/unwind.c
··· 241 241 return (e1->start > e2->start) - (e1->start < e2->start); 242 242 } 243 243 244 - static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size) 245 - { 246 - struct eh_frame_hdr_table_entry *e1 = p1; 247 - struct eh_frame_hdr_table_entry *e2 = p2; 248 - 249 - swap(e1->start, e2->start); 250 - swap(e1->fde, e2->fde); 251 - } 252 - 253 244 static void init_unwind_hdr(struct unwind_table *table, 254 245 void *(*alloc) (unsigned long)) 255 246 { ··· 336 345 sort(header->table, 337 346 n, 338 347 sizeof(*header->table), 339 - cmp_eh_frame_hdr_table_entries, swap_eh_frame_hdr_table_entries); 348 + cmp_eh_frame_hdr_table_entries, NULL); 340 349 341 350 table->hdrsz = hdrSize; 342 351 smp_wmb();