Root/drivers/staging/csr/csr_framework_ext_types.h

1#ifndef CSR_FRAMEWORK_EXT_TYPES_H__
2#define CSR_FRAMEWORK_EXT_TYPES_H__
3/*****************************************************************************
4
5            (c) Cambridge Silicon Radio Limited 2010
6            All rights reserved and confidential information of CSR
7
8            Refer to LICENSE.txt included with this source for details
9            on the license terms.
10
11*****************************************************************************/
12
13#ifdef __KERNEL__
14#include <linux/kthread.h>
15#include <linux/semaphore.h>
16#else
17#include <pthread.h>
18#endif
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24
25#ifdef __KERNEL__
26
27struct CsrThread
28{
29    struct task_struct *thread_task;
30    char name[16];
31};
32
33struct CsrEvent
34{
35    /* wait_queue for waking the kernel thread */
36    wait_queue_head_t wakeup_q;
37    unsigned int wakeup_flag;
38};
39
40typedef struct CsrEvent CsrEventHandle;
41typedef struct semaphore CsrMutexHandle;
42typedef struct CsrThread CsrThreadHandle;
43
44#else /* __KERNEL __ */
45
46struct CsrEvent
47{
48    pthread_cond_t event;
49    pthread_mutex_t mutex;
50    u32 eventBits;
51};
52
53typedef struct CsrEvent CsrEventHandle;
54typedef pthread_mutex_t CsrMutexHandle;
55typedef pthread_t CsrThreadHandle;
56
57#endif /* __KERNEL__ */
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif
64

Archive Download this file



interactive