ANDROID: rwsem: Export rwsem_waiter struct for loadable modules
The rwsem_waiter struct is needed in vendor hook alter_rwsem_list_add. It has parameter sem which is a struct rw_semaphore (already export in rwsem.h), inside the structure there is a wait_list to link "struct rwsem_waiter" items. The task information in each item of the wait_list is needed to be referenced in vendor loadable modules. Bug: 174902706 Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org> Change-Id: Ic7d21ffdd795eaa203989751d26f8b1f32134d8b
This commit is contained in:
@@ -55,6 +55,19 @@ struct rw_semaphore {
|
|||||||
ANDROID_VENDOR_DATA(1);
|
ANDROID_VENDOR_DATA(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum rwsem_waiter_type {
|
||||||
|
RWSEM_WAITING_FOR_WRITE,
|
||||||
|
RWSEM_WAITING_FOR_READ
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rwsem_waiter {
|
||||||
|
struct list_head list;
|
||||||
|
struct task_struct *task;
|
||||||
|
enum rwsem_waiter_type type;
|
||||||
|
unsigned long timeout;
|
||||||
|
unsigned long last_rowner;
|
||||||
|
};
|
||||||
|
|
||||||
/* In all implementations count != 0 means locked */
|
/* In all implementations count != 0 means locked */
|
||||||
static inline int rwsem_is_locked(struct rw_semaphore *sem)
|
static inline int rwsem_is_locked(struct rw_semaphore *sem)
|
||||||
{
|
{
|
||||||
|
@@ -346,18 +346,6 @@ void __init_rwsem(struct rw_semaphore *sem, const char *name,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(__init_rwsem);
|
EXPORT_SYMBOL(__init_rwsem);
|
||||||
|
|
||||||
enum rwsem_waiter_type {
|
|
||||||
RWSEM_WAITING_FOR_WRITE,
|
|
||||||
RWSEM_WAITING_FOR_READ
|
|
||||||
};
|
|
||||||
|
|
||||||
struct rwsem_waiter {
|
|
||||||
struct list_head list;
|
|
||||||
struct task_struct *task;
|
|
||||||
enum rwsem_waiter_type type;
|
|
||||||
unsigned long timeout;
|
|
||||||
unsigned long last_rowner;
|
|
||||||
};
|
|
||||||
#define rwsem_first_waiter(sem) \
|
#define rwsem_first_waiter(sem) \
|
||||||
list_first_entry(&sem->wait_list, struct rwsem_waiter, list)
|
list_first_entry(&sem->wait_list, struct rwsem_waiter, list)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user