1 /*
2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 * of conditions and the following disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
16 * to endorse or promote products derived from this software without specific prior written
17 * 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 LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include "los_task_pri.h"
33 #include "It_los_mux.h"
34
35 #ifdef __cplusplus
36 #if __cplusplus
37 extern "C" {
38 #endif /* __cpluscplus */
39 #endif /* __cpluscplus */
40
41
42 LosMux g_mutexTest1;
43 LosMux g_mutexTest2;
44 LosMux g_mutexTest3;
45
46
TRand()47 u_long TRand()
48 {
49 return TRandom();
50 }
ShowMuxId(UINT32 * p,int len)51 void ShowMuxId(UINT32 *p, int len)
52 {
53 int i;
54 for (i = 0; i < len; i++) {
55 dprintf("%d , ", p[i]);
56 }
57 dprintf("\n");
58 }
RandSZ(UINT32 * sz,int len)59 void RandSZ(UINT32 *sz, int len)
60 {
61 int idx;
62 for (idx = len - 1; idx > 1; idx--) { /* get the random index */
63 int randIdx = TRand() % idx;
64 UINT32 tempMuxID = sz[randIdx];
65 sz[randIdx] = sz[idx];
66 sz[idx] = tempMuxID;
67 }
68 return;
69 }
ItSuiteLosMux(void)70 VOID ItSuiteLosMux(void)
71 {
72 #if defined(LOSCFG_TEST_SMOKE)
73 ItLosMux001();
74 ItLosMux002();
75 ItLosMux003();
76 ItLosMux004();
77 #endif
78 #if defined(LOSCFG_TEST_FULL)
79 ItLosMux006();
80 ItLosMux007();
81 ItLosMux008();
82 ItLosMux009();
83 ItLosMux010();
84 ItLosMux011();
85 ItLosMux012();
86 ItLosMux013();
87 ItLosMux015();
88 ItLosMux016();
89 ItLosMux017();
90 ItLosMux018();
91 ItLosMux020();
92 ItLosMux021();
93 ItLosMux025();
94 ItLosMux026();
95 ItLosMux027();
96 ItLosMux028();
97 ItLosMux029();
98 ItLosMux031();
99 ItLosMux035();
100 ItLosMux036();
101 ItLosMux037();
102 ItLosMux038();
103 ItLosMux039();
104 ItLosMux040();
105 ItLosMux041();
106 ItLosMux042();
107 ItLosMux043();
108 #endif
109
110 #ifdef LOSCFG_KERNEL_SMP
111 ItSmpLosMux001();
112 ItSmpLosMux002();
113 ItSmpLosMux003();
114 ItSmpLosMux004();
115 ItSmpLosMux005();
116 ItSmpLosMux006();
117 ItSmpLosMux007();
118 ItSmpLosMux2001();
119 ItSmpLosMux2002();
120 ItSmpLosMux2003();
121 ItSmpLosMux2004();
122 ItSmpLosMux2005();
123 ItSmpLosMux2006();
124 ItSmpLosMux2007();
125 ItSmpLosMux2008();
126 ItSmpLosMux2009();
127 ItSmpLosMux2010();
128 ItSmpLosMux2011();
129 ItSmpLosMux2012();
130 ItSmpLosMux2013();
131 ItSmpLosMux2014();
132 ItSmpLosMux2015();
133 ItSmpLosMux2016();
134 ItSmpLosMux2017();
135 ItSmpLosMux2018();
136 ItSmpLosMux2021();
137 ItSmpLosMux2022();
138 ItSmpLosMux2024();
139 ItSmpLosMux2025();
140 ItSmpLosMux2026();
141 ItSmpLosMux2027();
142 ItSmpLosMux2028();
143 ItSmpLosMux2029();
144 #endif
145
146 #ifdef LOSCFG_KERNEL_SMP
147 HalIrqSetAffinity(HWI_NUM_TEST, 1);
148 HalIrqSetAffinity(HWI_NUM_TEST1, 1);
149 #endif
150 }
151
152
153 #ifdef __cplusplus
154 #if __cplusplus
155 }
156 #endif /* __cpluscplus */
157 #endif /* __cpluscplus */
158