[61] | 1 | /*
|
---|
| 2 | * TOPPERS/ASP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Advanced Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 8 | * Copyright (C) 2005-2010 by Embedded and Real-Time Systems Laboratory
|
---|
| 9 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
| 10 | *
|
---|
| 11 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
| 12 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
| 13 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
| 14 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
| 15 | * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
| 16 | * XR[hÉÜÜêÄ¢é±ÆD
|
---|
| 17 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
| 18 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
| 19 | gip
|
---|
| 20 | * Ò}j
|
---|
| 21 | AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL
|
---|
| 22 | * ̳ÛØKèðfÚ·é±ÆD
|
---|
| 23 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
| 24 | * pÅ«È¢`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
| 25 | * ÆD
|
---|
| 26 | * (a) Äzzɺ¤hL
|
---|
| 27 | gipÒ}j
|
---|
| 28 | AÈÇjÉCãLÌ
|
---|
| 29 | * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD
|
---|
| 30 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
| 31 | * ñ·é±ÆD
|
---|
| 32 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
| 33 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
| 34 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
| 35 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
| 36 | * ÆÓ·é±ÆD
|
---|
| 37 | *
|
---|
| 38 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
| 39 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
| 40 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
| 41 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
| 42 | * ÌÓCðíÈ¢D
|
---|
| 43 | *
|
---|
| 44 | * @(#) $Id: exception.c 2010 2010-12-31 12:44:33Z ertl-hiro $
|
---|
| 45 | */
|
---|
| 46 |
|
---|
| 47 | /*
|
---|
| 48 | * CPUáOÇ@\
|
---|
| 49 | */
|
---|
| 50 |
|
---|
| 51 | #include "kernel_impl.h"
|
---|
| 52 | #include "task.h"
|
---|
| 53 | #include "exception.h"
|
---|
| 54 |
|
---|
| 55 | /*
|
---|
| 56 | * g[XO}NÌftHgè`
|
---|
| 57 | */
|
---|
| 58 | #ifndef LOG_XSNS_DPN_ENTER
|
---|
| 59 | #define LOG_XSNS_DPN_ENTER(p_excinf)
|
---|
| 60 | #endif /* LOG_XSNS_DPN_ENTER */
|
---|
| 61 |
|
---|
| 62 | #ifndef LOG_XSNS_DPN_LEAVE
|
---|
| 63 | #define LOG_XSNS_DPN_LEAVE(state)
|
---|
| 64 | #endif /* LOG_XSNS_DPN_LEAVE */
|
---|
| 65 |
|
---|
| 66 | #ifndef LOG_XSNS_XPN_ENTER
|
---|
| 67 | #define LOG_XSNS_XPN_ENTER(p_excinf)
|
---|
| 68 | #endif /* LOG_XSNS_XPN_ENTER */
|
---|
| 69 |
|
---|
| 70 | #ifndef LOG_XSNS_XPN_LEAVE
|
---|
| 71 | #define LOG_XSNS_XPN_LEAVE(state)
|
---|
| 72 | #endif /* LOG_XSNS_XPN_LEAVE */
|
---|
| 73 |
|
---|
| 74 | /*
|
---|
| 75 | * CPUáOnhÇ@\Ìú»
|
---|
| 76 | */
|
---|
| 77 | #ifdef TOPPERS_excini
|
---|
| 78 | #ifndef OMIT_INITIALIZE_EXCEPTION
|
---|
| 79 |
|
---|
| 80 | void
|
---|
| 81 | initialize_exception(void)
|
---|
| 82 | {
|
---|
| 83 | uint_t i;
|
---|
| 84 | const EXCINIB *p_excinib;
|
---|
| 85 |
|
---|
| 86 | for (p_excinib = excinib_table, i = 0; i < tnum_excno; p_excinib++, i++) {
|
---|
| 87 | x_define_exc(p_excinib->excno, p_excinib->exc_entry);
|
---|
| 88 | }
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | #endif /* OMIT_INITIALIZE_EXCEPTION */
|
---|
| 92 | #endif /* TOPPERS_excini */
|
---|
| 93 |
|
---|
| 94 | /*
|
---|
| 95 | * CPUáO̶µ½ReLXgÌQÆ
|
---|
| 96 | */
|
---|
| 97 |
|
---|
| 98 | /*
|
---|
| 99 | * CPUáO¶ÌfBXpb`Û¯óÔÌQÆ
|
---|
| 100 | *
|
---|
| 101 | * CPUáOnhÅdisdspªÏ»·é±ÆÍÈ¢½ßCCPUáOª¶µ
|
---|
| 102 | * ½ÌdisdspðÛ¶µÄ¨KvÍÈ¢D
|
---|
| 103 | */
|
---|
| 104 | #ifdef TOPPERS_xsns_dpn
|
---|
| 105 |
|
---|
| 106 | bool_t
|
---|
| 107 | xsns_dpn(void *p_excinf)
|
---|
| 108 | {
|
---|
| 109 | bool_t state;
|
---|
| 110 |
|
---|
| 111 | LOG_XSNS_DPN_ENTER(p_excinf);
|
---|
| 112 | state = (exc_sense_intmask(p_excinf) && !disdsp) ? false : true;
|
---|
| 113 | LOG_XSNS_DPN_LEAVE(state);
|
---|
| 114 | return(state);
|
---|
| 115 | }
|
---|
| 116 |
|
---|
| 117 | #endif /* TOPPERS_xsns_dpn */
|
---|
| 118 |
|
---|
| 119 | /*
|
---|
| 120 | * CPUáO¶Ì^XNáOÛ¯óÔÌQÆ
|
---|
| 121 | *
|
---|
| 122 | * CPUáOnhÅp_runtskÆp_runtsk->enatexªÏ»·é±ÆÍÈ¢
|
---|
| 123 | * ½ßCCPUáOª¶µ½Ìp_runtsk->enatexðÛ¶µÄ¨KvÍÈ
|
---|
| 124 | * ¢D
|
---|
| 125 | */
|
---|
| 126 | #ifdef TOPPERS_xsns_xpn
|
---|
| 127 |
|
---|
| 128 | bool_t
|
---|
| 129 | xsns_xpn(void *p_excinf)
|
---|
| 130 | {
|
---|
| 131 | bool_t state;
|
---|
| 132 |
|
---|
| 133 | LOG_XSNS_XPN_ENTER(p_excinf);
|
---|
| 134 | state = (exc_sense_intmask(p_excinf) && p_runtsk->enatex) ? false : true;
|
---|
| 135 | LOG_XSNS_XPN_LEAVE(state);
|
---|
| 136 | return(state);
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | #endif /* TOPPERS_xsns_xpn */
|
---|