[302] | 1 | /*
|
---|
| 2 | * TOPPERS/ASP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Advanced Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2005-2015 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
| 8 | *
|
---|
| 9 | * ä¸è¨èä½æ¨©è
|
---|
| 10 | ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
| 11 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
| 12 | * å¤ã»åé
|
---|
| 13 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 14 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 15 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 16 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 17 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 18 | * ç¨ã§ããå½¢ã§åé
|
---|
| 19 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 20 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 21 | * è
|
---|
| 22 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 23 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 24 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 25 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 26 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 27 | * ã¨ï¼
|
---|
| 28 | * (a) åé
|
---|
| 29 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 30 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 31 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 32 | * (b) åé
|
---|
| 33 | å¸ã®å½¢æ
|
---|
| 34 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 35 | * å ±åãããã¨ï¼
|
---|
| 36 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 37 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 38 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 39 | 責ãããã¨ï¼
|
---|
| 40 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
| 41 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 42 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
| 43 | * å
|
---|
| 44 | 責ãããã¨ï¼
|
---|
| 45 | *
|
---|
| 46 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 47 | ã
|
---|
| 48 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
| 49 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
| 50 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
| 51 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
| 52 | *
|
---|
| 53 | * $Id: mutex.c 471 2015-12-30 10:03:16Z ertl-hiro $
|
---|
| 54 | */
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | * ãã¥ã¼ããã¯ã¹æ©è½
|
---|
| 58 | */
|
---|
| 59 |
|
---|
| 60 | #include "kernel_impl.h"
|
---|
| 61 | #include "check.h"
|
---|
| 62 | #include "task.h"
|
---|
| 63 | #include "taskhook.h"
|
---|
| 64 | #include "wait.h"
|
---|
| 65 | #include "mutex.h"
|
---|
| 66 |
|
---|
| 67 | /*
|
---|
| 68 | * ãã¬ã¼ã¹ãã°ãã¯ãã®ããã©ã«ãå®ç¾©
|
---|
| 69 | */
|
---|
| 70 | #ifndef LOG_ACRE_MTX_ENTER
|
---|
| 71 | #define LOG_ACRE_MTX_ENTER(pk_cmtx)
|
---|
| 72 | #endif /* LOG_ACRE_MTX_ENTER */
|
---|
| 73 |
|
---|
| 74 | #ifndef LOG_ACRE_MTX_LEAVE
|
---|
| 75 | #define LOG_ACRE_MTX_LEAVE(ercd)
|
---|
| 76 | #endif /* LOG_ACRE_MTX_LEAVE */
|
---|
| 77 |
|
---|
| 78 | #ifndef LOG_DEL_MTX_ENTER
|
---|
| 79 | #define LOG_DEL_MTX_ENTER(mtxid)
|
---|
| 80 | #endif /* LOG_DEL_MTX_ENTER */
|
---|
| 81 |
|
---|
| 82 | #ifndef LOG_DEL_MTX_LEAVE
|
---|
| 83 | #define LOG_DEL_MTX_LEAVE(ercd)
|
---|
| 84 | #endif /* LOG_DEL_MTX_LEAVE */
|
---|
| 85 |
|
---|
| 86 | #ifndef LOG_LOC_MTX_ENTER
|
---|
| 87 | #define LOG_LOC_MTX_ENTER(mtxid)
|
---|
| 88 | #endif /* LOG_LOC_MTX_ENTER */
|
---|
| 89 |
|
---|
| 90 | #ifndef LOG_LOC_MTX_LEAVE
|
---|
| 91 | #define LOG_LOC_MTX_LEAVE(ercd)
|
---|
| 92 | #endif /* LOG_LOC_MTX_LEAVE */
|
---|
| 93 |
|
---|
| 94 | #ifndef LOG_PLOC_MTX_ENTER
|
---|
| 95 | #define LOG_PLOC_MTX_ENTER(mtxid)
|
---|
| 96 | #endif /* LOG_PLOC_MTX_ENTER */
|
---|
| 97 |
|
---|
| 98 | #ifndef LOG_PLOC_MTX_LEAVE
|
---|
| 99 | #define LOG_PLOC_MTX_LEAVE(ercd)
|
---|
| 100 | #endif /* LOG_PLOC_MTX_LEAVE */
|
---|
| 101 |
|
---|
| 102 | #ifndef LOG_TLOC_MTX_ENTER
|
---|
| 103 | #define LOG_TLOC_MTX_ENTER(mtxid, tmout)
|
---|
| 104 | #endif /* LOG_TLOC_MTX_ENTER */
|
---|
| 105 |
|
---|
| 106 | #ifndef LOG_TLOC_MTX_LEAVE
|
---|
| 107 | #define LOG_TLOC_MTX_LEAVE(ercd)
|
---|
| 108 | #endif /* LOG_TLOC_MTX_LEAVE */
|
---|
| 109 |
|
---|
| 110 | #ifndef LOG_UNL_MTX_ENTER
|
---|
| 111 | #define LOG_UNL_MTX_ENTER(mtxid)
|
---|
| 112 | #endif /* LOG_UNL_MTX_ENTER */
|
---|
| 113 |
|
---|
| 114 | #ifndef LOG_UNL_MTX_LEAVE
|
---|
| 115 | #define LOG_UNL_MTX_LEAVE(ercd)
|
---|
| 116 | #endif /* LOG_UNL_MTX_LEAVE */
|
---|
| 117 |
|
---|
| 118 | #ifndef LOG_INI_MTX_ENTER
|
---|
| 119 | #define LOG_INI_MTX_ENTER(mtxid)
|
---|
| 120 | #endif /* LOG_INI_MTX_ENTER */
|
---|
| 121 |
|
---|
| 122 | #ifndef LOG_INI_MTX_LEAVE
|
---|
| 123 | #define LOG_INI_MTX_LEAVE(ercd)
|
---|
| 124 | #endif /* LOG_INI_MTX_LEAVE */
|
---|
| 125 |
|
---|
| 126 | #ifndef LOG_REF_MTX_ENTER
|
---|
| 127 | #define LOG_REF_MTX_ENTER(mtxid, pk_rmtx)
|
---|
| 128 | #endif /* LOG_REF_MTX_ENTER */
|
---|
| 129 |
|
---|
| 130 | #ifndef LOG_REF_MTX_LEAVE
|
---|
| 131 | #define LOG_REF_MTX_LEAVE(ercd, pk_rmtx)
|
---|
| 132 | #endif /* LOG_REF_MTX_LEAVE */
|
---|
| 133 |
|
---|
| 134 | /*
|
---|
| 135 | * ãã¥ã¼ããã¯ã¹ã®æ°
|
---|
| 136 | */
|
---|
| 137 | #define tnum_mtx ((uint_t)(tmax_mtxid - TMIN_MTXID + 1))
|
---|
| 138 | #define tnum_smtx ((uint_t)(tmax_smtxid - TMIN_MTXID + 1))
|
---|
| 139 |
|
---|
| 140 | /*
|
---|
| 141 | * ãã¥ã¼ããã¯ã¹IDãããã¥ã¼ããã¯ã¹ç®¡çãããã¯ãåãåºãããã®ãã¯ã
|
---|
| 142 | */
|
---|
| 143 | #define INDEX_MTX(mtxid) ((uint_t)((mtxid) - TMIN_MTXID))
|
---|
| 144 | #define get_mtxcb(mtxid) (&(mtxcb_table[INDEX_MTX(mtxid)]))
|
---|
| 145 |
|
---|
| 146 | /*
|
---|
| 147 | * ãã¥ã¼ããã¯ã¹ã®ãããã³ã«ãå¤æãããã¯ã
|
---|
| 148 | */
|
---|
| 149 | #define MTXPROTO_MASK 0x03U
|
---|
| 150 | #define MTXPROTO(p_mtxcb) ((p_mtxcb)->p_mtxinib->mtxatr & MTXPROTO_MASK)
|
---|
| 151 | #define MTX_CEILING(p_mtxcb) (MTXPROTO(p_mtxcb) == TA_CEILING)
|
---|
| 152 |
|
---|
| 153 | #ifdef TOPPERS_mtxini
|
---|
| 154 |
|
---|
| 155 | /*
|
---|
| 156 | * 使ç¨ãã¦ããªããã¥ã¼ããã¯ã¹ç®¡çãããã¯ã®ãªã¹ã
|
---|
| 157 | */
|
---|
| 158 | QUEUE free_mtxcb;
|
---|
| 159 |
|
---|
| 160 | /*
|
---|
| 161 | * ãã¥ã¼ããã¯ã¹æ©è½ã®åæå
|
---|
| 162 | */
|
---|
| 163 | void
|
---|
| 164 | initialize_mutex(void)
|
---|
| 165 | {
|
---|
| 166 | uint_t i, j;
|
---|
| 167 | MTXCB *p_mtxcb;
|
---|
| 168 | MTXINIB *p_mtxinib;
|
---|
| 169 |
|
---|
| 170 | mtxhook_check_ceilpri = mutex_check_ceilpri;
|
---|
| 171 | mtxhook_scan_ceilmtx = mutex_scan_ceilmtx;
|
---|
| 172 | mtxhook_release_all = mutex_release_all;
|
---|
| 173 |
|
---|
| 174 | for (i = 0; i < tnum_smtx; i++) {
|
---|
| 175 | p_mtxcb = &(mtxcb_table[i]);
|
---|
| 176 | queue_initialize(&(p_mtxcb->wait_queue));
|
---|
| 177 | p_mtxcb->p_mtxinib = &(mtxinib_table[i]);
|
---|
| 178 | p_mtxcb->p_loctsk = NULL;
|
---|
| 179 | }
|
---|
| 180 | queue_initialize(&free_mtxcb);
|
---|
| 181 | for (j = 0; i < tnum_mtx; i++, j++) {
|
---|
| 182 | p_mtxcb = &(mtxcb_table[i]);
|
---|
| 183 | p_mtxinib = &(amtxinib_table[j]);
|
---|
| 184 | p_mtxinib->mtxatr = TA_NOEXS;
|
---|
| 185 | p_mtxcb->p_mtxinib = ((const MTXINIB *) p_mtxinib);
|
---|
| 186 | queue_insert_prev(&free_mtxcb, &(p_mtxcb->wait_queue));
|
---|
| 187 | }
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | #endif /* TOPPERS_mtxini */
|
---|
| 191 |
|
---|
| 192 | /*
|
---|
| 193 | * ä¸éåªå
|
---|
| 194 | 度éåã®ãã§ãã¯
|
---|
| 195 | */
|
---|
| 196 | #ifdef TOPPERS_mtxchk
|
---|
| 197 |
|
---|
| 198 | bool_t
|
---|
| 199 | mutex_check_ceilpri(TCB *p_tcb, uint_t bpriority)
|
---|
| 200 | {
|
---|
| 201 | MTXCB *p_mtxcb;
|
---|
| 202 |
|
---|
| 203 | /*
|
---|
| 204 | * ã¿ã¹ã¯ãããã¯ãã¦ããåªå
|
---|
| 205 | 度ä¸éãã¥ã¼ããã¯ã¹ã®ä¸ã§ï¼ä¸éåªå
|
---|
| 206 |
|
---|
| 207 | * 度ãbpriorityãããä½ããã®ãããã°ï¼falseãè¿ãï¼
|
---|
| 208 | */
|
---|
| 209 | p_mtxcb = p_tcb->p_lastmtx;
|
---|
| 210 | while (p_mtxcb != NULL) {
|
---|
| 211 | if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
|
---|
| 212 | return(false);
|
---|
| 213 | }
|
---|
| 214 | p_mtxcb = p_mtxcb->p_prevmtx;
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | /*
|
---|
| 218 | * ã¿ã¹ã¯ãåªå
|
---|
| 219 | 度ä¸éãã¥ã¼ããã¯ã¹ã®ããã¯ãå¾
|
---|
| 220 | ã£ã¦ããå ´åã«ï¼ã
|
---|
| 221 | * ã®ä¸éåªå
|
---|
| 222 | 度ãbpriorityãããä½ãããã°ï¼falseãè¿ãï¼
|
---|
| 223 | */
|
---|
| 224 | if (TSTAT_WAIT_MTX(p_tcb->tstat)) {
|
---|
| 225 | p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
|
---|
| 226 | if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
|
---|
| 227 | return(false);
|
---|
| 228 | }
|
---|
| 229 | }
|
---|
| 230 |
|
---|
| 231 | /*
|
---|
| 232 | * ãããã®æ¡ä»¶ã«ãå½ã¦ã¯ã¾ããªããã°trueãè¿ãï¼
|
---|
| 233 | */
|
---|
| 234 | return(true);
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | #endif /* TOPPERS_mtxchk */
|
---|
| 238 |
|
---|
| 239 | /*
|
---|
| 240 | * åªå
|
---|
| 241 | 度ä¸éãã¥ã¼ããã¯ã¹ãããã¯ãã¦ãããã®ãã§ãã¯
|
---|
| 242 | */
|
---|
| 243 | #ifdef TOPPERS_mtxscan
|
---|
| 244 |
|
---|
| 245 | bool_t
|
---|
| 246 | mutex_scan_ceilmtx(TCB *p_tcb)
|
---|
| 247 | {
|
---|
| 248 | MTXCB *p_mtxcb;
|
---|
| 249 |
|
---|
| 250 | p_mtxcb = p_tcb->p_lastmtx;
|
---|
| 251 | while (p_mtxcb != NULL) {
|
---|
| 252 | if (MTX_CEILING(p_mtxcb)) {
|
---|
| 253 | return(true);
|
---|
| 254 | }
|
---|
| 255 | p_mtxcb = p_mtxcb->p_prevmtx;
|
---|
| 256 | }
|
---|
| 257 | return(false);
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | #endif /* TOPPERS_mtxscan */
|
---|
| 261 |
|
---|
| 262 | /*
|
---|
| 263 | * ã¿ã¹ã¯ã®ç¾å¨åªå
|
---|
| 264 | 度ã®è¨ç®
|
---|
| 265 | *
|
---|
| 266 | * p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¾å¨åªå
|
---|
| 267 | 度ï¼ã«è¨å®ãã¹ãå¤ï¼ãè¨ç®ããï¼
|
---|
| 268 | */
|
---|
| 269 | Inline uint_t
|
---|
| 270 | mutex_calc_priority(TCB *p_tcb)
|
---|
| 271 | {
|
---|
| 272 | uint_t priority;
|
---|
| 273 | MTXCB *p_mtxcb;
|
---|
| 274 |
|
---|
| 275 | priority = p_tcb->bpriority;
|
---|
| 276 | p_mtxcb = p_tcb->p_lastmtx;
|
---|
| 277 | while (p_mtxcb != NULL) {
|
---|
| 278 | if (MTX_CEILING(p_mtxcb) && p_mtxcb->p_mtxinib->ceilpri < priority) {
|
---|
| 279 | priority = p_mtxcb->p_mtxinib->ceilpri;
|
---|
| 280 | }
|
---|
| 281 | p_mtxcb = p_mtxcb->p_prevmtx;
|
---|
| 282 | }
|
---|
| 283 | return(priority);
|
---|
| 284 | }
|
---|
| 285 |
|
---|
| 286 | /*
|
---|
| 287 | * ãã¥ã¼ããã¯ã¹ã解æ¾ããå ´åã®ç¾å¨åªå
|
---|
| 288 | 度å¤æ´å¦ç
|
---|
| 289 | */
|
---|
| 290 | #ifdef TOPPERS_mtxdrop
|
---|
| 291 |
|
---|
| 292 | void
|
---|
| 293 | mutex_drop_priority(TCB *p_tcb, MTXCB *p_mtxcb)
|
---|
| 294 | {
|
---|
| 295 | uint_t newpri;
|
---|
| 296 |
|
---|
| 297 | if (MTX_CEILING(p_mtxcb)
|
---|
| 298 | && p_mtxcb->p_mtxinib->ceilpri == p_tcb->priority) {
|
---|
| 299 | newpri = mutex_calc_priority(p_tcb);
|
---|
| 300 | if (newpri != p_tcb->priority) {
|
---|
| 301 | change_priority(p_tcb, newpri, true);
|
---|
| 302 | }
|
---|
| 303 | }
|
---|
| 304 | }
|
---|
| 305 |
|
---|
| 306 | #endif /* TOPPERS_mtxdrop */
|
---|
| 307 |
|
---|
| 308 | /*
|
---|
| 309 | * ãã¥ã¼ããã¯ã¹ã®ããã¯
|
---|
| 310 | */
|
---|
| 311 | #ifdef TOPPERS_mtxacq
|
---|
| 312 |
|
---|
| 313 | void
|
---|
| 314 | mutex_acquire(TCB *p_tcb, MTXCB *p_mtxcb)
|
---|
| 315 | {
|
---|
| 316 | p_mtxcb->p_loctsk = p_tcb;
|
---|
| 317 | p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
|
---|
| 318 | p_tcb->p_lastmtx = p_mtxcb;
|
---|
| 319 | if (MTX_CEILING(p_mtxcb)
|
---|
| 320 | && p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
|
---|
| 321 | (void) change_priority(p_tcb, p_mtxcb->p_mtxinib->ceilpri, true);
|
---|
| 322 | }
|
---|
| 323 | }
|
---|
| 324 |
|
---|
| 325 | #endif /* TOPPERS_mtxacq */
|
---|
| 326 |
|
---|
| 327 | /*
|
---|
| 328 | * ãã¥ã¼ããã¯ã¹ã®ããã¯è§£é¤
|
---|
| 329 | */
|
---|
| 330 | #ifdef TOPPERS_mtxrel
|
---|
| 331 |
|
---|
| 332 | void
|
---|
| 333 | mutex_release(MTXCB *p_mtxcb)
|
---|
| 334 | {
|
---|
| 335 | TCB *p_tcb;
|
---|
| 336 |
|
---|
| 337 | if (queue_empty(&(p_mtxcb->wait_queue))) {
|
---|
| 338 | p_mtxcb->p_loctsk = NULL;
|
---|
| 339 | }
|
---|
| 340 | else {
|
---|
| 341 | /*
|
---|
| 342 | * ãã¥ã¼ããã¯ã¹å¾
|
---|
| 343 | ã¡ãã¥ã¼ã®å
|
---|
| 344 | é ã¿ã¹ã¯ï¼p_tcbï¼ã«ï¼ãã¥ã¼ãã
|
---|
| 345 | * ã¯ã¹ãããã¯ãããï¼
|
---|
| 346 | */
|
---|
| 347 | p_tcb = (TCB *) queue_delete_next(&(p_mtxcb->wait_queue));
|
---|
| 348 | wait_dequeue_tmevtb(p_tcb);
|
---|
| 349 | p_tcb->p_winfo->wercd = E_OK;
|
---|
| 350 |
|
---|
| 351 | p_mtxcb->p_loctsk = p_tcb;
|
---|
| 352 | p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
|
---|
| 353 | p_tcb->p_lastmtx = p_mtxcb;
|
---|
| 354 | if (MTX_CEILING(p_mtxcb)) {
|
---|
| 355 | if (p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
|
---|
| 356 | p_tcb->priority = p_mtxcb->p_mtxinib->ceilpri;
|
---|
| 357 | }
|
---|
| 358 | }
|
---|
| 359 | make_non_wait(p_tcb);
|
---|
| 360 | }
|
---|
| 361 | }
|
---|
| 362 |
|
---|
| 363 | #endif /* TOPPERS_mtxrel */
|
---|
| 364 |
|
---|
| 365 | /*
|
---|
| 366 | * ã¿ã¹ã¯ãããã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯ã¹ã®ããã¯è§£é¤
|
---|
| 367 | */
|
---|
| 368 | #ifdef TOPPERS_mtxrela
|
---|
| 369 |
|
---|
| 370 | void
|
---|
| 371 | mutex_release_all(TCB *p_tcb)
|
---|
| 372 | {
|
---|
| 373 | MTXCB *p_mtxcb;
|
---|
| 374 |
|
---|
| 375 | while ((p_mtxcb = p_tcb->p_lastmtx) != NULL) {
|
---|
| 376 | p_tcb->p_lastmtx = p_mtxcb->p_prevmtx;
|
---|
| 377 | mutex_release(p_mtxcb);
|
---|
| 378 | }
|
---|
| 379 | }
|
---|
| 380 |
|
---|
| 381 | #endif /* TOPPERS_mtxrela */
|
---|
| 382 |
|
---|
| 383 | /*
|
---|
| 384 | * ãã¥ã¼ããã¯ã¹ã®çæï¼»NGKI2022ï¼½
|
---|
| 385 | */
|
---|
| 386 | #ifdef TOPPERS_acre_mtx
|
---|
| 387 |
|
---|
| 388 | ER_UINT
|
---|
| 389 | acre_mtx(const T_CMTX *pk_cmtx)
|
---|
| 390 | {
|
---|
| 391 | MTXCB *p_mtxcb;
|
---|
| 392 | MTXINIB *p_mtxinib;
|
---|
| 393 | ER ercd;
|
---|
| 394 |
|
---|
| 395 | LOG_ACRE_MTX_ENTER(pk_cmtx);
|
---|
| 396 | CHECK_TSKCTX_UNL(); /*[NGKI2023][NGKI2024]*/
|
---|
| 397 | if (pk_cmtx->mtxatr == TA_CEILING) {
|
---|
| 398 | CHECK_PAR(VALID_TPRI(pk_cmtx->ceilpri)); /*ï¼»NGKI2037ï¼½*/
|
---|
| 399 | }
|
---|
| 400 | else {
|
---|
| 401 | CHECK_RSATR(pk_cmtx->mtxatr, TA_TPRI); /*ï¼»NGKI2025ï¼½*/
|
---|
| 402 | }
|
---|
| 403 |
|
---|
| 404 | lock_cpu();
|
---|
| 405 | if (tnum_mtx == 0 || queue_empty(&free_mtxcb)) {
|
---|
| 406 | ercd = E_NOID; /*ï¼»NGKI2031ï¼½*/
|
---|
| 407 | }
|
---|
| 408 | else {
|
---|
| 409 | p_mtxcb = ((MTXCB *) queue_delete_next(&free_mtxcb));
|
---|
| 410 | p_mtxinib = (MTXINIB *)(p_mtxcb->p_mtxinib);
|
---|
| 411 | p_mtxinib->mtxatr = pk_cmtx->mtxatr;
|
---|
| 412 | p_mtxinib->ceilpri = INT_PRIORITY(pk_cmtx->ceilpri);
|
---|
| 413 |
|
---|
| 414 | queue_initialize(&(p_mtxcb->wait_queue));
|
---|
| 415 | p_mtxcb->p_loctsk = NULL; /*ï¼»NGKI2033ï¼½*/
|
---|
| 416 | ercd = MTXID(p_mtxcb);
|
---|
| 417 | }
|
---|
| 418 | unlock_cpu();
|
---|
| 419 |
|
---|
| 420 | error_exit:
|
---|
| 421 | LOG_ACRE_MTX_LEAVE(ercd);
|
---|
| 422 | return(ercd);
|
---|
| 423 | }
|
---|
| 424 |
|
---|
| 425 | #endif /* TOPPERS_acre_mtx */
|
---|
| 426 |
|
---|
| 427 | /*
|
---|
| 428 | * ãã¥ã¼ããã¯ã¹ã®åé¤ï¼»NGKI2056ï¼½
|
---|
| 429 | */
|
---|
| 430 | #ifdef TOPPERS_del_mtx
|
---|
| 431 |
|
---|
| 432 | ER
|
---|
| 433 | del_mtx(ID mtxid)
|
---|
| 434 | {
|
---|
| 435 | MTXCB *p_mtxcb, **pp_prevmtx;
|
---|
| 436 | MTXINIB *p_mtxinib;
|
---|
| 437 | TCB *p_loctsk;
|
---|
| 438 | ER ercd;
|
---|
| 439 |
|
---|
| 440 | LOG_DEL_MTX_ENTER(mtxid);
|
---|
| 441 | CHECK_TSKCTX_UNL(); /*[NGKI2057][NGKI2058]*/
|
---|
| 442 | CHECK_ID(VALID_MTXID(mtxid)); /*ï¼»NGKI2059ï¼½*/
|
---|
| 443 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 444 |
|
---|
| 445 | lock_cpu();
|
---|
| 446 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 447 | ercd = E_NOEXS; /*ï¼»NGKI2060ï¼½*/
|
---|
| 448 | }
|
---|
| 449 | else if (mtxid <= tmax_smtxid) {
|
---|
| 450 | ercd = E_OBJ; /*ï¼»NGKI2062ï¼½*/
|
---|
| 451 | }
|
---|
| 452 | else {
|
---|
| 453 | init_wait_queue(&(p_mtxcb->wait_queue)); /*ï¼»NGKI2065ï¼½*/
|
---|
| 454 | p_loctsk = p_mtxcb->p_loctsk;
|
---|
| 455 | if (p_loctsk != NULL) {
|
---|
| 456 | /*
|
---|
| 457 | * p_loctskãããã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ãªã¹ããã対象
|
---|
| 458 | * ãã¥ã¼ã¯ã¹ãåé¤ãï¼å¿
|
---|
| 459 | è¦ãªå ´åã«ã¯p_loctskã®ç¾å¨åªå
|
---|
| 460 | 度
|
---|
| 461 | * ãå¤æ´ããï¼»NGKI2064ï¼½ï¼
|
---|
| 462 | */
|
---|
| 463 | pp_prevmtx = &(p_loctsk->p_lastmtx);
|
---|
| 464 | while (*pp_prevmtx != NULL) {
|
---|
| 465 | if (*pp_prevmtx == p_mtxcb) {
|
---|
| 466 | *pp_prevmtx = p_mtxcb->p_prevmtx;
|
---|
| 467 | break;
|
---|
| 468 | }
|
---|
| 469 | pp_prevmtx = &((*pp_prevmtx)->p_prevmtx);
|
---|
| 470 | }
|
---|
| 471 | mutex_drop_priority(p_loctsk, p_mtxcb);
|
---|
| 472 | }
|
---|
| 473 | p_mtxinib = (MTXINIB *)(p_mtxcb->p_mtxinib);
|
---|
| 474 | p_mtxinib->mtxatr = TA_NOEXS; /*ï¼»NGKI2063ï¼½*/
|
---|
| 475 | queue_insert_prev(&free_mtxcb, &(p_mtxcb->wait_queue));
|
---|
| 476 | if (p_runtsk != p_schedtsk) {
|
---|
| 477 | dispatch();
|
---|
| 478 | }
|
---|
| 479 | ercd = E_OK;
|
---|
| 480 | }
|
---|
| 481 | unlock_cpu();
|
---|
| 482 |
|
---|
| 483 | error_exit:
|
---|
| 484 | LOG_DEL_MTX_LEAVE(ercd);
|
---|
| 485 | return(ercd);
|
---|
| 486 | }
|
---|
| 487 |
|
---|
| 488 | #endif /* TOPPERS_del_mtx */
|
---|
| 489 |
|
---|
| 490 | /*
|
---|
| 491 | * ãã¥ã¼ããã¯ã¹ã®ããã¯
|
---|
| 492 | */
|
---|
| 493 | #ifdef TOPPERS_loc_mtx
|
---|
| 494 |
|
---|
| 495 | ER
|
---|
| 496 | loc_mtx(ID mtxid)
|
---|
| 497 | {
|
---|
| 498 | MTXCB *p_mtxcb;
|
---|
| 499 | WINFO_MTX winfo_mtx;
|
---|
| 500 | ER ercd;
|
---|
| 501 |
|
---|
| 502 | LOG_LOC_MTX_ENTER(mtxid);
|
---|
| 503 | CHECK_DISPATCH();
|
---|
| 504 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 505 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 506 |
|
---|
| 507 | lock_cpu_dsp();
|
---|
| 508 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 509 | ercd = E_NOEXS;
|
---|
| 510 | }
|
---|
| 511 | else if (p_runtsk->raster) {
|
---|
| 512 | ercd = E_RASTER;
|
---|
| 513 | }
|
---|
| 514 | else if (MTX_CEILING(p_mtxcb)
|
---|
| 515 | && p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
|
---|
| 516 | ercd = E_ILUSE;
|
---|
| 517 | }
|
---|
| 518 | else if (p_mtxcb->p_loctsk == NULL) {
|
---|
| 519 | mutex_acquire(p_runtsk, p_mtxcb);
|
---|
| 520 | /*
|
---|
| 521 | * åªå
|
---|
| 522 | 度ä¸éãã¥ã¼ããã¯ã¹ãããã¯ããå ´åï¼p_runtskã®åªå
|
---|
| 523 | 度
|
---|
| 524 | * ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
|
---|
| 525 | è¦ã«ãªããã¨ã¯ãªãï¼
|
---|
| 526 | */
|
---|
| 527 | assert(p_runtsk == p_schedtsk);
|
---|
| 528 | ercd = E_OK;
|
---|
| 529 | }
|
---|
| 530 | else if (p_mtxcb->p_loctsk == p_runtsk) {
|
---|
| 531 | ercd = E_OBJ;
|
---|
| 532 | }
|
---|
| 533 | else {
|
---|
| 534 | p_runtsk->tstat = TS_WAITING_MTX;
|
---|
| 535 | wobj_make_wait((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx);
|
---|
| 536 | dispatch();
|
---|
| 537 | ercd = winfo_mtx.winfo.wercd;
|
---|
| 538 | }
|
---|
| 539 | unlock_cpu_dsp();
|
---|
| 540 |
|
---|
| 541 | error_exit:
|
---|
| 542 | LOG_LOC_MTX_LEAVE(ercd);
|
---|
| 543 | return(ercd);
|
---|
| 544 | }
|
---|
| 545 |
|
---|
| 546 | #endif /* TOPPERS_loc_mtx */
|
---|
| 547 |
|
---|
| 548 | /*
|
---|
| 549 | * ãã¥ã¼ããã¯ã¹ã®ããã¯ï¼ãã¼ãªã³ã°ï¼
|
---|
| 550 | */
|
---|
| 551 | #ifdef TOPPERS_ploc_mtx
|
---|
| 552 |
|
---|
| 553 | ER
|
---|
| 554 | ploc_mtx(ID mtxid)
|
---|
| 555 | {
|
---|
| 556 | MTXCB *p_mtxcb;
|
---|
| 557 | ER ercd;
|
---|
| 558 |
|
---|
| 559 | LOG_PLOC_MTX_ENTER(mtxid);
|
---|
| 560 | CHECK_TSKCTX_UNL();
|
---|
| 561 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 562 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 563 |
|
---|
| 564 | lock_cpu();
|
---|
| 565 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 566 | ercd = E_NOEXS;
|
---|
| 567 | }
|
---|
| 568 | else if (MTX_CEILING(p_mtxcb)
|
---|
| 569 | && p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
|
---|
| 570 | ercd = E_ILUSE;
|
---|
| 571 | }
|
---|
| 572 | else if (p_mtxcb->p_loctsk == NULL) {
|
---|
| 573 | mutex_acquire(p_runtsk, p_mtxcb);
|
---|
| 574 | /*
|
---|
| 575 | * åªå
|
---|
| 576 | 度ä¸éãã¥ã¼ããã¯ã¹ãããã¯ããå ´åï¼p_runtskã®åªå
|
---|
| 577 | 度
|
---|
| 578 | * ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
|
---|
| 579 | è¦ã«ãªããã¨ã¯ãªãï¼
|
---|
| 580 | */
|
---|
| 581 | assert(p_runtsk == p_schedtsk);
|
---|
| 582 | ercd = E_OK;
|
---|
| 583 | }
|
---|
| 584 | else if (p_mtxcb->p_loctsk == p_runtsk) {
|
---|
| 585 | ercd = E_OBJ;
|
---|
| 586 | }
|
---|
| 587 | else {
|
---|
| 588 | ercd = E_TMOUT;
|
---|
| 589 | }
|
---|
| 590 | unlock_cpu();
|
---|
| 591 |
|
---|
| 592 | error_exit:
|
---|
| 593 | LOG_PLOC_MTX_LEAVE(ercd);
|
---|
| 594 | return(ercd);
|
---|
| 595 | }
|
---|
| 596 |
|
---|
| 597 | #endif /* TOPPERS_ploc_mtx */
|
---|
| 598 |
|
---|
| 599 | /*
|
---|
| 600 | * ãã¥ã¼ããã¯ã¹ã®ããã¯ï¼ã¿ã¤ã ã¢ã¦ãããï¼
|
---|
| 601 | */
|
---|
| 602 | #ifdef TOPPERS_tloc_mtx
|
---|
| 603 |
|
---|
| 604 | ER
|
---|
| 605 | tloc_mtx(ID mtxid, TMO tmout)
|
---|
| 606 | {
|
---|
| 607 | MTXCB *p_mtxcb;
|
---|
| 608 | WINFO_MTX winfo_mtx;
|
---|
| 609 | TMEVTB tmevtb;
|
---|
| 610 | ER ercd;
|
---|
| 611 |
|
---|
| 612 | LOG_TLOC_MTX_ENTER(mtxid, tmout);
|
---|
| 613 | CHECK_DISPATCH();
|
---|
| 614 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 615 | CHECK_PAR(VALID_TMOUT(tmout));
|
---|
| 616 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 617 |
|
---|
| 618 | lock_cpu_dsp();
|
---|
| 619 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 620 | ercd = E_NOEXS;
|
---|
| 621 | }
|
---|
| 622 | else if (p_runtsk->raster) {
|
---|
| 623 | ercd = E_RASTER;
|
---|
| 624 | }
|
---|
| 625 | else if (MTX_CEILING(p_mtxcb)
|
---|
| 626 | && p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
|
---|
| 627 | ercd = E_ILUSE;
|
---|
| 628 | }
|
---|
| 629 | else if (p_mtxcb->p_loctsk == NULL) {
|
---|
| 630 | mutex_acquire(p_runtsk, p_mtxcb);
|
---|
| 631 | /*
|
---|
| 632 | * åªå
|
---|
| 633 | 度ä¸éãã¥ã¼ããã¯ã¹ãããã¯ããå ´åï¼p_runtskã®åªå
|
---|
| 634 | 度
|
---|
| 635 | * ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
|
---|
| 636 | è¦ã«ãªããã¨ã¯ãªãï¼
|
---|
| 637 | */
|
---|
| 638 | assert(p_runtsk == p_schedtsk);
|
---|
| 639 | ercd = E_OK;
|
---|
| 640 | }
|
---|
| 641 | else if (p_mtxcb->p_loctsk == p_runtsk) {
|
---|
| 642 | ercd = E_OBJ;
|
---|
| 643 | }
|
---|
| 644 | else if (tmout == TMO_POL) {
|
---|
| 645 | ercd = E_TMOUT;
|
---|
| 646 | }
|
---|
| 647 | else {
|
---|
| 648 | p_runtsk->tstat = TS_WAITING_MTX;
|
---|
| 649 | wobj_make_wait_tmout((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx,
|
---|
| 650 | &tmevtb, tmout);
|
---|
| 651 | dispatch();
|
---|
| 652 | ercd = winfo_mtx.winfo.wercd;
|
---|
| 653 | }
|
---|
| 654 | unlock_cpu_dsp();
|
---|
| 655 |
|
---|
| 656 | error_exit:
|
---|
| 657 | LOG_TLOC_MTX_LEAVE(ercd);
|
---|
| 658 | return(ercd);
|
---|
| 659 | }
|
---|
| 660 |
|
---|
| 661 | #endif /* TOPPERS_tloc_mtx */
|
---|
| 662 |
|
---|
| 663 | /*
|
---|
| 664 | * ãã¥ã¼ããã¯ã¹ã®ããã¯è§£é¤
|
---|
| 665 | */
|
---|
| 666 | #ifdef TOPPERS_unl_mtx
|
---|
| 667 |
|
---|
| 668 | ER
|
---|
| 669 | unl_mtx(ID mtxid)
|
---|
| 670 | {
|
---|
| 671 | MTXCB *p_mtxcb;
|
---|
| 672 | ER ercd;
|
---|
| 673 |
|
---|
| 674 | LOG_UNL_MTX_ENTER(mtxid);
|
---|
| 675 | CHECK_TSKCTX_UNL();
|
---|
| 676 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 677 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 678 |
|
---|
| 679 | lock_cpu();
|
---|
| 680 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 681 | ercd = E_NOEXS;
|
---|
| 682 | }
|
---|
| 683 | else if (p_mtxcb != p_runtsk->p_lastmtx) {
|
---|
| 684 | ercd = E_OBJ;
|
---|
| 685 | }
|
---|
| 686 | else {
|
---|
| 687 | p_runtsk->p_lastmtx = p_mtxcb->p_prevmtx;
|
---|
| 688 | mutex_drop_priority(p_runtsk, p_mtxcb);
|
---|
| 689 | mutex_release(p_mtxcb);
|
---|
| 690 | if (p_runtsk != p_schedtsk) {
|
---|
| 691 | dispatch();
|
---|
| 692 | }
|
---|
| 693 | ercd = E_OK;
|
---|
| 694 | }
|
---|
| 695 | unlock_cpu();
|
---|
| 696 |
|
---|
| 697 | error_exit:
|
---|
| 698 | LOG_UNL_MTX_LEAVE(ercd);
|
---|
| 699 | return(ercd);
|
---|
| 700 | }
|
---|
| 701 |
|
---|
| 702 | #endif /* TOPPERS_unl_mtx */
|
---|
| 703 |
|
---|
| 704 | /*
|
---|
| 705 | * ãã¥ã¼ããã¯ã¹ã®ååæå
|
---|
| 706 | */
|
---|
| 707 | #ifdef TOPPERS_ini_mtx
|
---|
| 708 |
|
---|
| 709 | ER
|
---|
| 710 | ini_mtx(ID mtxid)
|
---|
| 711 | {
|
---|
| 712 | MTXCB *p_mtxcb, **pp_prevmtx;
|
---|
| 713 | TCB *p_loctsk;
|
---|
| 714 | ER ercd;
|
---|
| 715 |
|
---|
| 716 | LOG_INI_MTX_ENTER(mtxid);
|
---|
| 717 | CHECK_TSKCTX_UNL();
|
---|
| 718 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 719 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 720 |
|
---|
| 721 | lock_cpu();
|
---|
| 722 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 723 | ercd = E_NOEXS;
|
---|
| 724 | }
|
---|
| 725 | else {
|
---|
| 726 | init_wait_queue(&(p_mtxcb->wait_queue));
|
---|
| 727 | p_loctsk = p_mtxcb->p_loctsk;
|
---|
| 728 | if (p_loctsk != NULL) {
|
---|
| 729 | p_mtxcb->p_loctsk = NULL;
|
---|
| 730 | pp_prevmtx = &(p_loctsk->p_lastmtx);
|
---|
| 731 | while (*pp_prevmtx != NULL) {
|
---|
| 732 | if (*pp_prevmtx == p_mtxcb) {
|
---|
| 733 | *pp_prevmtx = p_mtxcb->p_prevmtx;
|
---|
| 734 | break;
|
---|
| 735 | }
|
---|
| 736 | pp_prevmtx = &((*pp_prevmtx)->p_prevmtx);
|
---|
| 737 | }
|
---|
| 738 | mutex_drop_priority(p_loctsk, p_mtxcb);
|
---|
| 739 | }
|
---|
| 740 | if (p_runtsk != p_schedtsk) {
|
---|
| 741 | dispatch();
|
---|
| 742 | }
|
---|
| 743 | ercd = E_OK;
|
---|
| 744 | }
|
---|
| 745 | unlock_cpu();
|
---|
| 746 |
|
---|
| 747 | error_exit:
|
---|
| 748 | LOG_INI_MTX_LEAVE(ercd);
|
---|
| 749 | return(ercd);
|
---|
| 750 | }
|
---|
| 751 |
|
---|
| 752 | #endif /* TOPPERS_ini_mtx */
|
---|
| 753 |
|
---|
| 754 | /*
|
---|
| 755 | * ãã¥ã¼ããã¯ã¹ã®ç¶æ
|
---|
| 756 | åç
|
---|
| 757 | §
|
---|
| 758 | */
|
---|
| 759 | #ifdef TOPPERS_ref_mtx
|
---|
| 760 |
|
---|
| 761 | ER
|
---|
| 762 | ref_mtx(ID mtxid, T_RMTX *pk_rmtx)
|
---|
| 763 | {
|
---|
| 764 | MTXCB *p_mtxcb;
|
---|
| 765 | ER ercd;
|
---|
| 766 |
|
---|
| 767 | LOG_REF_MTX_ENTER(mtxid, pk_rmtx);
|
---|
| 768 | CHECK_TSKCTX_UNL();
|
---|
| 769 | CHECK_ID(VALID_MTXID(mtxid));
|
---|
| 770 | p_mtxcb = get_mtxcb(mtxid);
|
---|
| 771 |
|
---|
| 772 | lock_cpu();
|
---|
| 773 | if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
|
---|
| 774 | ercd = E_NOEXS;
|
---|
| 775 | }
|
---|
| 776 | else {
|
---|
| 777 | pk_rmtx->htskid = (p_mtxcb->p_loctsk != NULL) ? TSKID(p_mtxcb->p_loctsk)
|
---|
| 778 | : TSK_NONE;
|
---|
| 779 | pk_rmtx->wtskid = wait_tskid(&(p_mtxcb->wait_queue));
|
---|
| 780 | ercd = E_OK;
|
---|
| 781 | }
|
---|
| 782 | unlock_cpu();
|
---|
| 783 |
|
---|
| 784 | error_exit:
|
---|
| 785 | LOG_REF_MTX_LEAVE(ercd, pk_rmtx);
|
---|
| 786 | return(ercd);
|
---|
| 787 | }
|
---|
| 788 |
|
---|
| 789 | #endif /* TOPPERS_ref_mtx */
|
---|