[172] | 1 | /*
|
---|
| 2 | * TOPPERS ATK2
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems
|
---|
| 4 | * Automotive Kernel Version 2
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2012-2013 by Center for Embedded Computing Systems
|
---|
| 7 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
| 8 | * Copyright (C) 2012-2013 by FUJISOFT INCORPORATED, JAPAN
|
---|
| 9 | * Copyright (C) 2012-2013 by FUJITSU VLSI LIMITED, JAPAN
|
---|
| 10 | * Copyright (C) 2012-2013 by NEC Communication Systems, Ltd., JAPAN
|
---|
| 11 | * Copyright (C) 2012-2013 by Panasonic Advanced Technology Development Co., Ltd., JAPAN
|
---|
| 12 | * Copyright (C) 2012-2013 by Renesas Electronics Corporation, JAPAN
|
---|
| 13 | * Copyright (C) 2012-2013 by Sunny Giken Inc., JAPAN
|
---|
| 14 | * Copyright (C) 2012-2013 by TOSHIBA CORPORATION, JAPAN
|
---|
| 15 | * Copyright (C) 2012-2013 by Witz Corporation, JAPAN
|
---|
| 16 | * Copyright (C) 2013 by Embedded and Real-Time Systems Laboratory
|
---|
| 17 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
| 18 | *
|
---|
| 19 | * ä¸è¨èä½æ¨©è
|
---|
| 20 | ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
| 21 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
| 22 | * å¤ã»åé
|
---|
| 23 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 24 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 25 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 26 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 27 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 28 | * ç¨ã§ããå½¢ã§åé
|
---|
| 29 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 30 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 31 | * è
|
---|
| 32 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 33 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 34 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 35 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 36 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 37 | * ã¨ï¼
|
---|
| 38 | * (a) åé
|
---|
| 39 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 40 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 41 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 42 | * (b) åé
|
---|
| 43 | å¸ã®å½¢æ
|
---|
| 44 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 45 | * å ±åãããã¨ï¼
|
---|
| 46 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 47 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 48 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 49 | 責ãããã¨ï¼
|
---|
| 50 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
| 51 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 52 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
| 53 | * å
|
---|
| 54 | 責ãããã¨ï¼
|
---|
| 55 | *
|
---|
| 56 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼AUTOSARï¼AUTomotive Open System ARchitectureï¼ä»
|
---|
| 57 | * æ§ã«åºã¥ãã¦ããï¼ä¸è¨ã®è¨±è«¾ã¯ï¼AUTOSARã®ç¥ç財ç£æ¨©ã許諾ãããã®ã§
|
---|
| 58 | * ã¯ãªãï¼AUTOSARã¯ï¼AUTOSARä»æ§ã«åºã¥ããã½ããã¦ã§ã¢ãåç¨ç®çã§å©
|
---|
| 59 | * ç¨ããè
|
---|
| 60 | ã«å¯¾ãã¦ï¼AUTOSARãã¼ããã¼ã«ãªããã¨ãæ±ãã¦ããï¼
|
---|
| 61 | *
|
---|
| 62 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 63 | ã
|
---|
| 64 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
| 65 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
| 66 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
| 67 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
| 68 | *
|
---|
| 69 | * $Id: prc_config.h 189 2015-06-26 01:54:57Z t_ishikawa $
|
---|
| 70 | */
|
---|
| 71 |
|
---|
| 72 | /*
|
---|
| 73 | * ããã»ããµä¾åã¢ã¸ã¥ã¼ã«ï¼V850ç¨ï¼
|
---|
| 74 | *
|
---|
| 75 | * ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼target_config.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
|
---|
| 76 | * ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
|
---|
| 77 | * ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªã
|
---|
| 78 | */
|
---|
| 79 |
|
---|
| 80 | #ifndef TOPPERS_PRC_CONFIG_H
|
---|
| 81 | #define TOPPERS_PRC_CONFIG_H
|
---|
| 82 |
|
---|
| 83 | #include "prc_sil.h"
|
---|
| 84 |
|
---|
| 85 | /*
|
---|
| 86 | * ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
|
---|
| 87 | */
|
---|
| 88 | /* =begin modified for SC3 */
|
---|
| 89 | #ifndef CHECK_SSTKSZ_ALIGN
|
---|
| 90 | #define CHECK_SSTKSZ_ALIGN UINT_C(4) /* ã·ã¹ãã ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
|
---|
| 91 | #endif /* CHECK_STKSZ_ALIGN */
|
---|
| 92 |
|
---|
| 93 | #ifndef CHECK_USTKSZ_ALIGN
|
---|
| 94 | #define CHECK_USTKSZ_ALIGN UINT_C(16) /* ã¦ã¼ã¶ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
|
---|
| 95 | #endif /* CHECK_USTKSZ_ALIGN */
|
---|
| 96 | /* =end modified for SC3 */
|
---|
| 97 |
|
---|
| 98 | #ifndef CHECK_FUNC_ALIGN
|
---|
| 99 | #define CHECK_FUNC_ALIGN UINT_C(2) /* é¢æ°ã®ã¢ã©ã¤ã³åä½ */
|
---|
| 100 | #endif /* CHECK_FUNC_ALIGN */
|
---|
| 101 |
|
---|
| 102 | #define CHECK_FUNC_NONNULL /* é¢æ°ã®éNULLãã§ã㯠*/
|
---|
| 103 |
|
---|
| 104 | #ifndef CHECK_STACK_ALIGN
|
---|
| 105 | #define CHECK_STACK_ALIGN UINT_C(4) /* ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½ */
|
---|
| 106 | #endif /* CHECK_STACK_ALIGN */
|
---|
| 107 |
|
---|
| 108 | #define CHECK_STACK_NONNULL /* ã¹ã¿ãã¯é åã®éNULLãã§ã㯠*/
|
---|
| 109 |
|
---|
| 110 | /* =begin modified for SC3 */
|
---|
| 111 | /*
|
---|
| 112 | * ã¿ã¼ã²ããã§è¿½å ããã·ã¹ãã ãµã¼ãã¹ãã¼ãã«å®ç¾©
|
---|
| 113 | */
|
---|
| 114 | #ifndef OTHER_PRC_SVC_TABLE
|
---|
| 115 | #ifdef USE_KERNEL_LIBRARY_SYSLOG
|
---|
| 116 | /* ã·ã¹ãã°æ©è½æå¹æ */
|
---|
| 117 | #define PRC_SVC_TABLE (void *) &_kernel_KernelLibrarySyslog
|
---|
| 118 | #define PRC_SVC_NUM 1
|
---|
| 119 | #else /* USE_KERNEL_LIBRARY_SYSLOG */
|
---|
| 120 | /* ã·ã¹ãã°æ©è½ç¡å¹æ */
|
---|
| 121 | #define PRC_SVC_TABLE
|
---|
| 122 | #define PRC_SVC_NUM 0
|
---|
| 123 | #endif /* USE_KERNEL_LIBRARY_SYSLOG */
|
---|
| 124 | #else /* OTHER_PRC_SVC_TABLE */
|
---|
| 125 | #define STR(a) STR_(a)
|
---|
| 126 | #define STR_(a) # a
|
---|
| 127 | #include STR(OTHER_PRC_SVC_TABLE)
|
---|
| 128 | #endif /* OTHER_PRC_SVC_TABLE */
|
---|
| 129 |
|
---|
| 130 | /*
|
---|
| 131 | * svcã§å¼ã³åºãå¦çã®ç¨®é¡
|
---|
| 132 | * ã·ã¹ãã ãµã¼ãã¹ã®å
|
---|
| 133 | ¥ãå£
|
---|
| 134 | * éä¿¡é ¼ããã¯ã®åºå£
|
---|
| 135 | */
|
---|
| 136 | #define SYSCALL_SIZE 2
|
---|
| 137 | /* =end modified for SC3 */
|
---|
| 138 |
|
---|
| 139 | #define call_errorhook(ercd, svcid) stack_change_and_call_func_2(&internal_call_errorhook, (ercd), (svcid))
|
---|
| 140 | #define call_shutdownhook(ercd) stack_change_and_call_func_1(&internal_call_shtdwnhk, ((uint32) (ercd)))
|
---|
| 141 |
|
---|
| 142 | /*
|
---|
| 143 | * å²è¾¼ã¿çªå·ã®ç¯å²ã®å¤å®
|
---|
| 144 | */
|
---|
| 145 | #if TMIN_INTNO == 0
|
---|
| 146 | #define VALID_INTNO(intno) ((intno) <= (InterruptNumberType) (TMAX_INTNO))
|
---|
| 147 | #else /* TMIN_INTNO != 0 */
|
---|
| 148 | #define VALID_INTNO(intno) (((InterruptNumberType) (TMIN_INTNO) <= (intno)) && ((intno) <= (InterruptNumberType) (TMAX_INTNO)))
|
---|
| 149 | #endif /* TMIN_INTNO == 0 */
|
---|
| 150 |
|
---|
| 151 | #ifndef TOPPERS_MACRO_ONLY
|
---|
| 152 |
|
---|
| 153 | /*
|
---|
| 154 | * éã¿ã¹ã¯ã³ã³ããã¹ãç¨ã®ã¹ã¿ãã¯éå§ã¢ãã¬ã¹è¨å®ãã¯ã
|
---|
| 155 | */
|
---|
| 156 | #define TOPPERS_OSTKPT(stk, stksz) ((StackType *) ((sint8 *) (stk) + (stksz)))
|
---|
| 157 |
|
---|
| 158 | /*
|
---|
| 159 | * ããã»ããµã®ç¹æ®å½ä»¤ã®ã¤ã³ã©ã¤ã³é¢æ°å®ç¾©
|
---|
| 160 | */
|
---|
| 161 | #include <prc_insn.h>
|
---|
| 162 |
|
---|
| 163 | /*
|
---|
| 164 | * TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®å®ç¾
|
---|
| 165 | */
|
---|
| 166 |
|
---|
| 167 | /*
|
---|
| 168 | * ä¾å¤ï¼å²è¾¼ã¿/CPUä¾å¤ï¼ã®ãã¹ãåæ°ã®ã«ã¦ã³ã
|
---|
| 169 | *
|
---|
| 170 | * ã³ã³ããã¹ãåç
|
---|
| 171 | §ã®ããã«ä½¿ç¨
|
---|
| 172 | */
|
---|
| 173 | extern uint32 except_nest_cnt;
|
---|
| 174 |
|
---|
| 175 | /*
|
---|
| 176 | * ã«ã¼ãã«ç®¡çå
|
---|
| 177 | ï¼ã«ãã´ãª2ï¼ã®å²è¾¼ã¿ãç¦æ¢ããããã®PMRã®è¨å®å¤
|
---|
| 178 | */
|
---|
| 179 | extern const uint16 pmr_isr2_mask;
|
---|
| 180 |
|
---|
| 181 | /*
|
---|
| 182 | * ã«ã¼ãã«ç®¡çå¤ï¼ã«ãã´ãª1ï¼ã®å²è¾¼ã¿ã¨ãªãåªå
|
---|
| 183 | 度ã®PMRã®ããã
|
---|
| 184 | */
|
---|
| 185 | extern const uint16 pmr_isr1_mask;
|
---|
| 186 |
|
---|
| 187 | /*
|
---|
| 188 | * ç¾å¨ã®å²è¾¼ã¿åªå
|
---|
| 189 | 度ã®å¤ï¼å
|
---|
| 190 | é¨è¡¨ç¾ï¼
|
---|
| 191 | */
|
---|
| 192 | extern uint8 current_iintpri;
|
---|
| 193 |
|
---|
| 194 | /*
|
---|
| 195 | * å²ãè¾¼ã¿è¦æ±ãã¹ã¯ãã¼ãã«ï¼PMRã¸ã®è¨å®å¤ï¼
|
---|
| 196 | */
|
---|
| 197 | extern const uint16 pmr_setting_tbl[];
|
---|
| 198 |
|
---|
| 199 | /*
|
---|
| 200 | * ç¡éã«ã¼ãå¦ç
|
---|
| 201 | */
|
---|
| 202 | extern void infinite_loop(void) NoReturn;
|
---|
| 203 |
|
---|
| 204 | /*
|
---|
| 205 | * å²è¾¼ã¿åªå
|
---|
| 206 | 度ã®å
|
---|
| 207 | é¨è¡¨ç¾ã¨å¤é¨è¡¨ç¾ã®å¤æ´
|
---|
| 208 | */
|
---|
| 209 | #ifndef TOPPERS_MACRO_ONLY
|
---|
| 210 | #define EXT_IPM(iipm) ((PriorityType) (iipm - (TNUM_INTPRI))) /* å
|
---|
| 211 | é¨è¡¨ç¾ãå¤é¨è¡¨ç¾ã« */
|
---|
| 212 | #define INT_IPM(ipm) ((uint32) (ipm + (TNUM_INTPRI))) /* å¤é¨è¡¨ç¾ãå
|
---|
| 213 | é¨è¡¨ç¾ã« */
|
---|
| 214 | #else /* TOPPERS_MACRO_ONLY */
|
---|
| 215 | #define EXT_IPM(iipm) (iipm - (TNUM_INTPRI)) /* å
|
---|
| 216 | é¨è¡¨ç¾ãå¤é¨è¡¨ç¾ã« */
|
---|
| 217 | #define INT_IPM(ipm) (ipm + (TNUM_INTPRI)) /* å¤é¨è¡¨ç¾ãå
|
---|
| 218 | é¨è¡¨ç¾ã« */
|
---|
| 219 | #endif /* TOPPERS_MACRO_ONLY */
|
---|
| 220 |
|
---|
| 221 | /*
|
---|
| 222 | * å
|
---|
| 223 | ¨å²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 224 | ã¸ã®ç§»è¡
|
---|
| 225 | */
|
---|
| 226 | LOCAL_INLINE void
|
---|
| 227 | x_lock_all_int(void)
|
---|
| 228 | {
|
---|
| 229 | disable_int();
|
---|
| 230 | }
|
---|
| 231 |
|
---|
| 232 | /*
|
---|
| 233 | * å
|
---|
| 234 | ¨å²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 235 | ã®è§£é¤
|
---|
| 236 | */
|
---|
| 237 | LOCAL_INLINE void
|
---|
| 238 | x_unlock_all_int(void)
|
---|
| 239 | {
|
---|
| 240 | enable_int();
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | /*
|
---|
| 244 | * x_nested_lock_os_int()ã®ãã¹ãåæ°
|
---|
| 245 | * ã¢ã¯ã»ã¹ã®é åºãå¤åããªãããï¼volatile ãæå®
|
---|
| 246 | */
|
---|
| 247 | extern volatile uint8 nested_lock_os_int_cnt;
|
---|
| 248 |
|
---|
| 249 | /*
|
---|
| 250 | * OSå²è¾¼ã¿ç¦æ¢
|
---|
| 251 | * APIå®è¡æã«å¼ã³åºããã
|
---|
| 252 | * å²è¾¼ã¿åªå
|
---|
| 253 | 度ãã¹ã¯ãISR2ã®åªå
|
---|
| 254 | 度ãã¹ã¯ã®ç¯å²ããé«ãç¶æ
|
---|
| 255 | ã§å¼ã³åºããã
|
---|
| 256 | * ãã¨ã¯ãªã(ISR1ããå¼ã³åºããããã¨ã¯ãªã)
|
---|
| 257 | */
|
---|
| 258 | LOCAL_INLINE void
|
---|
| 259 | x_nested_lock_os_int(void)
|
---|
| 260 | {
|
---|
| 261 | /*
|
---|
| 262 | * ä¸æ®µç®ãªãå²è¾¼ã¿ã®ç¦æ¢ã¬ãã«ã«è¨å®å²è¾¼ã¿åªå
|
---|
| 263 | 度ãã¹ã¯ã®å¤ãä¿å
|
---|
| 264 | */
|
---|
| 265 | if (nested_lock_os_int_cnt == 0U) {
|
---|
| 266 | set_pmr(pmr_isr2_mask); /* OSå²ãè¾¼ã¿ç¦æ¢ã«è¨å® */
|
---|
| 267 | }
|
---|
| 268 | nested_lock_os_int_cnt++;
|
---|
| 269 |
|
---|
| 270 | V850_MEMORY_CHANGED
|
---|
| 271 | }
|
---|
| 272 |
|
---|
| 273 | /*
|
---|
| 274 | * OSå²è¾¼ã¿è§£é¤
|
---|
| 275 | * APIå®è¡æã«å¼ã³åºããã
|
---|
| 276 | * å²è¾¼ã¿åªå
|
---|
| 277 | 度ãã¹ã¯ãISR2ã®åªå
|
---|
| 278 | 度ãã¹ã¯ã®ç¯å²ããé«ãç¶æ
|
---|
| 279 | ã§å¼ã³åºããã
|
---|
| 280 | * ãã¨ã¯ãªã(ISR1ããå¼ã³åºããããã¨ã¯ãªã)
|
---|
| 281 | */
|
---|
| 282 | LOCAL_INLINE void
|
---|
| 283 | x_nested_unlock_os_int(void)
|
---|
| 284 | {
|
---|
| 285 | V850_MEMORY_CHANGED
|
---|
| 286 | ASSERT(nested_lock_os_int_cnt > 0U);
|
---|
| 287 | nested_lock_os_int_cnt--;
|
---|
| 288 |
|
---|
| 289 | /*
|
---|
| 290 | * ä¸çªå¤å´ãªãå²è¾¼ã¿åªå
|
---|
| 291 | 度ãã¹ã¯ãæ´æ°
|
---|
| 292 | */
|
---|
| 293 | if (nested_lock_os_int_cnt == 0U) {
|
---|
| 294 | set_pmr(pmr_setting_tbl[current_iintpri]);
|
---|
| 295 | }
|
---|
| 296 | }
|
---|
| 297 |
|
---|
| 298 | /*
|
---|
| 299 | * SuspendOSInterrupts()ããå¼ã³åºãOSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 300 | ã¸ã®ç§»è¡
|
---|
| 301 | * x_nested_lock_os_int()ã¨ã®éãã¯ï¼ISR1ããå¼ã³åºãããå¯è½æ§ãããããï¼
|
---|
| 302 | * ç¾å¨ã®ISPRãOSå²è¾¼ã¿ç¦æ¢æã®å¤ããå°ããå ´åã¯ISR1ããå¼ã³åºãããã¨ãã¦ï¼
|
---|
| 303 | * ä½ããããªã¿ã¼ã³ãã
|
---|
| 304 | */
|
---|
| 305 | LOCAL_INLINE void
|
---|
| 306 | x_suspend_lock_os_int(void)
|
---|
| 307 | {
|
---|
| 308 | uint16 ispr;
|
---|
| 309 |
|
---|
| 310 | ispr = get_ispr();
|
---|
| 311 |
|
---|
| 312 | if ((ispr & pmr_isr1_mask) == 0U) {
|
---|
| 313 | /*
|
---|
| 314 | * ã«ãã´ãª1 ISRããå¼ã°ããå ´åã¯ä½ãããªã
|
---|
| 315 | */
|
---|
| 316 | if (nested_lock_os_int_cnt == 0U) {
|
---|
| 317 | set_pmr(pmr_isr2_mask); /* OSå²ãè¾¼ã¿ç¦æ¢ã«è¨å® */
|
---|
| 318 | }
|
---|
| 319 | nested_lock_os_int_cnt++;
|
---|
| 320 | V850_MEMORY_CHANGED
|
---|
| 321 | }
|
---|
| 322 | }
|
---|
| 323 |
|
---|
| 324 | /*
|
---|
| 325 | * ResumeOSInterrupts()ããå¼ã³åºãOSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 326 | ã®è§£é¤
|
---|
| 327 | * x_nested_lock_os_int()ã¨ã®éãã¯ï¼ISR1ããå¼ã³åºãããå¯è½æ§ãããããï¼
|
---|
| 328 | * ç¾å¨ã®ISPRãOSå²è¾¼ã¿ç¦æ¢æã®å¤ããå°ããå ´åã¯ISR1ããå¼ã³åºãããã¨ãã¦ï¼
|
---|
| 329 | * ä½ããããªã¿ã¼ã³ãã
|
---|
| 330 | */
|
---|
| 331 | LOCAL_INLINE void
|
---|
| 332 | x_resume_unlock_os_int(void)
|
---|
| 333 | {
|
---|
| 334 | uint16 ispr;
|
---|
| 335 |
|
---|
| 336 | V850_MEMORY_CHANGED
|
---|
| 337 | ispr = get_ispr();
|
---|
| 338 |
|
---|
| 339 | if ((ispr & pmr_isr1_mask) == 0U) {
|
---|
| 340 | /*
|
---|
| 341 | * ã«ãã´ãª1 ISRããå¼ã°ããå ´åã¯ä½ãããªã
|
---|
| 342 | */
|
---|
| 343 | ASSERT(nested_lock_os_int_cnt > 0U);
|
---|
| 344 | nested_lock_os_int_cnt--;
|
---|
| 345 |
|
---|
| 346 | /*
|
---|
| 347 | * ä¸çªå¤å´ãªãå²è¾¼ã¿åªå
|
---|
| 348 | 度ãã¹ã¯ãæ´æ°
|
---|
| 349 | */
|
---|
| 350 | if (nested_lock_os_int_cnt == 0U) {
|
---|
| 351 | set_pmr(pmr_setting_tbl[current_iintpri]);
|
---|
| 352 | }
|
---|
| 353 | }
|
---|
| 354 | }
|
---|
| 355 |
|
---|
| 356 |
|
---|
| 357 | /*
|
---|
| 358 | * (ã¢ãã«ä¸ã®)å²è¾¼ã¿åªå
|
---|
| 359 | 度ãã¹ã¯ã®è¨å®
|
---|
| 360 | *
|
---|
| 361 | * æ¬OSã§ã¯æ¬¡ã®äºç¹ãæãç«ã¤
|
---|
| 362 | * * OSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 363 | ã§å¼ã³åºããã
|
---|
| 364 | * * OSå²è¾¼ã¿ç¦æ¢æã®åªå
|
---|
| 365 | 度ããé«ãå¤ã¯æå®ãããªã
|
---|
| 366 | * OSå²è¾¼ã¿ç¦æ¢ã¯PMRã§å®ç¾ããã¦ããï¼ããã§PMRãå¤æ´ããã¨ï¼OSå²è¾¼ã¿ç¦æ¢
|
---|
| 367 | * ã解é¤ãããå ´åãããããï¼å
|
---|
| 368 | é¨å¤æ°(current_iintpri) ã®å¤æ´ã®ã¿ãè¡ãï¼
|
---|
| 369 | * åªå
|
---|
| 370 | 度ãã¹ã¯ã®å¤æ´ã¯ï¼APIã®åºå£ã§å¼ã³åºãããï¼x_nested_unlock_os_int()
|
---|
| 371 | * ã§å®æ½ãããï¼
|
---|
| 372 | */
|
---|
| 373 | LOCAL_INLINE void
|
---|
| 374 | x_set_ipm(PriorityType intpri)
|
---|
| 375 | {
|
---|
| 376 | ASSERT(nested_lock_os_int_cnt > 0U);
|
---|
| 377 |
|
---|
| 378 | current_iintpri = INT_IPM(intpri);
|
---|
| 379 | }
|
---|
| 380 |
|
---|
| 381 | /*
|
---|
| 382 | * (ã¢ãã«ä¸ã®)å²è¾¼ã¿åªå
|
---|
| 383 | 度ãã¹ã¯ã®åç
|
---|
| 384 | §
|
---|
| 385 | *
|
---|
| 386 | * æ¬OSã§ã¯æ¬¡ã®ç¹ãæãç«ã¤
|
---|
| 387 | * * OSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 388 | ã§å¼ã³åºããã
|
---|
| 389 | */
|
---|
| 390 | LOCAL_INLINE PriorityType
|
---|
| 391 | x_get_ipm(void)
|
---|
| 392 | {
|
---|
| 393 | ASSERT(nested_lock_os_int_cnt > 0U);
|
---|
| 394 | return(EXT_IPM(current_iintpri));
|
---|
| 395 | }
|
---|
| 396 |
|
---|
| 397 | /*
|
---|
| 398 | * å²è¾¼ã¿è¦æ±ç¦æ¢ãã©ã°ã®ã»ãã
|
---|
| 399 | *
|
---|
| 400 | * å²è¾¼ã¿å±æ§ãè¨å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ¢
|
---|
| 401 | * ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
|
---|
| 402 | */
|
---|
| 403 | LOCAL_INLINE boolean
|
---|
| 404 | x_disable_int(InterruptNumberType intno)
|
---|
| 405 | {
|
---|
| 406 | uint32 eic_address = EIC_ADDRESS(intno);
|
---|
| 407 |
|
---|
| 408 | if (!VALID_INTNO(intno)) {
|
---|
| 409 | return(FALSE);
|
---|
| 410 | }
|
---|
| 411 |
|
---|
| 412 | /* å²è¾¼ã¿ã®ç¦æ¢(7bitç®ãã»ãã) */
|
---|
| 413 | sil_wrh_mem((void *) eic_address,
|
---|
| 414 | sil_reh_mem((void *) eic_address) | (0x01U << 7));
|
---|
| 415 |
|
---|
| 416 | return(TRUE);
|
---|
| 417 | }
|
---|
| 418 | /*
|
---|
| 419 | * å²è¾¼ã¿è¦æ±ç¦æ¢ãã©ã°ã®è§£é¤
|
---|
| 420 | *
|
---|
| 421 | * å²è¾¼ã¿å±æ§ãè¨å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ¢
|
---|
| 422 | * ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
|
---|
| 423 | */
|
---|
| 424 |
|
---|
| 425 | LOCAL_INLINE boolean
|
---|
| 426 | x_enable_int(InterruptNumberType intno)
|
---|
| 427 | {
|
---|
| 428 | uint32 eic_address = EIC_ADDRESS(intno);
|
---|
| 429 |
|
---|
| 430 | if (!VALID_INTNO(intno)) {
|
---|
| 431 | return(FALSE);
|
---|
| 432 | }
|
---|
| 433 |
|
---|
| 434 | /* 7bitç®ãã¯ãªã¢ */
|
---|
| 435 | sil_wrh_mem((void *) eic_address,
|
---|
| 436 | sil_reh_mem((void *) eic_address) & ~(0x01U << 7));
|
---|
| 437 |
|
---|
| 438 | return(TRUE);
|
---|
| 439 | }
|
---|
| 440 |
|
---|
| 441 | /*
|
---|
| 442 | * å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
|
---|
| 443 | */
|
---|
| 444 | LOCAL_INLINE boolean
|
---|
| 445 | x_clear_int(InterruptNumberType intno)
|
---|
| 446 | {
|
---|
| 447 | uint32 eic_address = EIC_ADDRESS(intno);
|
---|
| 448 |
|
---|
| 449 | if (!VALID_INTNO(intno)) {
|
---|
| 450 | return(FALSE);
|
---|
| 451 | }
|
---|
| 452 |
|
---|
| 453 | /* å²è¾¼ã¿ã®ã¯ãªã¢(12bitç®ãã¯ãªã¢) */
|
---|
| 454 | sil_wrh_mem((void *) eic_address,
|
---|
| 455 | sil_reh_mem((void *) eic_address) & ~(0x01U << 12));
|
---|
| 456 |
|
---|
| 457 | return(TRUE);
|
---|
| 458 | }
|
---|
| 459 |
|
---|
| 460 | /*
|
---|
| 461 | * å²è¾¼ã¿è¦æ±ã®ãã§ãã¯
|
---|
| 462 | */
|
---|
| 463 | LOCAL_INLINE boolean
|
---|
| 464 | x_probe_int(InterruptNumberType intno)
|
---|
| 465 | {
|
---|
| 466 | uint32 eic_address = EIC_ADDRESS(intno);
|
---|
| 467 | uint16 tmp;
|
---|
| 468 |
|
---|
| 469 | if (!VALID_INTNO(intno)) {
|
---|
| 470 | return(FALSE);
|
---|
| 471 | }
|
---|
| 472 |
|
---|
| 473 | tmp = sil_reh_mem((void *) (eic_address));
|
---|
| 474 | return((tmp & 0x1000) != 0);
|
---|
| 475 | }
|
---|
| 476 |
|
---|
| 477 | /*
|
---|
| 478 | * å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨å®
|
---|
| 479 | */
|
---|
| 480 | extern void x_config_int(InterruptNumberType intno, AttributeType intatr, PriorityType intpri);
|
---|
| 481 |
|
---|
| 482 | /*
|
---|
| 483 | * å²è¾¼ã¿ãã³ãã©ã®å
|
---|
| 484 | ¥ãå£ã§å¿
|
---|
| 485 | è¦ãªIRCæä½
|
---|
| 486 | */
|
---|
| 487 | LOCAL_INLINE void
|
---|
| 488 | i_begin_int(InterruptNumberType intno)
|
---|
| 489 | {
|
---|
| 490 |
|
---|
| 491 | }
|
---|
| 492 |
|
---|
| 493 | /*
|
---|
| 494 | * å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¿
|
---|
| 495 | è¦ãªIRCæä½
|
---|
| 496 | */
|
---|
| 497 | LOCAL_INLINE void
|
---|
| 498 | i_end_int(InterruptNumberType intno)
|
---|
| 499 | {
|
---|
| 500 |
|
---|
| 501 | }
|
---|
| 502 |
|
---|
| 503 | /*
|
---|
| 504 | * æªå®ç¾©ã®å²è¾¼ã¿ãå
|
---|
| 505 | ¥ã£ãå ´åã®å¦ç
|
---|
| 506 | */
|
---|
| 507 | extern void default_int_handler(void);
|
---|
| 508 | extern void _start(void);
|
---|
| 509 | extern void prc_hardware_initialize(void);
|
---|
| 510 |
|
---|
| 511 | /*
|
---|
| 512 | * ããã»ããµä¾åã®åæå
|
---|
| 513 | */
|
---|
| 514 | extern void prc_initialize(void);
|
---|
| 515 |
|
---|
| 516 | /*
|
---|
| 517 | * ããã»ããµä¾åã®çµäºæå¦ç
|
---|
| 518 | */
|
---|
| 519 | extern void prc_terminate(void);
|
---|
| 520 |
|
---|
| 521 | /*
|
---|
| 522 | * ã¿ã¹ã¯ãã£ã¹ãããã£
|
---|
| 523 | */
|
---|
| 524 |
|
---|
| 525 | /*
|
---|
| 526 | * æé«åªå
|
---|
| 527 | é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ãããï¼prc_support.Sï¼
|
---|
| 528 | *
|
---|
| 529 | * dispatch ã¯ï¼ã¿ã¹ã¯ã³ã³ããã¹ãããå¼ã³åºããããµã¼ãã¹ã³ã¼ã«å¦ç
|
---|
| 530 | * å
|
---|
| 531 | ã§ï¼OSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 532 | ã§å¼ã³åºããªããã°ãªããªã
|
---|
| 533 | */
|
---|
| 534 | extern void dispatch(void);
|
---|
| 535 |
|
---|
| 536 | /*
|
---|
| 537 | * ãã£ã¹ãããã£ã®åä½éå§ï¼prc_support.Sï¼
|
---|
| 538 | *
|
---|
| 539 | * start_dispatchã¯ï¼ã«ã¼ãã«èµ·åæã«å¼ã³åºãã¹ããã®ã§ï¼ãã¹ã¦ã®å²è¾¼
|
---|
| 540 | * ã¿ãç¦æ¢ããç¶æ
|
---|
| 541 | ï¼å
|
---|
| 542 | ¨å²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 543 | ã¨åçã®ç¶æ
|
---|
| 544 | ï¼ã§å¼ã³åºããªããã°
|
---|
| 545 | * ãªããªã
|
---|
| 546 | */
|
---|
| 547 | extern void start_dispatch(void) NoReturn;
|
---|
| 548 |
|
---|
| 549 | /*
|
---|
| 550 | * ç¾å¨ã®ã³ã³ããã¹ããæ¨ã¦ã¦ãã£ã¹ãããï¼prc_support.Sï¼
|
---|
| 551 | *
|
---|
| 552 | * exit_and_dispatch ã¯ï¼OSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 553 | ã§å¼ã³åºããªããã°ãªããªã
|
---|
| 554 | */
|
---|
| 555 | extern void exit_and_dispatch(void) NoReturn;
|
---|
| 556 |
|
---|
| 557 | /* =begin added for SC3 */
|
---|
| 558 | /*
|
---|
| 559 | * ç¾å¨ã®ã³ã³ããã¹ããæ¨ã¦ã¦ãã£ã¹ãããï¼prc_support.Sï¼
|
---|
| 560 | * PosttaskHook ãå¼ã°ãªãã¨ã³ããª
|
---|
| 561 | *
|
---|
| 562 | * exit_and_dispatch_nohook ã¯ï¼OSå²è¾¼ã¿ç¦æ¢ç¶æ
|
---|
| 563 | ã§å¼ã³åºããªããã°ãªããªã
|
---|
| 564 | */
|
---|
| 565 | extern void exit_and_dispatch_nohook(void) NoReturn;
|
---|
| 566 | /* =end added for SC3 */
|
---|
| 567 |
|
---|
| 568 | /*
|
---|
| 569 | * ã¿ã¹ã¯ã³ã³ããã¹ããããã¯ã®å®ç¾©
|
---|
| 570 | */
|
---|
| 571 | typedef struct task_context_block {
|
---|
| 572 | /* =begin modified for SC3 */
|
---|
| 573 | void *ssp; /* ã·ã¹ãã ã¹ã¿ãã¯ãã¤ã³ã¿ */
|
---|
| 574 | void *usp; /* ã¦ã¼ã¶ã¹ã¿ãã¯ãã¤ã³ã¿ */
|
---|
| 575 | boolean priv_mode; /* ç¹æ¨©ã¢ã¼ãå®è¡ä¸ã */
|
---|
| 576 | /* =end modified for SC3 */
|
---|
| 577 | FunctionRefType pc; /* ããã°ã©ã ã«ã¦ã³ã¿ */
|
---|
| 578 | } TSKCTXB;
|
---|
| 579 |
|
---|
| 580 | /* =begin modified for SC3 */
|
---|
| 581 | /*
|
---|
| 582 | * ã¿ã¹ã¯åæåã³ã³ããã¹ããããã¯
|
---|
| 583 | */
|
---|
| 584 | #define USE_TSKINICTXB /* TSKINICTXBã使ç¨ãã */
|
---|
| 585 |
|
---|
| 586 | typedef struct task_initialization_context_block {
|
---|
| 587 | MemorySizeType sstksz; /* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
|
---|
| 588 | void *sstk_bottom; /* ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ï¼ã¹ã¿ãã¯ã®åºã®åæå¤ï¼ */
|
---|
| 589 | MemorySizeType stksz; /* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
|
---|
| 590 | void *stk_bottom; /* ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ï¼ã¹ã¿ãã¯ã®åºã®åæå¤ï¼ */
|
---|
| 591 | } TSKINICTXB;
|
---|
| 592 |
|
---|
| 593 | /*
|
---|
| 594 | * ã¹ã¿ãã¯ã®MPUæ
|
---|
| 595 | å ±
|
---|
| 596 | */
|
---|
| 597 | typedef struct task_stack_mpu_info_block {
|
---|
| 598 | uint8 *start_ustk_label;
|
---|
| 599 | uint8 *limit_ustk_label;
|
---|
| 600 | } STKMPUINFOB;
|
---|
| 601 |
|
---|
| 602 | /*
|
---|
| 603 | * OSã¢ããªã±ã¼ã·ã§ã³ã®MPUæ
|
---|
| 604 | å ±
|
---|
| 605 | */
|
---|
| 606 | typedef struct {
|
---|
| 607 | uint32 mpul;
|
---|
| 608 | uint32 mpua;
|
---|
| 609 | uint32 mpat;
|
---|
| 610 | } MPUINFOB;
|
---|
| 611 |
|
---|
| 612 | typedef struct {
|
---|
| 613 | #ifdef __v850e2v3__
|
---|
| 614 | uint8 *start_text_label;
|
---|
| 615 | uint8 *limit_text_label;
|
---|
| 616 | uint8 *start_rosdata_label;
|
---|
| 617 | uint8 *limit_rosdata_label;
|
---|
| 618 | uint8 *start_ram_label;
|
---|
| 619 | uint8 *limit_ram_label;
|
---|
| 620 | uint8 *start_sram_label;
|
---|
| 621 | uint8 *limit_sram_label;
|
---|
| 622 | #else /* __v850e2v3__ */
|
---|
| 623 | #ifdef USE_MPU_SRPW_DATA
|
---|
| 624 | uint8 *start_srpw_label;
|
---|
| 625 | uint8 *limit_srpw_label;
|
---|
| 626 | #endif /* USE_MPU_SRPW_DATA */
|
---|
| 627 | #ifdef USE_MPU_SRPW_SDATA
|
---|
| 628 | uint8 *start_ssrpw_label;
|
---|
| 629 | uint8 *limit_ssrpw_label;
|
---|
| 630 | #endif /* USE_MPU_SRPW_SDATA */
|
---|
| 631 | #ifdef USE_MPU_PR_TEXT
|
---|
| 632 | uint8 *start_text_label;
|
---|
| 633 | uint8 *limit_text_label;
|
---|
| 634 | #endif /* USE_MPU_PR_TEXT */
|
---|
| 635 | #ifdef USE_MPU_PR_SDATA
|
---|
| 636 | uint8 *start_rosdata_label;
|
---|
| 637 | uint8 *limit_rosdata_label;
|
---|
| 638 | #endif /* USE_MPU_PR_SDATA */
|
---|
| 639 | #ifdef USE_MPU_PRW_DATA
|
---|
| 640 | uint8 *start_ram_label;
|
---|
| 641 | uint8 *limit_ram_label;
|
---|
| 642 | #endif /* USE_MPU_PRW_DATA */
|
---|
| 643 | #ifdef USE_MPU_PRW_SDATA
|
---|
| 644 | uint8 *start_sram_label;
|
---|
| 645 | uint8 *limit_sram_label;
|
---|
| 646 | #endif /* USE_MPU_PRW_SDATA */
|
---|
| 647 | MPUINFOB *mpu_area_info;
|
---|
| 648 | uint8 tnum_mpu_area;
|
---|
| 649 | uint32 mprc;
|
---|
| 650 | #endif /* __v850e2v3__ */
|
---|
| 651 | } OSAPMPUINFOB;
|
---|
| 652 | /* =end modified for SC3 */
|
---|
| 653 |
|
---|
| 654 | /*
|
---|
| 655 | * ã¿ã¹ã¯ã³ã³ããã¹ãã®åæå
|
---|
| 656 | *
|
---|
| 657 | * ã¿ã¹ã¯ãä¼æ¢ç¶æ
|
---|
| 658 | ããå®è¡ã§ããç¶æ
|
---|
| 659 | ã«ç§»è¡ããæã«å¼ã°ããï¼ãã®æç¹
|
---|
| 660 | * ã§ã¹ã¿ãã¯é åã使ã£ã¦ã¯ãªããªã
|
---|
| 661 | *
|
---|
| 662 | * activate_contextãï¼ã¤ã³ã©ã¤ã³é¢æ°ã§ã¯ãªããã¯ãå®ç¾©ã¨ãã¦ããã®ã¯ï¼
|
---|
| 663 | * ãã®æç¹ã§ã¯TCBãå®ç¾©ããã¦ããªãããã§ãã
|
---|
| 664 | */
|
---|
| 665 | /* =begin modified for SC3 */
|
---|
| 666 | extern void start_stask_r(void);
|
---|
| 667 | extern void start_utask_r(void);
|
---|
| 668 |
|
---|
| 669 | #define activate_context(p_tcb) \
|
---|
| 670 | {\
|
---|
| 671 | (p_tcb)->tskctxb.ssp = (p_tcb)->p_tinib->tskinictxb.sstk_bottom; \
|
---|
| 672 | (p_tcb)->tskctxb.pc = ((p_tcb)->p_tinib->p_osapcb->p_osapinib->osap_trusted != FALSE) ? (FunctionRefType)start_stask_r: (FunctionRefType)start_utask_r; \
|
---|
| 673 | (p_tcb)->tskctxb.priv_mode = 0U; \
|
---|
| 674 | }
|
---|
| 675 |
|
---|
| 676 | /*
|
---|
| 677 | * force_term_osap_mainã®èµ·å
|
---|
| 678 | * ãªã¹ã¿ã¼ãã¿ã¹ã¯ã®pcã«force_term_osap_mainã®ã¢ãã¬ã¹ãæ ¼ç´ãã
|
---|
| 679 | */
|
---|
| 680 | #ifdef CFG_USE_STACKMONITORING
|
---|
| 681 | #define activate_force_term_osap_main(p_tcb) \
|
---|
| 682 | {\
|
---|
| 683 | (p_tcb)->tskctxb.ssp = (p_tcb)->p_tinib->tskinictxb.sstk_bottom; \
|
---|
| 684 | *(uint32 *)((uint32)((p_tcb)->tskctxb.ssp) - ((p_tcb)->p_tinib->tskinictxb.sstksz)) = STACK_MAGIC_NUMBER; \
|
---|
| 685 | (p_tcb)->tskctxb.pc = &(force_term_osap_main); \
|
---|
| 686 | }
|
---|
| 687 | #else /*CFG_USE_STACKMONITORING*/
|
---|
| 688 | #define activate_force_term_osap_main(p_tcb) \
|
---|
| 689 | {\
|
---|
| 690 | (p_tcb)->tskctxb.ssp = (p_tcb)->p_tinib->tskinictxb.sstk_bottom; \
|
---|
| 691 | (p_tcb)->tskctxb.pc = &(force_term_osap_main); \
|
---|
| 692 | }
|
---|
| 693 | #endif /*CFG_USE_STACKMONITORING*/
|
---|
| 694 |
|
---|
| 695 | #define TOPPERS_SSTK_MAGIC_REGION(p_tinib) ((StackType *) ((uint32)(p_tinib)->tskinictxb.sstk_bottom - (uint32)(p_tinib)->tskinictxb.sstksz))
|
---|
| 696 | /* =end modified for SC3 */
|
---|
| 697 |
|
---|
| 698 | /* å¼æ°ã®åã¯ãã¼ãã¦ã§ã¢ãæ±ãããµã¤ãºï¼uint32ï¼ã¨åãµã¤ãºãä½¿ç¨ */
|
---|
| 699 | extern void stack_change_and_call_func_1(void (*func)(StatusType ercd), uint32 arg1);
|
---|
| 700 | extern void stack_change_and_call_func_2(void (*func)(StatusType ercd, OSServiceIdType svcid), uint8 arg1, uint8 arg2);
|
---|
| 701 |
|
---|
| 702 | /*
|
---|
| 703 | * 850ã§ã¯å
|
---|
| 704 | ¨ã¦ã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦
|
---|
| 705 | * æå¹/ç¡å¹ãå¶å¾¡å¯è½ã§ããããï¼å¸¸ã«trueãè¿ã
|
---|
| 706 | */
|
---|
| 707 | #define target_is_int_controllable(intno) TRUE
|
---|
| 708 |
|
---|
| 709 | #ifdef ENABLE_RETURN_MAIN
|
---|
| 710 | /*
|
---|
| 711 | * AKTSPç¨ã®main()ã¸ã®ãªã¿ã¼ã³ã³ã¼ãï¼prc_support.Sï¼
|
---|
| 712 | */
|
---|
| 713 | extern void return_main(void);
|
---|
| 714 | #endif /* ENABLE_RETURN_MAIN */
|
---|
| 715 |
|
---|
| 716 | /* =begin modified for SC3 */
|
---|
| 717 | #define call_protectionhk_main_stkchg(ercd) stack_change_and_call_func_1(&call_protectionhk_main, ((uint32) (ercd)))
|
---|
| 718 |
|
---|
| 719 | extern StatusType trustedfunc_stack_check(MemorySizeType size);
|
---|
| 720 | extern StatusType no_support_service(void);
|
---|
| 721 |
|
---|
| 722 | /*
|
---|
| 723 | * OSå²è¾¼ã¿ç¦æ¢æã®status.ILã¸ã®è¨å®å¤
|
---|
| 724 | */
|
---|
| 725 | extern const uint32 tmin_status_il;
|
---|
| 726 |
|
---|
| 727 | /*
|
---|
| 728 | * x_nested_lock_os_int()ã®ãã¹ãåæ°
|
---|
| 729 | * ã¢ã¯ã»ã¹ã®é åºãå¤åããªãããï¼volatile ãæå®
|
---|
| 730 | */
|
---|
| 731 | extern volatile uint8 nested_lock_os_int_cnt;
|
---|
| 732 |
|
---|
| 733 | LOCAL_INLINE void
|
---|
| 734 | x_clear_nested_os_int(void)
|
---|
| 735 | {
|
---|
| 736 | ASSERT(nested_lock_os_int_cnt > 0U);
|
---|
| 737 | nested_lock_os_int_cnt = 1U;
|
---|
| 738 | }
|
---|
| 739 |
|
---|
| 740 | #define check_address_sstack(base, size, p_tinib) (check_address_stack(base, size, (const MemoryStartAddressType)((uint32)(p_tinib)->tskinictxb.sstk_bottom - (uint32)(p_tinib)->tskinictxb.sstksz), (p_tinib)->tskinictxb.sstksz))
|
---|
| 741 | #define check_address_ustack(base, size, p_tinib) (check_address_stack(base, size, (const MemoryStartAddressType)((uint32)(p_tinib)->tskinictxb.stk_bottom - (uint32)(p_tinib)->tskinictxb.stksz), (p_tinib)->tskinictxb.stksz))
|
---|
| 742 |
|
---|
| 743 | /* =end modified for SC3 */
|
---|
| 744 |
|
---|
| 745 | #endif /* TOPPERS_MACRO_ONLY */
|
---|
| 746 |
|
---|
| 747 | /* =begin modified for SC3 */
|
---|
| 748 | /*
|
---|
| 749 | * syscallã®ãã©ã¡ã¼ã¿
|
---|
| 750 | */
|
---|
| 751 | #define NO_SVC 1 /* ãµã¼ãã¹ã³ã¼ã«å¼ã³åºãæã®svcã®å¼æ° */
|
---|
| 752 |
|
---|
| 753 | #ifdef USE_KERNEL_LIBRARY_SYSLOG
|
---|
| 754 | #include "prc_syslog.h"
|
---|
| 755 | #endif /* USE_KERNEL_LIBRARY_SYSLOG */
|
---|
| 756 | /* =end modified for SC3 */
|
---|
| 757 |
|
---|
| 758 | #define NTC2ISR
|
---|
| 759 |
|
---|
| 760 | #endif /* TOPPERS_PRC_CONFIG_H */
|
---|