diff options
Diffstat (limited to 'kernel/arch/metag/include/asm')
-rw-r--r-- | kernel/arch/metag/include/asm/Kbuild | 3 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/atomic_lnkget.h | 40 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/atomic_lock1.h | 25 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/barrier.h | 6 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/cmpxchg.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/dma-mapping.h | 14 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/elf.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/ftrace.h | 2 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/highmem.h | 1 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/hugetlb.h | 13 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/io.h | 3 | ||||
-rw-r--r-- | kernel/arch/metag/include/asm/irq.h | 8 |
12 files changed, 34 insertions, 85 deletions
diff --git a/kernel/arch/metag/include/asm/Kbuild b/kernel/arch/metag/include/asm/Kbuild index 0bf5d525b..29acb89da 100644 --- a/kernel/arch/metag/include/asm/Kbuild +++ b/kernel/arch/metag/include/asm/Kbuild @@ -25,6 +25,7 @@ generic-y += kvm_para.h generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h +generic-y += mm-arch-hooks.h generic-y += msgbuf.h generic-y += mutex.h generic-y += param.h @@ -33,7 +34,6 @@ generic-y += percpu.h generic-y += poll.h generic-y += posix_types.h generic-y += preempt.h -generic-y += scatterlist.h generic-y += sections.h generic-y += sembuf.h generic-y += serial.h @@ -54,4 +54,5 @@ generic-y += ucontext.h generic-y += unaligned.h generic-y += user.h generic-y += vga.h +generic-y += word-at-a-time.h generic-y += xor.h diff --git a/kernel/arch/metag/include/asm/atomic_lnkget.h b/kernel/arch/metag/include/asm/atomic_lnkget.h index 948d86886..a62581815 100644 --- a/kernel/arch/metag/include/asm/atomic_lnkget.h +++ b/kernel/arch/metag/include/asm/atomic_lnkget.h @@ -3,7 +3,7 @@ #define ATOMIC_INIT(i) { (i) } -#define atomic_set(v, i) ((v)->counter = (i)) +#define atomic_set(v, i) WRITE_ONCE((v)->counter, (i)) #include <linux/compiler.h> @@ -74,44 +74,14 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \ ATOMIC_OPS(add) ATOMIC_OPS(sub) +ATOMIC_OP(and) +ATOMIC_OP(or) +ATOMIC_OP(xor) + #undef ATOMIC_OPS #undef ATOMIC_OP_RETURN #undef ATOMIC_OP -static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) -{ - int temp; - - asm volatile ( - "1: LNKGETD %0, [%1]\n" - " AND %0, %0, %2\n" - " LNKSETD [%1] %0\n" - " DEFR %0, TXSTAT\n" - " ANDT %0, %0, #HI(0x3f000000)\n" - " CMPT %0, #HI(0x02000000)\n" - " BNZ 1b\n" - : "=&d" (temp) - : "da" (&v->counter), "bd" (~mask) - : "cc"); -} - -static inline void atomic_set_mask(unsigned int mask, atomic_t *v) -{ - int temp; - - asm volatile ( - "1: LNKGETD %0, [%1]\n" - " OR %0, %0, %2\n" - " LNKSETD [%1], %0\n" - " DEFR %0, TXSTAT\n" - " ANDT %0, %0, #HI(0x3f000000)\n" - " CMPT %0, #HI(0x02000000)\n" - " BNZ 1b\n" - : "=&d" (temp) - : "da" (&v->counter), "bd" (mask) - : "cc"); -} - static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { int result, temp; diff --git a/kernel/arch/metag/include/asm/atomic_lock1.h b/kernel/arch/metag/include/asm/atomic_lock1.h index f5d5898c1..0295d9b8d 100644 --- a/kernel/arch/metag/include/asm/atomic_lock1.h +++ b/kernel/arch/metag/include/asm/atomic_lock1.h @@ -10,7 +10,7 @@ static inline int atomic_read(const atomic_t *v) { - return (v)->counter; + return READ_ONCE((v)->counter); } /* @@ -68,31 +68,14 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \ ATOMIC_OPS(add, +=) ATOMIC_OPS(sub, -=) +ATOMIC_OP(and, &=) +ATOMIC_OP(or, |=) +ATOMIC_OP(xor, ^=) #undef ATOMIC_OPS #undef ATOMIC_OP_RETURN #undef ATOMIC_OP -static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) -{ - unsigned long flags; - - __global_lock1(flags); - fence(); - v->counter &= ~mask; - __global_unlock1(flags); -} - -static inline void atomic_set_mask(unsigned int mask, atomic_t *v) -{ - unsigned long flags; - - __global_lock1(flags); - fence(); - v->counter |= mask; - __global_unlock1(flags); -} - static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { int ret; diff --git a/kernel/arch/metag/include/asm/barrier.h b/kernel/arch/metag/include/asm/barrier.h index d703d8e26..172b7e5ef 100644 --- a/kernel/arch/metag/include/asm/barrier.h +++ b/kernel/arch/metag/include/asm/barrier.h @@ -84,18 +84,18 @@ static inline void fence(void) #define read_barrier_depends() do { } while (0) #define smp_read_barrier_depends() do { } while (0) -#define set_mb(var, value) do { var = value; smp_mb(); } while (0) +#define smp_store_mb(var, value) do { WRITE_ONCE(var, value); smp_mb(); } while (0) #define smp_store_release(p, v) \ do { \ compiletime_assert_atomic_type(*p); \ smp_mb(); \ - ACCESS_ONCE(*p) = (v); \ + WRITE_ONCE(*p, v); \ } while (0) #define smp_load_acquire(p) \ ({ \ - typeof(*p) ___p1 = ACCESS_ONCE(*p); \ + typeof(*p) ___p1 = READ_ONCE(*p); \ compiletime_assert_atomic_type(*p); \ smp_mb(); \ ___p1; \ diff --git a/kernel/arch/metag/include/asm/cmpxchg.h b/kernel/arch/metag/include/asm/cmpxchg.h index b1bc1be85..be29e3e44 100644 --- a/kernel/arch/metag/include/asm/cmpxchg.h +++ b/kernel/arch/metag/include/asm/cmpxchg.h @@ -51,8 +51,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, return old; } -#define __HAVE_ARCH_CMPXCHG 1 - #define cmpxchg(ptr, o, n) \ ({ \ __typeof__(*(ptr)) _o_ = (o); \ diff --git a/kernel/arch/metag/include/asm/dma-mapping.h b/kernel/arch/metag/include/asm/dma-mapping.h index 14b23efd9..eb5cdec94 100644 --- a/kernel/arch/metag/include/asm/dma-mapping.h +++ b/kernel/arch/metag/include/asm/dma-mapping.h @@ -134,20 +134,24 @@ dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, } static inline void -dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nelems, enum dma_data_direction direction) { int i; - for (i = 0; i < nelems; i++, sg++) + struct scatterlist *sg; + + for_each_sg(sglist, sg, nelems, i) dma_sync_for_cpu(sg_virt(sg), sg->length, direction); } static inline void -dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, - enum dma_data_direction direction) +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, + int nelems, enum dma_data_direction direction) { int i; - for (i = 0; i < nelems; i++, sg++) + struct scatterlist *sg; + + for_each_sg(sglist, sg, nelems, i) dma_sync_for_device(sg_virt(sg), sg->length, direction); } diff --git a/kernel/arch/metag/include/asm/elf.h b/kernel/arch/metag/include/asm/elf.h index d2baf6961..87b0cf1e0 100644 --- a/kernel/arch/metag/include/asm/elf.h +++ b/kernel/arch/metag/include/asm/elf.h @@ -11,7 +11,7 @@ #define R_METAG_RELBRANCH 4 #define R_METAG_GETSETOFF 5 -/* Backward compatability */ +/* Backward compatibility */ #define R_METAG_REG32OP1 6 #define R_METAG_REG32OP2 7 #define R_METAG_REG32OP3 8 diff --git a/kernel/arch/metag/include/asm/ftrace.h b/kernel/arch/metag/include/asm/ftrace.h index 2901f0f7d..a2269d60a 100644 --- a/kernel/arch/metag/include/asm/ftrace.h +++ b/kernel/arch/metag/include/asm/ftrace.h @@ -6,7 +6,7 @@ #ifndef __ASSEMBLY__ extern void mcount_wrapper(void); -#define MCOUNT_ADDR ((long)(mcount_wrapper)) +#define MCOUNT_ADDR ((unsigned long)(mcount_wrapper)) static inline unsigned long ftrace_call_adjust(unsigned long addr) { diff --git a/kernel/arch/metag/include/asm/highmem.h b/kernel/arch/metag/include/asm/highmem.h index 6646a15c7..9b1d172cd 100644 --- a/kernel/arch/metag/include/asm/highmem.h +++ b/kernel/arch/metag/include/asm/highmem.h @@ -56,7 +56,6 @@ extern void kunmap(struct page *page); extern void *kmap_atomic(struct page *page); extern void __kunmap_atomic(void *kvaddr); extern void *kmap_atomic_pfn(unsigned long pfn); -extern struct page *kmap_atomic_to_page(void *ptr); #endif #endif diff --git a/kernel/arch/metag/include/asm/hugetlb.h b/kernel/arch/metag/include/asm/hugetlb.h index 471f481e6..905ed422d 100644 --- a/kernel/arch/metag/include/asm/hugetlb.h +++ b/kernel/arch/metag/include/asm/hugetlb.h @@ -14,10 +14,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, int prepare_hugepage_range(struct file *file, unsigned long addr, unsigned long len); -static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) -{ -} - static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, @@ -71,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) return *ptep; } -static inline int arch_prepare_hugepage(struct page *page) -{ - return 0; -} - -static inline void arch_release_hugepage(struct page *page) -{ -} - static inline void arch_clear_hugepage_flags(struct page *page) { } diff --git a/kernel/arch/metag/include/asm/io.h b/kernel/arch/metag/include/asm/io.h index d5779b0ec..9890f21ea 100644 --- a/kernel/arch/metag/include/asm/io.h +++ b/kernel/arch/metag/include/asm/io.h @@ -160,6 +160,9 @@ extern void __iounmap(void __iomem *addr); #define ioremap_wc(offset, size) \ __ioremap((offset), (size), _PAGE_WR_COMBINE) +#define ioremap_wt(offset, size) \ + __ioremap((offset), (size), 0) + #define iounmap(addr) \ __iounmap(addr) diff --git a/kernel/arch/metag/include/asm/irq.h b/kernel/arch/metag/include/asm/irq.h index ad6bd0edb..6ac6d4a05 100644 --- a/kernel/arch/metag/include/asm/irq.h +++ b/kernel/arch/metag/include/asm/irq.h @@ -6,8 +6,12 @@ extern void irq_ctx_init(int cpu); extern void irq_ctx_exit(int cpu); # define __ARCH_HAS_DO_SOFTIRQ #else -# define irq_ctx_init(cpu) do { } while (0) -# define irq_ctx_exit(cpu) do { } while (0) +static inline void irq_ctx_init(int cpu) +{ +} +static inline void irq_ctx_exit(int cpu) +{ +} #endif void tbi_startup_interrupt(int); |