d8e7b6b7ba6f44ed4f28965ec94aaffc2f9f80ee
1 /*
2 * Copyright (c) 2012-2013, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 /*
33 * ======== GateMPSupportNull.c ========
34 * Implementation of functions specified in GateMPSupportNull.xdc.
35 *
36 */
38 #include <xdc/std.h>
39 #include <xdc/runtime/Error.h>
40 #include <xdc/runtime/Assert.h>
41 #include <xdc/runtime/IGateProvider.h>
43 #include <ti/sdo/ipc/interfaces/IGateMPSupport.h>
45 #include "package/internal/GateMPSupportNull.xdc.h"
47 /*
48 *************************************************************************
49 * Instance functions
50 *************************************************************************
51 */
53 /*
54 * ======== GateMPSupportNull_Instance_init ========
55 */
56 Void GateMPSupportNull_Instance_init(GateMPSupportNull_Object *obj,
57 IGateProvider_Handle localGate, const GateMPSupportNull_Params *params)
58 {
59 obj->resourceId = params->resourceId;
60 }
62 /*
63 * ======== GateMPSupportNull_getResourceId ========
64 */
65 Bits32 GateMPSupportNull_getResourceId(GateMPSupportNull_Object *obj)
66 {
67 return (1);
68 }
70 /*
71 * ======== GateMPSupportNull_enter ========
72 * Returns FIRST_ENTER when it gets the gate, returns NESTED_ENTER
73 * on nested calls.
74 */
75 IArg GateMPSupportNull_enter(GateMPSupportNull_Object *obj)
76 {
77 if (GateMPSupportNull_action == GateMPSupportNull_Action_ASSERT) {
78 Assert_isTrue(FALSE, GateMPSupportNull_A_invalidAction);
79 }
81 return (0);
82 }
84 /*
85 * ======== GateMPSupportNull_leave ========
86 * Only releases the gate if key == FIRST_ENTER.
87 */
88 Void GateMPSupportNull_leave(GateMPSupportNull_Object *obj, IArg key)
89 {
90 if (GateMPSupportNull_action == GateMPSupportNull_Action_ASSERT) {
91 Assert_isTrue(FALSE, GateMPSupportNull_A_invalidAction);
92 }
93 }
95 /*
96 *************************************************************************
97 * Module functions
98 *************************************************************************
99 */
101 /*
102 * ======== GateMPSupportNull_getReservedMask ========
103 */
104 Bits32 *GateMPSupportNull_getReservedMask()
105 {
106 /* This gate doesn't allow reserving resources */
107 return (NULL);
108 }
110 /*
111 * ======== GateSupportNull_query ========
112 *
113 */
114 Bool GateMPSupportNull_query(Int qual)
115 {
116 return (FALSE);
117 }
120 /*
121 * ======== GateMPSupportNull_sharedMemReq ========
122 */
123 SizeT GateMPSupportNull_sharedMemReq(const IGateMPSupport_Params *params)
124 {
125 return (0);
126 }