source: SVN/cambria/redboot/packages/devs/eth/intel/npe/osServices/current/src/IxOsServices.c @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 4.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief The file contains implementation for the OS service layer.
5 *
6 *
7 * @par
8 * IXP400 SW Release version 2.3
9 *
10 * -- Copyright Notice --
11 *
12 * @par
13 * Copyright (c) 2001-2005, Intel Corporation.
14 * All rights reserved.
15 *
16 * @par
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 *    notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 *    notice, this list of conditions and the following disclaimer in the
24 *    documentation and/or other materials provided with the distribution.
25 * 3. Neither the name of the Intel Corporation nor the names of its contributors
26 *    may be used to endorse or promote products derived from this software
27 *    without specific prior written permission.
28 *
29 *
30 * @par
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41 * SUCH DAMAGE.
42 *
43 *
44 * @par
45 * -- End of Copyright Notice --
46 */
47
48 
49#include "IxOsalBackward.h"
50
51PUBLIC IX_STATUS
52ixOsServIntBind (int level, void (*routine) (void *), void *parameter)
53{
54
55    return ixOsalIrqBind ((UINT32) level,
56        (IxOsalVoidFnVoidPtr) routine, parameter);
57}
58
59PUBLIC IX_STATUS
60ixOsServIntUnbind (int level)
61{
62    return ixOsalIrqUnbind ((UINT32) level);
63}
64
65PUBLIC int
66ixOsServIntLock (void)
67{
68    return ((int) ixOsalIrqLock ());
69}
70
71PUBLIC void
72ixOsServIntUnlock (int lockKey)
73{
74    ixOsalIrqUnlock ((UINT32) lockKey);
75}
76
77PUBLIC int
78ixOsServIntLevelSet (int level)
79{
80    return ((int) ixOsalIrqLevelSet ((UINT32) level));
81}
82
83PUBLIC IX_STATUS
84ixOsServMutexInit (IxMutex * mutex)
85{
86    return ixOsalMutexInit ((IxOsalMutex *) mutex);
87}
88
89PUBLIC IX_STATUS
90ixOsServMutexLock (IxMutex * mutex)
91{
92    return ixOsalMutexLock ((IxOsalMutex *) mutex, IX_OSAL_WAIT_NONE);
93}
94
95PUBLIC IX_STATUS
96ixOsServMutexUnlock (IxMutex * mutex)
97{
98    return ixOsalMutexUnlock ((IxOsalMutex *) mutex);
99}
100
101PUBLIC IX_STATUS
102ixOsServMutexDestroy (IxMutex * mutex)
103{
104    return ixOsalMutexDestroy ((IxOsalMutex *) mutex);
105}
106
107PUBLIC IX_STATUS
108ixOsServFastMutexInit (IxFastMutex * mutex)
109{
110    return ixOsalFastMutexInit ((IxOsalFastMutex *) mutex);
111}
112
113PUBLIC IX_STATUS
114ixOsServFastMutexTryLock (IxFastMutex * mutex)
115{
116    return ixOsalFastMutexTryLock ((IxOsalFastMutex *) mutex);
117}
118
119PUBLIC IX_STATUS
120ixOsServFastMutexUnlock (IxFastMutex * mutex)
121{
122    return ixOsalFastMutexUnlock ((IxOsalFastMutex *) mutex);
123}
124
125PUBLIC int
126ixOsServLog (int level, char *format, int arg1, int arg2, int arg3, int arg4,
127    int arg5, int arg6)
128{
129
130    return ((int) ixOsalLog ((IxOsalLogLevel) level,
131            IX_OSAL_LOG_DEV_STDOUT,
132            format, arg1, arg2, arg3, arg4, arg5, arg6));
133}
134
135PUBLIC int
136ixOsServLogLevelSet (int level)
137{
138    return ((int) ixOsalLogLevelSet ((UINT32) level));
139}
140
141PUBLIC void
142ixOsServSleep (int microseconds)
143{
144    ixOsalBusySleep ((UINT32) microseconds);
145}
146
147PUBLIC void
148ixOsServTaskSleep (int milliseconds)
149{
150    ixOsalSleep ((UINT32) milliseconds);
151}
152
153PUBLIC unsigned int
154ixOsServTimestampGet (void)
155{
156    return ((unsigned int) ixOsalTimestampGet ());
157}
158
159/* Not implemented in OSAL */
160PUBLIC void
161ixOsServUnload (void)
162{
163    ixOsalLog (IX_OSAL_LOG_LVL_WARNING,
164        IX_OSAL_LOG_DEV_STDOUT,
165        "ixOsServUnload():  No longer supported in OSAL  \n",
166        0, 0, 0, 0, 0, 0);
167}
168
169PUBLIC void
170ixOsServYield (void)
171{
172    ixOsalYield ();
173}
174 
Note: See TracBrowser for help on using the repository browser.