qcacmn: Add QDF wrappers for kernel atomic bit operations APIs

Add QDF wrappers for kernel atomic bit operations APIs.

Change-Id: If00b8434e60c516e89c6781eea459bc1931872df
CRs-Fixed: 2033255
This commit is contained in:
Hanumanth Reddy Pothula
2017-04-13 16:39:57 +05:30
committed by Sandeep Puligilla
parent 4a3a13d73e
commit fd65c6eabc
2 changed files with 182 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -151,4 +151,94 @@ static inline int32_t qdf_atomic_inc_return(qdf_atomic_t *v)
return __qdf_atomic_inc_return(v);
}
/**
* qdf_atomic_set_bit - Atomically set a bit in memory
* @nr: bit to set
* @addr: the address to start counting from
*
* Return: none
*/
static inline void qdf_atomic_set_bit(int nr, volatile unsigned long *addr)
{
__qdf_atomic_set_bit(nr, addr);
}
/**
* qdf_atomic_clear_bit - Atomically clear a bit in memory
* @nr: bit to clear
* @addr: the address to start counting from
*
* Return: none
*/
static inline void qdf_atomic_clear_bit(int nr, volatile unsigned long *addr)
{
__qdf_atomic_clear_bit(nr, addr);
}
/**
* qdf_atomic_change_bit - Atomically toggle a bit in memory
* from addr
* @nr: bit to change
* @addr: the address to start counting from
*
* Return: none
*/
static inline void qdf_atomic_change_bit(int nr, volatile unsigned long *addr)
{
__qdf_atomic_change_bit(nr, addr);
}
/**
* qdf_atomic_test_and_set_bit - Atomically set a bit and return its old value
* @nr: Bit to set
* @addr: the address to start counting from
*
* Return: return nr bit old value
*/
static inline int qdf_atomic_test_and_set_bit(int nr,
volatile unsigned long *addr)
{
return __qdf_atomic_test_and_set_bit(nr, addr);
}
/**
* qdf_atomic_test_and_clear_bit - Atomically clear a bit and return its old
* value
* @nr: bit to clear
* @addr: the address to start counting from
*
* Return: return nr bit old value
*/
static inline int qdf_atomic_test_and_clear_bit(int nr,
volatile unsigned long *addr)
{
return __qdf_atomic_test_and_clear_bit(nr, addr);
}
/**
* qdf_atomic_test_and_change_bit - Atomically toggle a bit and return its old
* value
* @nr: bit to change
* @addr: the address to start counting from
*
* Return: return nr bit old value
*/
static inline int qdf_atomic_test_and_change_bit(int nr,
volatile unsigned long *addr)
{
return __qdf_atomic_test_and_change_bit(nr, addr);
}
/**
* qdf_atomic_test_bit - Atomically get the nr-th bit value starting from addr
* @nr: bit to get
* @addr: the address to start counting from
*
* Return: return nr bit value
*/
static inline int qdf_atomic_test_bit(int nr, volatile unsigned long *addr)
{
return __qdf_atomic_test_bit(nr, addr);
}
#endif