]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pdk_k2g_1_0_1/packages/ti/boot/sbl/board/sbl_common_osal.c
Add pdk folder
[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1 / packages / ti / boot / sbl / board / sbl_common_osal.c
1 /**
2  *   @file  GPIO_osal.c
3  *
4  *   @brief
5  *      This is the OS abstraction layer and is used by the GPIO application.
6  *
7  *  \par
8  */
10 /*
11  * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  *
17  * Redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer.
19  *
20  * Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in the
22  * documentation and/or other materials provided with the
23  * distribution.
24  *
25  * Neither the name of Texas Instruments Incorporated nor the names of
26  * its contributors may be used to endorse or promote products derived
27  * from this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
43 #ifndef COMMON_OSAL_PROTOTYPE
44 #define COMMON_OSAL_PROTOTYPE
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <stdint.h>
49 #include <ti/drv/uart/src/UART_osal.h>
50 #include <ti/drv/spi/src/SPI_osal.h>
52 /**********************************************************************
53  ************************** Local Definitions *************************
54  **********************************************************************/
57 /**********************************************************************
58  ************************** Global Variables **************************
59  **********************************************************************/
61 /**********************************************************************
62  **************************** OSAL Functions **************************
63  **********************************************************************/
65 /**
66  *  @b Description
67  *  @n
68  *      The function is used to create a critical section.
69  *
70  *    *  @param[in]  count
71  *      Semaphore count value
72  *
73  *    *  @param[in]  params
74  *
75  *  @retval
76  *      Semaphore Handle created
77  */
78 SemaphoreP_Handle SemaphoreP_create(uint32_t count,
79                                     SemaphoreP_Params *params)
80 {
81     return (void *) -1;
82 }
84 /**
85  *  @b Description
86  *  @n
87  *      The function is used to delete a critical section.
88  *
89  *  @param[in]  semHandle
90  *      Semaphore handle to be deleted
91  *
92  *  @retval
93  *      Not Applicable
94  */
95 SemaphoreP_Status SemaphoreP_delete(SemaphoreP_Handle handle)
96 {
97     return (SemaphoreP_OK);
98 }
101 /*!
102  *  @brief  Initialize params structure to default values.
103  *
104  *  The default parameters are:
105  *   - mode: SemOSAL_Mode_COUNTING
106  *   - name: NULL
107  *
108  *  @param params  Pointer to the instance configuration parameters.
109  */
110 void SemaphoreP_Params_init(SemaphoreP_Params *params)
115 /*!
116  *  @brief  Function to pend (wait) on a semaphore.
117  *
118  *  @param  handle  A SemOSAL_Handle returned from ::SemOSAL_create
119  *
120  *  @param  timeout Timeout (in milliseconds) to wait for the semaphore to
121  *                  be posted (signalled).
122  *
123  *  @return Status of the functions
124  *    - OSAL_OK: Obtain the semaphore
125  *    - OSAL_TIMEOUT: Timed out. Semaphore was not obtained.
126  */
127 SemaphoreP_Status SemaphoreP_pend(SemaphoreP_Handle handle, uint32_t timeout)
129     return (SemaphoreP_OK);
132 /*!
133  *  @brief  Function to post (signal) a semaphore.
134  *
135  *  @param  handle  A SemOSAL_Handle returned from ::SemOSAL_create
136  *
137  *  @return Status of the functions
138  *    - OSAL_OK: Released the semaphore
139  */
140 SemaphoreP_Status SemaphoreP_post(SemaphoreP_Handle handle)
142     return (SemaphoreP_OK);
145 /*!
146  *  @brief  Function to disable interrupts to enter a critical region
147  *
148  *  TODO more details
149  *
150  *  @return todo key
151  */
152 uintptr_t HwiP_disable(void)
154       return 0;
157 /*!
158  *  @brief  Function to restore interrupts to exit a critical region
159  *
160  *  TODO more details
161  *
162  *  @param  key
163  */
164 void HwiP_restore(uintptr_t key)
169 /*!
170  *  @brief  Function to deregister a interrupt
171  *
172  *  TODO more detail
173  *
174  *  @param  hwiPtr
175  *
176  *  @return
177  */
178 HwiP_Status HwiP_delete(HwiP_Handle handle)
180     return (HwiP_OK);
184 /*!
185  *  @brief  Function to register an interrupt
186  *
187  *  TODO more detail
188  *
189  *  @param  interruptNum
190  *
191  *  @param  eventID
192  *
193  *  @param  entry entry function of the hardware interrupt
194  *
195  *  @param  arg  argument passed into hte entry function
196  *
197  *  @param  priority
198  *
199  *  @return
200  */
201 HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn,
202                         HwiP_Params *params)
204     return (void *) -1;
207 /*!
208  *  @brief  Function to initialize hardware parameter structure.
209  *
210  *  @param  params pointer to the hardware parameters structure.
211  *
212  *  @return
213  */
214 void HwiP_Params_init(HwiP_Params *params)
216     params->name = NULL;
217     params->arg = 0;
218     params->priority = ~0;
221 /**
222  *  @b Description
223  *  @n
224  *      The function is used to disable specific hardware interrupt.
225  *
226  *  @param[in]  intrNum  number of hardware interrupt which should be disabled.
227  *
228  *  @retval
229  *      Not Applicable
230  */
231 /*
232  *  ======== HwiP_disableInterrupt ========
233  */
234 void HwiP_disableInterrupt(int32_t interruptNum)
239 /**
240  *  @b Description
241  *  @n
242  *      The function is used to enable specific hardware interrupt.
243  *
244  *  @param[in]  intrNum  number of hardware interrupt which should be enabled.
245  *
246  *  @retval
247  *      Not Applicable
248  */
249 /*
250  *  ======== HwiP_enableInterrupt ========
251  */
252 void HwiP_enableInterrupt(int32_t interruptNum)
257 void _DebugP_assert(int32_t expression, const char *file, int32_t line)
261 #endif  /* COMMON_OSAL_PROTOTYPE */