Index: asp3_wo_tecs/trunk/kernel/interrupt.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/interrupt.trb	(revision 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: interrupt.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: interrupt.trb 612 2016-02-08 04:27:57Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
 $kernelCfgH.add("#define TNUM_ISRID\t#{$cfgData[:CRE_ISR].size}")
 
-$cfgData[:CRE_ISR].sort.each do |id, params|
+$cfgData[:CRE_ISR].sort.each do |key, params|
   $kernelCfgH.add("#define #{params[:isrid]}\t#{params[:isrid].val}")
 end
@@ -127,5 +127,5 @@
 #  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããã¨ã©ã¼ãã§ãã¯
 #
-$cfgData[:CFG_INT].each do |id, params|
+$cfgData[:CFG_INT].each do |key, params|
   #	intnoãå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2972ï¼½
   if $INTNO_VALID.index(params[:intno]).nil?
@@ -172,5 +172,5 @@
 #  å²è¾¼ã¿ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
 #
-$cfgData[:DEF_INH].each do |id, params|
+$cfgData[:DEF_INH].each do |key, params|
   # inhnoãå²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3055ï¼½
   if $INHNO_VALID.index(params[:inhno]).nil?
@@ -243,5 +243,5 @@
 #  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼ã«é¢ããã¨ã©ã¼ãã§ãã¯ã¨å²è¾¼ã¿ãã³ãã©ã®çæ
 #
-$cfgData[:CRE_ISR].sort.each do |id, params|
+$cfgData[:CRE_ISR].sort.each do |key, params|
   #	isratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2998ï¼½
   #ï¼TARGET_ISRATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -264,10 +264,8 @@
 
 $INTNO_CREISR_VALID.each do |intnoVal|
-  inhnoVal = $toInhnoVal[intnoVal]
-
   # å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRã®ãªã¹ãã®ä½æ
   isrParamsList = []
-  $cfgData[:CRE_ISR].sort.each do |id, params|
-    if params[:intno] == intnoVal
+  $cfgData[:CRE_ISR].sort.each do |key, params|
+    if params[:intno].val == intnoVal
       isrParamsList.push(params)
     end
@@ -276,4 +274,6 @@
   #	å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRãå­å¨ããå ´å
   if isrParamsList.size > 0
+    inhnoVal = $toInhnoVal[intnoVal]
+
     # intnoã«å¯¾å¿ããinhnoã«å¯¾ãã¦DEF_INHãããå ´åï¼E_OBJï¼ï¼»NGKI3013ï¼½
     if $cfgData[:DEF_INH].has_key?(inhnoVal)
@@ -312,12 +312,13 @@
     $cfgData[:DEF_INH][inhnoVal] = params
 
-    # ISRç¨ã®å²è¾¼ã¿ãã³ãã©
+    # å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç¨ã®å²è¾¼ã¿ãã³ãã©
     $kernelCfgC.add("void")
     $kernelCfgC.add("_kernel_inthdr_#{intnoVal}(void)")
     $kernelCfgC.add("{")
-    # ISRãåªå
+    # å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãåªå
 åº¦é ã«å¼ã³åºã
-    isrParamsList.sort_by {|params| params[:isrpri]}.each_with_index \
-														do |params, index|
+    i = 0		# stable sortãè¡ãããã®å¤æ°
+    isrParamsList.sort_by {|params| [ params[:isrpri].val, i += 1 ]} \
+										.each_with_index do |params, index|
       if index > 0
         $kernelCfgC.add
@@ -353,5 +354,5 @@
     #  å²è¾¼ã¿ãã³ãã©ã®ã¨ã³ããª
     #
-    $cfgData[:DEF_INH].each do |id, params|
+    $cfgData[:DEF_INH].each do |key, params|
       if (params[:inhatr] & $TA_NONKERNEL) == 0
         $kernelCfgC.add("INTHDR_ENTRY(#{params[:inhno]}, " \
@@ -365,5 +366,5 @@
     #
     $kernelCfgC.add("const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {")
-    $cfgData[:DEF_INH].each_with_index do |(id, params), index|
+    $cfgData[:DEF_INH].each_with_index do |(key, params), index|
       $kernelCfgC.add(",") if index > 0
       if (params[:inhatr] & $TA_NONKERNEL) == 0
@@ -402,5 +403,5 @@
   if $cfgData[:CFG_INT].size != 0
     $kernelCfgC.add("const INTINIB _kernel_intinib_table[TNUM_CFG_INTNO] = {")
-    $cfgData[:CFG_INT].each_with_index do |(id, params), index|
+    $cfgData[:CFG_INT].each_with_index do |(key, params), index|
       $kernelCfgC.add(",") if index > 0
       $kernelCfgC.append("\t{ (#{params[:intno]}), (#{params[:intatr]}), " \
