[processor-sdk/pdk.git] / packages / ti / transport / ndk / nimu / example / helloWorld / src / nimu_osal_omapl13x.h
1 /****************************************************************************
2 * Copyright (c) 2017 - 2018 Texas Instruments Incorporated - http://www.ti.com
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the
13 * distribution.
14 *
15 * Neither the name of Texas Instruments Incorporated nor the names of
16 * its contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 *****************************************************************************/
33 /*
34 * @file nimu_osal_omapl137.h
35 *
36 * @brief
37 * This file implements the OSAL layer for OMAPL13x SOC
38 *
39 */
41 #include <stdio.h>
42 #include <string.h>
43 #include <stdlib.h>
44 #include <stdint.h>
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
50 uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment);
52 void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes);
54 void Osal_platformSpiCsEnter(void);
56 void Osal_platformSpiCsExit (void);
58 void
59 Osal_beginMemAccess
60 (
61 void* addr,
62 Uint32 size
63 );
65 void
66 Osal_endMemAccess
67 (
68 void* addr,
69 Uint32 size
70 );
72 void
73 Osal_enterSingleCoreCriticalSection
74 (
75 Uint32 port_num
76 );
78 void
79 Osal_exitSingleCoreCriticalSection
80 (
81 Uint32 port_num
82 );
84 void
85 Osal_enterMultipleCoreCriticalSection
86 (
87 Uint32 port_num
88 );
90 void
91 Osal_exitMultipleCoreCriticalSection
92 (
93 Uint32 port_num
94 );
96 void* Osal_malloc
97 (
98 Uint32 num_bytes
99 );
101 void
102 Osal_free
103 (
104 void* ptr,
105 Uint32 num_bytes
106 );
108 uint32_t Convert_CoreLocal2GlobalAddr (uint32_t addr);
110 #ifdef __cplusplus
111 }
112 #endif