0
|
1 |
/*
|
|
2 |
* OsApiDepend.h
|
|
3 |
*
|
|
4 |
* Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* This program and the accompanying materials are made available under the
|
|
8 |
* terms of the Eclipse Public License v1.0 or BSD License which accompanies
|
|
9 |
* this distribution. The Eclipse Public License is available at
|
|
10 |
* http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.
|
|
11 |
*
|
|
12 |
* Redistribution and use in source and binary forms, with or without
|
|
13 |
* modification, are permitted provided that the following conditions
|
|
14 |
* are met:
|
|
15 |
*
|
|
16 |
* * Redistributions of source code must retain the above copyright
|
|
17 |
* notice, this list of conditions and the following disclaimer.
|
|
18 |
* * Redistributions in binary form must reproduce the above copyright
|
|
19 |
* notice, this list of conditions and the following disclaimer in
|
|
20 |
* the documentation and/or other materials provided with the
|
|
21 |
* distribution.
|
|
22 |
* * Neither the name Texas Instruments nor the names of its
|
|
23 |
* contributors may be used to endorse or promote products derived
|
|
24 |
* from this software without specific prior written permission.
|
|
25 |
*
|
|
26 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
27 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
28 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
29 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
30 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
32 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
33 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
34 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
35 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37 |
*/
|
|
38 |
|
|
39 |
|
|
40 |
/*--------------------------------------------------------------------------*/
|
|
41 |
/* Module: OsApiDepend.h*/
|
|
42 |
/**/
|
|
43 |
/* Purpose: This module defines unified interface to the OS specific*/
|
|
44 |
/* sources and services.*/
|
|
45 |
/**/
|
|
46 |
/*--------------------------------------------------------------------------*/
|
|
47 |
|
|
48 |
#ifndef __OS_API_DEPEND_H__
|
|
49 |
#define __OS_API_DEPEND_H__
|
|
50 |
|
|
51 |
/** \file OsApiDepend.h
|
|
52 |
* \brief Operating System APIs that depend OS\n
|
|
53 |
* This module defines unified interface to the OS, that different between the OSs, the specific sources and services
|
|
54 |
*/
|
|
55 |
|
|
56 |
#include "tidef.h"
|
|
57 |
|
|
58 |
/** \brief OS IRQ Serviced
|
|
59 |
*
|
|
60 |
* \param OsContext - Handle to the OS object
|
|
61 |
* \return void
|
|
62 |
*
|
|
63 |
* \par Description
|
|
64 |
* This function is used in Level IRQ only. At this point the interrupt line is not asserted anymore
|
|
65 |
* and we can inform the OS to enable IRQ again.
|
|
66 |
*
|
|
67 |
* \sa
|
|
68 |
*/
|
|
69 |
void os_InterruptServiced (TI_HANDLE OsContext);
|
|
70 |
|
|
71 |
/** \brief OS Protect Lock
|
|
72 |
*
|
|
73 |
* \param OsContext - Handle to the OS object
|
|
74 |
* \param ProtectContext - Handle to the mutex/spin lock object
|
|
75 |
* \return void
|
|
76 |
*
|
|
77 |
* \par Description
|
|
78 |
* This function locks the mutex/spin lock object. E.g. the caller acquires a mutex/spin lock and gains exclusive
|
|
79 |
* access to the shared resources, that the mutex/spin lock protects of.
|
|
80 |
*
|
|
81 |
* \sa
|
|
82 |
*/
|
|
83 |
#define OS_ENTER_CRITICAL_SECTION(OsContext, ProtectContext)
|
|
84 |
|
|
85 |
|
|
86 |
/** \brief OS Protect Unlock
|
|
87 |
*
|
|
88 |
* \param OsContext - Handle to the OS object
|
|
89 |
* \param ProtectContext - Handle to the mutex/spin lock object
|
|
90 |
* \return void
|
|
91 |
*
|
|
92 |
* \par Description
|
|
93 |
* This function unlocks the mutex/spin lock object.
|
|
94 |
*
|
|
95 |
* \sa
|
|
96 |
*/
|
|
97 |
#define OS_LEAVE_CRITICAL_SECTION(OsContext, ProtectContext)
|
|
98 |
|
|
99 |
|
|
100 |
/** \brief OS Schedule Request
|
|
101 |
*
|
|
102 |
* \param OsContext - Handle to the OS object
|
|
103 |
* \return TI_NOK (1) that indicate to the DR to call the CB by himself
|
|
104 |
*
|
|
105 |
* \par Description
|
|
106 |
* in Symbian we dont have scheduling support
|
|
107 |
*
|
|
108 |
* \sa
|
|
109 |
*/
|
|
110 |
#define OS_REQUEST_SCHEDULE(OsContext) \
|
|
111 |
TI_NOK
|
|
112 |
|
|
113 |
/** \brief OS IRQ Serviced
|
|
114 |
*
|
|
115 |
* \param OsContext - Handle to the OS object
|
|
116 |
* \return void
|
|
117 |
*
|
|
118 |
* \par Description
|
|
119 |
* This function is used in Level IRQ only. At this point the interrupt line is not asserted anymore
|
|
120 |
* and we can inform the OS to enable IRQ again.
|
|
121 |
*
|
|
122 |
* \sa
|
|
123 |
*/
|
|
124 |
/* Mark that interrupt was serviced */
|
|
125 |
#define OS_INTERRUPT_SERVICED(OsContext) \
|
|
126 |
os_InterruptServiced (OsContext)
|
|
127 |
|
|
128 |
#endif
|