Changeset 679 for GPL/trunk/include/asm


Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/asm/atomic.h

    r118 r679  
    4646#define atomic_clear_mask(mask, addr)
    4747
     48/**
     49 * atomic_add_return - add integer to atomic variable
     50 * @i: integer value to add
     51 * @v: pointer of type atomic_t
     52 *
     53 * Atomically adds @i to @v and returns the result
     54 */
     55static inline int atomic_add_return(int i, atomic_t *v)
     56{
     57        //unsigned long flags;
     58        int temp;
     59
     60        //raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */
     61        temp = v->counter;
     62        temp += i;
     63        v->counter = temp;
     64        //raw_local_irq_restore(flags);
     65
     66        return temp;
     67}
     68
     69/**
     70 * atomic_sub_return - subtract integer from atomic variable
     71 * @i: integer value to subtract
     72 * @v: pointer of type atomic_t
     73 *
     74 * Atomically subtracts @i from @v and returns the result
     75 */
     76static inline int atomic_sub_return(int i, atomic_t *v)
     77{
     78        //unsigned long flags;
     79        int temp;
     80
     81        //raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */
     82        temp = v->counter;
     83        temp -= i;
     84        v->counter = temp;
     85        //raw_local_irq_restore(flags);
     86
     87        return temp;
     88}
     89
    4890#define atomic_set_mask(mask, addr)
     91#define atomic_sub_and_test(i, v)       (atomic_sub_return((i), (v)) == 0)
     92#define atomic_inc_return(v)            atomic_add_return(1, (v))
    4993
     94typedef struct {
     95        long long counter;
     96} atomic64_t;
     97
     98typedef atomic64_t atomic_long_t;
    5099#endif
  • GPL/trunk/include/asm/bitops.h

    r442 r679  
    9393extern int __constant_test_bit(int nr, const volatile void * addr);
    9494extern int __test_bit(int nr, volatile void * addr);
    95 extern int find_first_zero_bit(void * addr, unsigned size);
    96 extern int find_next_zero_bit (void * addr, int size, int offset);
     95/**
     96 * find_first_zero_bit - find the first cleared bit in a memory region
     97 * @addr: The address to start the search at
     98 * @size: The maximum size to search
     99 *
     100 * Returns the bit number of the first cleared bit.
     101 */
     102extern unsigned long find_first_zero_bit(const unsigned long *addr,
     103                                         unsigned long size);
     104
     105/**
     106 * find_next_zero_bit - find the next cleared bit in a memory region
     107 * @addr: The address to base the search on
     108 * @offset: The bitnumber to start searching at
     109 * @size: The bitmap size in bits
     110 */
     111extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
     112                long size, unsigned long offset);
     113
    97114
    98115/*
     
    101118#define test_bit(nr, addr) (((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0)
    102119
     120extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
     121                size, unsigned long offset);
     122
    103123#endif /* _ASM_BITOPS_H */
  • GPL/trunk/include/asm/byteorder.h

    r305 r679  
    44#define _ASMi386_BYTEORDER_H
    55
     6#include <linux/byteorder/little_endian.h>
    67
    78#endif
  • GPL/trunk/include/asm/irq.h

    r32 r679  
    11#ifndef _ASM_IRQ_H
    22#define _ASM_IRQ_H
    3 
     3#include <linux/io.h>
    44void disable_irq(int irq);
    55
  • GPL/trunk/include/asm/page.h

    r442 r679  
    7171#define page_to_pfn(page)       (page_to_phys(page) >> PAGE_SHIFT)
    7272
     73/* Pure 2^n version of get_order */
     74static inline int get_order(unsigned long size)
     75{
     76        int order;
     77
     78        size = (size-1) >> (PAGE_SHIFT-1);
     79        order = -1;
     80        do {
     81                size >>= 1;
     82                order++;
     83        } while (size);
     84        return order;
     85}
     86
    7387#endif /* _I386_PAGE_H */
  • GPL/trunk/include/asm/system.h

    r442 r679  
    3737#define smp_rmb()       barrier()
    3838#define smp_wmb()       barrier()
    39 
     39#define smp_mb__after_atomic()  barrier()
    4040#endif
  • GPL/trunk/include/asm/uaccess.h

    r32 r679  
    4444int is_access_ok(int type, void *addr, unsigned long size);
    4545
    46 #define access_ok(type, addr, size)     is_access_ok((int)type, (void *)addr, size)
     46#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
     47
     48/*
     49 * The architecture should really override this if possible, at least
     50 * doing a check on the get_fs()
     51 */
     52static inline int __access_ok(unsigned long addr, unsigned long size)
     53{
     54        return 1;
     55}
    4756
    4857#define verify_area(type, addr, size) (access_ok(type, (void *)addr,size) ? 0 : -EFAULT)
     
    172181unsigned long __generic_copy_from_user(void *, const void *, unsigned long);
    173182
     183#if 0
    174184static __inline unsigned long
    175185__constant_copy_to_user(void *to, const void *from, unsigned long n)
     
    187197        return n;
    188198}
     199#endif
    189200
    190201static __inline unsigned long
  • GPL/trunk/include/asm/unaligned.h

    r598 r679  
    11#ifndef _ASM_UNALIGNED_H
    22#define _ASM_UNALIGNED_H
    3 
     3#  include <linux/unaligned/le_byteshift.h>
     4#  include <linux/unaligned/be_byteshift.h>
    45#endif
Note: See TracChangeset for help on using the changeset viewer.