1 #ifndef __WILC_platfrom_H__
2 #define __WILC_platfrom_H__
5 * @file wilc_platform.h
6 * @brief platform specific file for Linux port
8 * @sa wilc_oswrapper.h top level OS wrapper file
14 /******************************************************************
15 * Feature support checks
16 *******************************************************************/
18 /* CONFIG_WILC_THREAD_FEATURE is implemented */
20 /* remove the following block when implementing its feature */
21 #ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
22 #error This feature is not supported by this OS
25 /* remove the following block when implementing its feature */
26 #ifdef CONFIG_WILC_THREAD_STRICT_PRIORITY
27 #error This feature is not supported by this OS
30 /* CONFIG_WILC_SEMAPHORE_FEATURE is implemented */
32 /* remove the following block when implementing its feature
33 * #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
34 * #error This feature is not supported by this OS
37 /* CONFIG_WILC_SLEEP_FEATURE is implemented */
39 /* remove the following block when implementing its feature */
40 /* #ifdef CONFIG_WILC_SLEEP_HI_RES */
41 /* #error This feature is not supported by this OS */
44 /* CONFIG_WILC_TIMER_FEATURE is implemented */
46 /* CONFIG_WILC_TIMER_PERIODIC is implemented */
48 /* CONFIG_WILC_MEMORY_FEATURE is implemented */
50 /* remove the following block when implementing its feature */
51 #ifdef CONFIG_WILC_MEMORY_POOLS
52 #error This feature is not supported by this OS
55 /* remove the following block when implementing its feature */
56 #ifdef CONFIG_WILC_MEMORY_DEBUG
57 #error This feature is not supported by this OS
60 /* remove the following block when implementing its feature */
61 #ifdef CONFIG_WILC_ASSERTION_SUPPORT
62 #error This feature is not supported by this OS
65 /* CONFIG_WILC_STRING_UTILS is implemented */
67 /* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */
69 /* remove the following block when implementing its feature */
70 #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
71 #error This feature is not supported by this OS
74 /* remove the following block when implementing its feature */
75 /*#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
76 * #error This feature is not supported by this OS
79 /* CONFIG_WILC_FILE_OPERATIONS_FEATURE is implemented */
81 /* CONFIG_WILC_FILE_OPERATIONS_STRING_API is implemented */
83 /* remove the following block when implementing its feature */
84 #ifdef CONFIG_WILC_FILE_OPERATIONS_PATH_API
85 #error This feature is not supported by this OS
88 /* CONFIG_WILC_TIME_FEATURE is implemented */
90 /* remove the following block when implementing its feature */
91 #ifdef CONFIG_WILC_TIME_UTC_SINCE_1970
92 #error This feature is not supported by this OS
95 /* remove the following block when implementing its feature */
96 #ifdef CONFIG_WILC_TIME_CALENDER
97 #error This feature is not supported by this OS
100 /* remove the following block when implementing its feature */
101 #ifdef CONFIG_WILC_EVENT_FEATURE
102 #error This feature is not supported by this OS
105 /* remove the following block when implementing its feature */
106 #ifdef CONFIG_WILC_EVENT_TIMEOUT
107 #error This feature is not supported by this OS
110 /* CONFIG_WILC_MATH_OPERATIONS_FEATURE is implemented */
112 /* CONFIG_WILC_EXTENDED_FILE_OPERATIONS is implemented */
114 /* CONFIG_WILC_EXTENDED_STRING_OPERATIONS is implemented */
116 /* CONFIG_WILC_EXTENDED_TIME_OPERATIONS is implemented */
118 /* remove the following block when implementing its feature */
119 #ifdef CONFIG_WILC_SOCKET_FEATURE
120 #error This feature is not supported by this OS
123 /******************************************************************
124 * OS specific includes
125 *******************************************************************/
126 #define _XOPEN_SOURCE 600
128 #include <linux/kthread.h>
129 #include <linux/semaphore.h>
130 #include <linux/module.h>
131 #include <linux/slab.h>
132 #include <linux/kernel.h>
133 #include <linux/delay.h>
134 #include <linux/types.h>
135 #include <linux/stat.h>
136 #include <linux/time.h>
137 #include <linux/version.h>
138 #include "linux/string.h"
139 /******************************************************************
141 *******************************************************************/
143 typedef struct task_struct *WILC_ThreadHandle;
145 typedef void *WILC_MemoryPoolHandle;
146 typedef struct semaphore WILC_SemaphoreHandle;
148 typedef struct timer_list WILC_TimerHandle;
152 /* Message Queue type is a structure */
153 typedef struct __Message_struct {
155 WILC_Uint32 u32Length;
156 struct __Message_struct *pstrNext;
159 typedef struct __MessageQueue_struct {
160 WILC_SemaphoreHandle hSem;
161 spinlock_t strCriticalSection;
163 WILC_Uint32 u32ReceiversCount;
164 Message *pstrMessageList;
165 } WILC_MsgQueueHandle;
169 /*Time represented in 64 bit format*/
170 typedef time_t WILC_Time;
173 /*******************************************************************
175 ********************************************************************/
177 /* Generic printf function */
178 #define __WILC_FILE__ __FILE__
179 #define __WILC_FUNCTION__ __FUNCTION__
180 #define __WILC_LINE__ __LINE__