diff options
author | Murali Krishna Dama | 2016-02-29 00:25:54 -0600 |
---|---|---|
committer | Murali Krishna Dama | 2016-02-29 02:38:22 -0600 |
commit | d252bf521c45aee657d38a90a4a02441b85f9c05 (patch) | |
tree | 50c6e4b865961b94cc2273d05e7c14b2070e8bc9 /src/pruicss_osal.h | |
parent | 4e914105bf3ad92607b8e54f3b496e59ae5f37d2 (diff) | |
download | pruss-lld-d252bf521c45aee657d38a90a4a02441b85f9c05.tar.gz pruss-lld-d252bf521c45aee657d38a90a4a02441b85f9c05.tar.xz pruss-lld-d252bf521c45aee657d38a90a4a02441b85f9c05.zip |
PRUSS: Relocate OSAL Header file
Signed-off-by: Murali Krishna Dama <dama.murali@ti.com>
Diffstat (limited to 'src/pruicss_osal.h')
-rw-r--r-- | src/pruicss_osal.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/src/pruicss_osal.h b/src/pruicss_osal.h new file mode 100644 index 0000000..40ad23a --- /dev/null +++ b/src/pruicss_osal.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /** | ||
2 | * @file pruicss_osal.h | ||
3 | * | ||
4 | * @brief | ||
5 | * This is the sample OS Adaptation layer which is used by the PRUICSS | ||
6 | * driver. The OSAL layer can be ported in either of the following | ||
7 | * manners to a native OS: | ||
8 | * | ||
9 | * <b> Approach 1: </b> | ||
10 | * @n Use Prebuilt Libraries | ||
11 | * - Ensure that the provide an implementation of all | ||
12 | * Osal_XXX API for their native OS. | ||
13 | * - Link the prebuilt libraries with their application. | ||
14 | * - Refer to the "example" directory for an example of this | ||
15 | * @n <b> Pros: </b> | ||
16 | * - Customers can reuse prebuilt TI provided libraries | ||
17 | * @n <b> Cons: </b> | ||
18 | * - Level of indirection in the API to get to the actual OS call | ||
19 | * | ||
20 | * <b> Approach 2: </b> | ||
21 | * @n Rebuilt Library | ||
22 | * - Create a copy of this file and modify it to directly | ||
23 | * inline the native OS calls | ||
24 | * - Rebuild the PRUICSS Driver library; ensure that the Include | ||
25 | * path points to the directory where the copy of this file | ||
26 | * has been provided. | ||
27 | * - Please refer to the "test" directory for an example of this | ||
28 | * @n <b> Pros: </b> | ||
29 | * - Optimizations can be done to remove the level of indirection | ||
30 | * @n <b> Cons: </b> | ||
31 | * - PRUICSS Libraries need to be rebuilt by the customer. | ||
32 | * | ||
33 | * \par | ||
34 | * NOTE: | ||
35 | * (C) Copyright 2015 Texas Instruments, Inc. | ||
36 | * | ||
37 | * Redistribution and use in source and binary forms, with or without | ||
38 | * modification, are permitted provided that the following conditions | ||
39 | * are met: | ||
40 | * | ||
41 | * Redistributions of source code must retain the above copyright | ||
42 | * notice, this list of conditions and the following disclaimer. | ||
43 | * | ||
44 | * Redistributions in binary form must reproduce the above copyright | ||
45 | * notice, this list of conditions and the following disclaimer in the | ||
46 | * documentation and/or other materials provided with the | ||
47 | * distribution. | ||
48 | * | ||
49 | * Neither the name of Texas Instruments Incorporated nor the names of | ||
50 | * its contributors may be used to endorse or promote products derived | ||
51 | * from this software without specific prior written permission. | ||
52 | * | ||
53 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
54 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
55 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
56 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
57 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
58 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
59 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
60 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
61 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
62 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
63 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
64 | * | ||
65 | * \par | ||
66 | */ | ||
67 | #ifndef PRUICSS_OSAL_H | ||
68 | #define PRUICSS_OSAL_H | ||
69 | |||
70 | #include <ti/osal/osal.h> | ||
71 | /********************************************************************** | ||
72 | ************************* Extern Declarations ************************ | ||
73 | **********************************************************************/ | ||
74 | |||
75 | /* #include <string.h> is here because there used to be | ||
76 | * memcpy/memset prototypes here. This #include prevents warnings in | ||
77 | * other code that unintentionally worked because of these prototypes | ||
78 | */ | ||
79 | #include <string.h> | ||
80 | |||
81 | |||
82 | #define PRUICSS_osalCreateBlockingLock(x,y) (SemaphoreP_create((x),(y))) | ||
83 | |||
84 | |||
85 | #define PRUICSS_osalDeleteBlockingLock(X) (SemaphoreP_delete(X)) | ||
86 | |||
87 | |||
88 | #define PRUICSS_osalSemParamsInit(x) (SemaphoreP_Params_init(x)) | ||
89 | |||
90 | |||
91 | #define PRUICSS_osalPendLock(X,Y) (SemaphoreP_pend((X),(Y))) | ||
92 | |||
93 | |||
94 | #define PRUICSS_osalPostLock(X) (SemaphoreP_post(X)) | ||
95 | |||
96 | |||
97 | #define PRUICSS_osalHardwareIntDisable() (HwiP_disable()) | ||
98 | |||
99 | |||
100 | #define PRUICSS_osalHardwareIntRestore(X) (HwiP_restore(X)) | ||
101 | |||
102 | |||
103 | #define PRUICSS_osalHardwareIntDestruct(X) (HwiP_delete(X)) | ||
104 | |||
105 | |||
106 | #define PRUICSS_osalRegisterInterrupt(X,Y,Z) (HwiP_create((X),(Y),(Z))) | ||
107 | |||
108 | |||
109 | #define PRUICSS_osalHwiParamsInit(X) (HwiP_Params_init(X)) | ||
110 | |||
111 | #define PRUICSS_WAIT_FOREVER (~(0U)) | ||
112 | #endif /* __PRUICSS_OSAL_H__ */ | ||
113 | |||
114 | |||