Index: packages/hal/h8300/aki3068net/current/include/platform.inc
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/include/platform.inc,v
retrieving revision 1.2
diff -u -r1.2 platform.inc
--- packages/hal/h8300/aki3068net/current/include/platform.inc	23 May 2002 23:02:55 -0000	1.2
+++ packages/hal/h8300/aki3068net/current/include/platform.inc	30 Aug 2002 17:14:01 -0000
@@ -69,24 +69,24 @@
 	.macro	hal_memc_init
 #if defined(CYG_HAL_STARTUP_ROM)
 	mov.l	#init_regs,er0
-	mov.w	#8,e1
 1:
 	mov.l	@er0+,er2
+	beq	2f
 	mov.w	@er0+,r1
 	mov.b	r1l,@er2
-	dec.w	#1,e1
-	bne	1b
-	bra	2f
+	bra	1b
 
 init_regs:
 	.long	CYGARC_RTCOR
-	.word	5		; 1.5[ms] reflesh cycle
+	.word	99
 	.long	CYGARC_RTMCSR
-	.word	0x30		; clk x 2048
+	.word	0x0f
 	.long	CYGARC_DRCRB
-	.word	0x90
+	.word	0x98
 	.long	CYGARC_DRCRA
-	.word	0x22
+	.word	0x3c
+	.long	CYGARC_ASTCR
+	.word	0xfb
 	.long	CYGARC_P1DDR
 	.word	0xff
 	.long	CYGARC_P2DDR
@@ -95,6 +95,7 @@
 	.word	0x01
 	.long	CYGARC_P8DDR
 	.word	0x0c
+	.long	0
 init_regs_end:
 
 2:
Index: packages/hal/h8300/aki3068net/current/src/hal_diag.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/src/hal_diag.c,v
retrieving revision 1.2
diff -u -r1.2 hal_diag.c
--- packages/hal/h8300/aki3068net/current/src/hal_diag.c	23 May 2002 23:02:55 -0000	1.2
+++ packages/hal/h8300/aki3068net/current/src/hal_diag.c	30 Aug 2002 17:14:01 -0000
@@ -40,9 +40,9 @@
 //=============================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   dsm
-// Contributors:        dsm
-// Date:        1998-03-13
+// Author(s):   ysato
+// Contributors: ysato
+// Date:        2002-04-05
 // Purpose:     HAL diagnostic output
 // Description: Implementations of HAL diagnostic output support.
 //
Index: packages/hal/h8300/aki3068net/current/src/plf_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/src/plf_misc.c,v
retrieving revision 1.2
diff -u -r1.2 plf_misc.c
--- packages/hal/h8300/aki3068net/current/src/plf_misc.c	23 May 2002 23:02:56 -0000	1.2
+++ packages/hal/h8300/aki3068net/current/src/plf_misc.c	30 Aug 2002 17:14:01 -0000
@@ -122,40 +122,5 @@
     *pvalue = val;
 }
 
-//---------------------------------------------------------------------------
-// Low-level delay (in microseconds)
-
-#if 0
-void hal_delay_us(int usecs)
-{
-    volatile CYG_BYTE *tcr  = (CYG_BYTE *)CYGARC_8TCR2;
-    volatile CYG_BYTE *tcnt = (CYG_BYTE *)CYGARC_8TCNT2;
-    short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/8*25;
-    //short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/20;
-    unsigned char val1,val2;
-    short diff;
-
-    usecs /= 25;
-
-    *tcnt = 0x00;
-    *tcr  = 0x01;
-    
-    diff = 0;
-    while (usecs > 0) {
-	while (diff < clocks_per_us) {
-            val1 = *tcnt;
-	    while ((val2 = *tcnt) == val1);
-	    if (val2 < val1)
-	        diff += val2 + 0x100 - val1;
-	    else
-		diff += val2 - val1;
-	}
-	usecs -= diff / clocks_per_us;
-	diff -= clocks_per_us;
-    }
-    *tcr  = 0x00;
-}
-#endif
-
 /*------------------------------------------------------------------------*/
 /* End of plf_misc.c                                                      */
Index: packages/hal/h8300/arch/current/include/h8300_stub.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/include/h8300_stub.h,v
retrieving revision 1.2
diff -u -r1.2 h8300_stub.h
--- packages/hal/h8300/arch/current/include/h8300_stub.h	23 May 2002 23:02:56 -0000	1.2
+++ packages/hal/h8300/arch/current/include/h8300_stub.h	30 Aug 2002 17:14:02 -0000
@@ -57,7 +57,9 @@
 extern "C" {
 #endif
 
-#define NUMREGS    32
+#define NUMREGS     10
+
+#define NUMREGBYTES (4*10)
 
 #define REGSIZE( _x_ ) (4)
 
@@ -65,7 +67,7 @@
 
 enum regnames {
   ER0,ER1,ER2,ER3,ER4,ER5,ER6,
-  SP, PC, CCR
+  SP, CCR,PC
 };
 
 typedef enum regnames regnames_t;
Index: packages/hal/h8300/arch/current/include/hal_arch.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/include/hal_arch.h,v
retrieving revision 1.2
diff -u -r1.2 hal_arch.h
--- packages/hal/h8300/arch/current/include/hal_arch.h	23 May 2002 23:02:56 -0000	1.2
+++ packages/hal/h8300/arch/current/include/hal_arch.h	30 Aug 2002 17:14:02 -0000
@@ -42,9 +42,9 @@
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):     nickg
-// Contributors:  nickg
-// Date:          1999-02-18
+// Author(s):     Yoshinori Sato
+// Contributors:  Yoshinori Sato
+// Date:          2002-02-13
 // Purpose:       Define architecture abstractions
 // Usage:         #include <cyg/hal/hal_arch.h>
 //              
@@ -102,7 +102,6 @@
     _regs_->er4   = (_id_)|0xddd4;                                          \
     _regs_->er5   = (_id_)|0xddd5;                                          \
     _regs_->er6   = (_id_)|0xddd6;                                          \
-    _regs_->ccr   = 0x00;                                                   \
     _regs_->pc    = (CYG_WORD)(_entry_);                                    \
     _sp_          = (CYG_ADDRESS)_regs_;                                    \
 }
@@ -146,7 +145,7 @@
               "trapa #3"                                       \
     );
 
-#define HAL_BREAKINST           0x5703
+#define HAL_BREAKINST           0x5730
 
 #define HAL_BREAKINST_SIZE      2
 
@@ -180,10 +179,9 @@
     _regval_[5]         = (_regs_)->er5;                        \
     _regval_[6]         = (_regs_)->er6;                        \
                                                                 \
-    _regval_[7]         = (CYG_ADDRWORD)(_regs_) +              \
-                          sizeof(HAL_SavedRegisters);           \
-    _regval_[8]         = (_regs_)->pc;                         \
-    _regval_[9]         = (_regs_)->ccr;                        \
+    _regval_[7]         = (_regs_)->sp;                         \
+    _regval_[8]         = (_regs_)->pc >> 24;                   \
+    _regval_[9]         = (_regs_)->pc & 0xffffff;              \
                                                                 \
     HAL_GET_GDB_EXTRA_REGISTERS( _regval_, _regs_ );            \
 }
@@ -201,8 +199,8 @@
     (_regs_)->er5            = _regval_[5];                             \
     (_regs_)->er6            = _regval_[6];                             \
                                                                         \
-    (_regs_)->pc             = _regval_[8];                             \
-    (_regs_)->ccr            = _regval_[9];                             \
+    (_regs_)->pc             = (_regval_[8] & 0x7f) << 24 |             \
+                               (_regval_[9] & 0xffffff);                \
                                                                         \
     /* We do not allow the SP or PSW to be set. Changing the SP will    \
      * mess up the saved state. No PSW is saved on thread context       \
@@ -211,6 +209,10 @@
                                                                         \
      HAL_SET_GDB_EXTRA_REGISTERS( _regs_, _regval_ );                   \
 }
+
+#ifndef CYGARC_HAL_GET_PC_REG
+#define CYGARC_HAL_GET_PC_REG(_regs_,_val_) ((_val_) = (_regs_)->pc & 0xffffff)
+#endif
 
 //-------------------------------------------------------------------------
 // HAL setjmp
Index: packages/hal/h8300/arch/current/src/context.S
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/src/context.S,v
retrieving revision 1.2
diff -u -r1.2 context.S
--- packages/hal/h8300/arch/current/src/context.S	23 May 2002 23:02:57 -0000	1.2
+++ packages/hal/h8300/arch/current/src/context.S	30 Aug 2002 17:14:03 -0000
@@ -68,6 +68,8 @@
 	.global	CYG_LABEL_DEFN(hal_thread_switch_context)
 CYG_LABEL_DEFN(hal_thread_switch_context):
 	hal_cpu_save_all
+	stc	ccr,r2l
+	mov.b	r2l,@(4*8,sp)
 	mov.l	sp,@er1
 	
 	# Now load the destination thread by dropping through
@@ -85,7 +87,7 @@
 
 	mov.l	@er0,sp
 	hal_cpu_load_all
-	rts
+	rte
 	
 ##-----------------------------------------------------------------------------
 ## HAL longjmp(), setjmp() implementations
Index: packages/hal/h8300/arch/current/src/h8300_stub.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/src/h8300_stub.c,v
retrieving revision 1.2
diff -u -r1.2 h8300_stub.c
--- packages/hal/h8300/arch/current/src/h8300_stub.c	23 May 2002 23:02:57 -0000	1.2
+++ packages/hal/h8300/arch/current/src/h8300_stub.c	30 Aug 2002 17:14:03 -0000
@@ -40,9 +40,9 @@
 //========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):     Red Hat, jskov
-// Contributors:  Red Hat, jskov
-// Date:          1998-11-06
+// Author(s):     Yoshinori Sato
+// Contributors:  Yoshinori Sato
+// Date:          2002-05-03
 // Purpose:       
 // Description:   Helper functions for H8/300H stub
 // Usage:         
@@ -133,7 +133,7 @@
 
 #define NUM_SS_BPTS 2
 static target_register_t break_mem [NUM_SS_BPTS] = {0, 0};
-static unsigned char break_mem_data [NUM_SS_BPTS];
+static unsigned short break_mem_data [NUM_SS_BPTS];
 
 /* Set a single-step breakpoint at ADDR.  Up to two such breakpoints
    can be set; WHICH specifies which one to set (0 or 1).  */
@@ -155,7 +155,7 @@
   int x;
   for (x = 0; x < NUM_SS_BPTS; x++)
     {
-        unsigned char* addr = (unsigned char*) break_mem[x];
+        unsigned short* addr = (unsigned short *)break_mem[x];
         if (addr) {
             *addr = break_mem_data[x];
             break_mem[x] = 0;
@@ -219,7 +219,17 @@
     /* rts */ 
     unsigned long *sp;
     sp = (unsigned long *)get_register(SP);
-    next = *sp & 0x00ffffff;
+    next = *(sp+1) & 0x00ffffff;
+  } else if (((opcode & 0xf000) == 0x4000) || ((opcode & 0xff00) == 0x5500)) { 
+    /* b**:8 */
+    char dsp;
+    dsp = (opcode & 0xff);
+    set_single_bp(1,(unsigned char *)(pc+2+dsp));
+  } else if (((opcode & 0xff00) == 0x5800) || ((opcode & 0xff00) == 0x5c00)) { 
+    /* b**:16 */
+    short dsp;
+    dsp = *(short *)(pc+2);
+    set_single_bp(1,(unsigned char *)(pc+4+dsp));
   } else if ((opcode & 0xfb00) != 0x5800) {
     /* jmp / jsr */
     int regs;
@@ -230,22 +240,12 @@
       next = get_register(reg_tbl[regs]);
       break;
     case 0x5a00:
-      next = *(unsigned long *)(pc+2) & 0x00ffffff;
+      next = *(unsigned long *)(pc) & 0x00ffffff;
       break;
     case 0x5b00:
       next = *(unsigned long *)(opcode & 0xff);
       break;
     }
-  } else if (((opcode & 0xf000) == 0x4000) || ((opcode & 0xff00) == 0x5500)) { 
-    /* b**:8 */
-    unsigned long dsp;
-    dsp = (long)(opcode && 0xff)+pc+2;
-    set_single_bp(1,(unsigned char *)dsp);
-  } else if (((opcode & 0xff00) == 0x5800) || ((opcode & 0xff00) == 0x5c00)) { 
-    /* b**:16 */
-    unsigned long dsp;
-    dsp = *(unsigned short *)(pc+2)+pc+4;
-    set_single_bp(1,(unsigned char *)dsp);
   }
   set_single_bp(0,(unsigned char *)next);
 }
Index: packages/hal/h8300/arch/current/src/vectors.S
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/src/vectors.S,v
retrieving revision 1.2
diff -u -r1.2 vectors.S
--- packages/hal/h8300/arch/current/src/vectors.S	23 May 2002 23:02:58 -0000	1.2
+++ packages/hal/h8300/arch/current/src/vectors.S	30 Aug 2002 17:14:03 -0000
@@ -40,8 +40,8 @@
 ##=============================================================================
 #######DESCRIPTIONBEGIN####
 ##
-## Author(s): 	nickg
-## Contributors:	nickg, dmoseley, dhowells
+## Author(s): 	Yoshinori Sato
+## Contributors: Yoshinori Sato
 ## Date:	2002-02-14
 ## Purpose:	H8/300 exception vectors
 ## Description:	This file defines the code placed into the exception
@@ -71,7 +71,6 @@
 	
 ##-----------------------------------------------------------------------------
 	
-//	.file	"vectors.S"
 	.h8300h
 	
 #ifdef CYGPKG_CYGMON
@@ -115,8 +114,8 @@
 	; need to restore the exception frame.
 	mov.l	@sp+,er0
 	mov.l	@sp+,er1
-	mov.l	er1,@er0
-	mov.l	er0,sp				// Restore the frame-adjusted SP
+	mov.l	er0,@er1
+	mov.l	er1,sp				// Restore the frame-adjusted SP
 
 	; Restore the scratch registers
 	mov.l	@er0_save,er0
@@ -200,7 +199,7 @@
 __interrupt##no:	    \
 	jsr	@interrupt_entry
 
-	.section .int_fook_table,"a"
+	.section .int_hook_table,"a"
 	.space	7*4	
 __interrupt_table:
 INTERRUPT_ENTRY(7)
@@ -271,7 +270,6 @@
 	; set up stack
 
 	mov.l	#__interrupt_stack,sp
-	ldc	#0x80,ccr
 	
 	; Initialize hardware
 	hal_cpu_init
@@ -299,17 +297,19 @@
 
 #endif
 
+#if defined(CYGSEM_HAL_H8300_VECTOR_HOOK)
 	; Setup Interrupt Vector (virtual)
-	mov.l	#CYG_LABEL_DEFN(__rom_int_fook_start),er5
-	mov.l	#CYG_LABEL_DEFN(__int_fook_start),er6
-	mov.l	#CYG_LABEL_DEFN(__int_fook_end),er4
+	mov.l	#CYG_LABEL_DEFN(__rom_int_hook_start),er5
+	mov.l	#CYG_LABEL_DEFN(__int_hook_start),er6
+	mov.l	#CYG_LABEL_DEFN(__int_hook_end),er4
 	sub.l	er6,er4
 1:	
 	eepmov.w
 	dec.w	#1,e4
 	cmp.w	#-1,e4
 	bhi	1b
-
+#endif
+	
 	; Clear BSS
 	mov.l	#CYG_LABEL_DEFN(__bss_start),er5
 	mov.l	er5,er6
@@ -368,7 +368,7 @@
 	sub.l	#__interrupt_table,er0
 	shlr.l	er0
 	shlr.l	er0
-	add.w	#7,r0
+	add.w	#7-1,r0
 	mov.l	er0,@CYG_LABEL_DEFN(_intvector)
 	mov.l	@sp+,er0
 	adds	#4,sp
@@ -376,6 +376,10 @@
 	hal_cygmon_switch_app_stack
 #endif
 	hal_cpu_save_all			; push all registers
+#ifdef CYGPKG_CYGMON
+	mov.l	@(4*9,sp),er0
+	mov.l	er0,@(4*7,sp)
+#endif
 	mov.l	@CYG_LABEL_DEFN(_intvector),er0
 	shll.l	er0
 	shll.l	er0
@@ -421,7 +425,7 @@
 	
 #if defined(CYGPKG_CYGMON)
         // For Cygmon, we saved this back when we originally switched stacks.
-	mov.l	@sp,er1				; A2 = saved thread state
+	mov.l	sp,er1				; A2 = saved thread state
 #elif defined(CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK)
 	; Increment interrupt nesting counter
 	mov.l	sp,er1
@@ -434,11 +438,11 @@
 	mov.l	er0,sp				; switch to new SP
 8:
 	mov.l	er1,@-sp			; save old SP
-	mov.l	@er1,er1
 	
 #else
-	mov	@sp,er1				; A2 = saved thread state
+	mov	sp,er1				; A2 = saved thread state
 #endif
+	mov.l	er1,er4
 
 	; Here D3 contains the table byte offset of the vector to
 	; call.
@@ -448,7 +452,6 @@
 	; Call cyg_instrument to record that this interrupt is being raised.
 
 	.extern CYG_LABEL_DEFN(cyg_instrument)
-	mov.l	er1,er3
 	mov.l	#0x0301,er0			; type = INTR,RAISE
 	mov.l	@CYG_LABEL_DEFN(_intvector),er2		; arg2 = table offset
 	jsr	CYG_LABEL_DEFN(cyg_instrument)	; call instrumentation
@@ -475,7 +478,7 @@
 	; this is a ^C.
 	
 	.extern CYG_LABEL_DEFN(hal_saved_interrupt_state)
-	mov.l	er3,@CYG_LABEL_DEFN(hal_saved_interrupt_state)
+	mov.l	er4,@CYG_LABEL_DEFN(hal_saved_interrupt_state)
 	
 #endif
 	mov.l	@CYG_LABEL_DEFN(_intvector),er0
@@ -589,18 +592,6 @@
 	.long	0
 er1_save:
 	.long	0
-er2_save:
-	.long	0
-er3_save:
-	.long	0
-er4_save:
-	.long	0
-er5_save:
-	.long	0
-er6_save:
-	.long	0
-sp_save:
-	.long	0
 #endif
 
 ##-----------------------------------------------------------------------------
@@ -614,6 +605,9 @@
 	hal_diag_excpt_start
 #endif
 
+	mov.l	@(32,sp),er0
+	subs	#2,er0
+	mov.l	er0,@(32,sp)
 	mov.l	sp,er0
 	mov.l	@CYG_LABEL_DEFN(_intvector),er1	
 
@@ -687,26 +681,26 @@
 	
 	.section	.bss
 
-	.balign 16
+	.balign 2
 	.global _cyg_interrupt_stack_base
 _cyg_interrupt_stack_base:
 __interrupt_stack_base:
 	.rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
 	.byte 0
 	.endr
-	.balign 16
+	.balign 2
 	.global _cyg_interrupt_stack
 _cyg_interrupt_stack:
 __interrupt_stack:
 	
 #ifdef CYGPKG_CYGMON
-	.balign 16
+	.balign 2
 	.global __cygmon_interrupt_stack_base
 __cygmon_interrupt_stack_base:
 	.rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
 	.byte 0
 	.endr
-	.balign 16
+	.balign 2
 	.global __cygmon_interrupt_stack
 __cygmon_interrupt_stack:
 #endif
Index: packages/hal/h8300/h8300h/current/include/var_arch.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/include/var_arch.h,v
retrieving revision 1.2
diff -u -r1.2 var_arch.h
--- packages/hal/h8300/h8300h/current/include/var_arch.h	23 May 2002 23:02:59 -0000	1.2
+++ packages/hal/h8300/h8300h/current/include/var_arch.h	30 Aug 2002 17:14:04 -0000
@@ -65,22 +65,20 @@
 {
     // These are common to all saved states and are in the order
     // stored and loaded by the movm instruction.
-    CYG_ADDRWORD        er0;
-    CYG_ADDRWORD        er1;
-    CYG_ADDRWORD        er2;
-    CYG_ADDRWORD        er3;
-    CYG_ADDRWORD        er4;
-    CYG_ADDRWORD        er5;
-    CYG_ADDRWORD        er6;
+    CYG_ADDRWORD        er0 __attribute__((aligned(4)));
+    CYG_ADDRWORD        er1 __attribute__((aligned(4))); 
+    CYG_ADDRWORD        er2 __attribute__((aligned(4)));
+    CYG_ADDRWORD        er3 __attribute__((aligned(4)));
+    CYG_ADDRWORD        er4 __attribute__((aligned(4)));
+    CYG_ADDRWORD        er5 __attribute__((aligned(4)));
+    CYG_ADDRWORD        er6 __attribute__((aligned(4)));
     
     /* On interrupts the PC and PSW are pushed automatically by the     */
     /* CPU and SP is pushed for debugging reasons. On a thread switch   */
     /* the saved context is made to look the same.                      */
 
-    CYG_ADDRWORD  sp;             /* Saved copy of SP in some states      */
-    CYG_WORD32    ccr;
-    CYG_ADDRWORD  pc;             /* Program Counter                      */
-    
+    CYG_ADDRWORD  sp __attribute__((aligned(4)));  /* Saved copy of SP in some states      */
+    CYG_WORD32 pc __attribute__((aligned(4)));
 } HAL_SavedRegisters;
 
 // Internal peripheral registers
Index: packages/hal/h8300/h8300h/current/include/variant.inc
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/include/variant.inc,v
retrieving revision 1.2
diff -u -r1.2 variant.inc
--- packages/hal/h8300/h8300h/current/include/variant.inc	23 May 2002 23:03:00 -0000	1.2
+++ packages/hal/h8300/h8300h/current/include/variant.inc	30 Aug 2002 17:14:04 -0000
@@ -71,9 +71,7 @@
 # CPU state save and restore macros
 
 	.macro	hal_cpu_save_all
-	stc	ccr,@-sp
-	subs	#2,sp
-	subs	#4,sp
+	mov.l	sp,@-sp
 	mov.l	er6,@-sp		# push all registers
 	mov.l	er5,@-sp
 	mov.l	er4,@-sp
@@ -92,13 +90,11 @@
 	mov.l	@sp+,er5
 	mov.l	@sp+,er6
 	adds	#4,sp
-	adds	#2,sp
-	ldc	@sp+,ccr	
 	.endm
 
 
 # Location of PC in saved register context (HAL_SavedRegisters)
-#define SAVED_CONTEXT_PC_OFFSET          36
+#define SAVED_CONTEXT_PC_OFFSET (4*8)          
 
 ##-----------------------------------------------------------------------------
 # Default interrupt decoding macros.
Index: packages/hal/h8300/h8300h/current/src/var_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/src/var_misc.c,v
retrieving revision 1.2
diff -u -r1.2 var_misc.c
--- packages/hal/h8300/h8300h/current/src/var_misc.c	23 May 2002 23:03:00 -0000	1.2
+++ packages/hal/h8300/h8300h/current/src/var_misc.c	30 Aug 2002 17:14:05 -0000
@@ -40,9 +40,9 @@
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):    nickg
-// Contributors: nickg, jlarmour
-// Date:         1999-01-21
+// Author(s):    ysato
+// Contributors: ysato
+// Date:         2002-03-01
 // Purpose:      HAL miscellaneous functions
 // Description:  This file contains miscellaneous functions provided by the
 //               HAL.
@@ -77,7 +77,7 @@
 #define REGS_DEF(ier,isr,mask,status) \
         {(CYG_BYTE *)ier,(CYG_BYTE *)isr,mask,status}
 
-struct int_regs interrupt_registers[]= {
+const struct int_regs interrupt_registers[]= {
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x01,0x01),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x02,0x02),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x04,0x04),
Index: packages/hal/h8300/h8300h/current/src/var_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/src/var_misc.c,v
retrieving revision 1.2
diff -u -r1.2 var_misc.c
--- packages/hal/h8300/h8300h/current/src/var_misc.c	23 May 2002 23:03:00 -0000	1.2
+++ packages/hal/h8300/h8300h/current/src/var_misc.c	30 Aug 2002 17:14:05 -0000
@@ -40,9 +40,9 @@
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):    nickg
-// Contributors: nickg, jlarmour
-// Date:         1999-01-21
+// Author(s):    ysato
+// Contributors: ysato
+// Date:         2002-03-01
 // Purpose:      HAL miscellaneous functions
 // Description:  This file contains miscellaneous functions provided by the
 //               HAL.
@@ -77,7 +77,7 @@
 #define REGS_DEF(ier,isr,mask,status) \
         {(CYG_BYTE *)ier,(CYG_BYTE *)isr,mask,status}
 
-struct int_regs interrupt_registers[]= {
+const struct int_regs interrupt_registers[]= {
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x01,0x01),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x02,0x02),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x04,0x04),
Index: packages/hal/h8300/h8300h/current/src/var_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/src/var_misc.c,v
retrieving revision 1.2
diff -u -r1.2 var_misc.c
--- packages/hal/h8300/h8300h/current/src/var_misc.c	23 May 2002 23:03:00 -0000	1.2
+++ packages/hal/h8300/h8300h/current/src/var_misc.c	30 Aug 2002 17:14:05 -0000
@@ -40,9 +40,9 @@
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):    nickg
-// Contributors: nickg, jlarmour
-// Date:         1999-01-21
+// Author(s):    ysato
+// Contributors: ysato
+// Date:         2002-03-01
 // Purpose:      HAL miscellaneous functions
 // Description:  This file contains miscellaneous functions provided by the
 //               HAL.
@@ -77,7 +77,7 @@
 #define REGS_DEF(ier,isr,mask,status) \
         {(CYG_BYTE *)ier,(CYG_BYTE *)isr,mask,status}
 
-struct int_regs interrupt_registers[]= {
+const struct int_regs interrupt_registers[]= {
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x01,0x01),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x02,0x02),
     REGS_DEF(CYGARC_IER,CYGARC_ISR,0x04,0x04),
Index: packages/hal/h8300/aki3068net/current/cdl/hal_h8300_h8300h_aki3068net.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/cdl/hal_h8300_h8300h_aki3068net.cdl,v
retrieving revision 1.2
diff -u -r1.2 hal_h8300_h8300h_aki3068net.cdl
--- packages/hal/h8300/aki3068net/current/cdl/hal_h8300_h8300h_aki3068net.cdl	23 May 2002 23:02:55 -0000	1.2
+++ packages/hal/h8300/aki3068net/current/cdl/hal_h8300_h8300h_aki3068net.cdl	30 Aug 2002 17:14:01 -0000
@@ -40,10 +40,10 @@
 # ====================================================================
 ######DESCRIPTIONBEGIN####
 #
-# Author(s):      jskov
+# Author(s):      yoshinori sato
 # Original data:  bartv
-# Contributors:
-# Date:           1999-11-02
+# Contributors:   yoshinori sato
+# Date:           2002-04-10
 #
 #####DESCRIPTIONEND####
 #
@@ -197,11 +197,32 @@
             display "Global linker flags"
             flavor  data
             no_define
-            default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static -mh" }
+            default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static -mh -mint32" }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
         }
+        cdl_option CYGBLD_BUILD_GDB_STUBS {
+            display "Build GDB stub ROM image"
+            default_value 0
+            requires CYGSEM_HAL_ROM_MONITOR
+            requires CYGBLD_BUILD_COMMON_GDB_STUBS
+            requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+            requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
+            requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
+            no_define
+            description "
+                This option enables the building of the GDB stubs for the
+                board. The common HAL controls takes care of most of the
+                build process, but the final conversion from ELF image to
+                binary data is handled by the platform CDL, allowing
+                relocation of the data if necessary."
+
+            make -priority 320 {
+                <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
+                $(OBJCOPY) -O binary $< $@
+            }
+        }
     }
 
     cdl_component CYGHWR_MEMORY_LAYOUT {
@@ -241,5 +262,13 @@
             ROM monitor may process exceptions or interrupts generated from the
             application. This enables features such as utilizing a separate
             interrupt stack when exceptions are generated."
+    }
+    cdl_option CYGSEM_HAL_H8300_VECTOR_HOOK {
+        display       "Interrupt Vector Hook"
+        flavor        bool
+        default_value 1
+        parent        CYGPKG_HAL_ROM_MONITOR
+        description   "
+            Interrupt Vector Table Hooking Support"
     }
 }
Index: packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi,v
retrieving revision 1.1
diff -u -r1.1 mlt_h8300_h8300h_aki3068net_ram.ldi
--- packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi	20 May 2002 22:22:38 -0000	1.1
+++ packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi	30 Aug 2002 17:14:01 -0000
@@ -10,6 +10,7 @@
 MEMORY
 {
     ram : ORIGIN = 0x400000, LENGTH = 0x20000
+    iram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100
 }
 
 SECTIONS
@@ -21,10 +22,11 @@
     SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_int_fook_table (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_data (ram, ALIGN (0x4),LMA_EQ_VMA)
     SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
+    SECTION_int_hook_table (iram, 0xffbf20,FOLLOWING (.data))
+//  SECTION_int_hook_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+//  SECTION_data (ram, ALIGN (0x4),LMA_EQ_VMA)
+//  SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
     SECTIONS_END
 }
-
-fook_table_address = 0xffbf20;
Index: packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt,v
retrieving revision 1.1
diff -u -r1.1 mlt_h8300_h8300h_aki3068net_ram.mlt
--- packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt	20 May 2002 22:22:38 -0000	1.1
+++ packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt	30 Aug 2002 17:14:01 -0000
@@ -5,7 +5,7 @@
 section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
 section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
 section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 int_fook_table int_fook_table !
+section gcc_except_table 0 1 0 1 0 1 0 1 int_fook_table int_hook_table !
 section int_fook_table 0 1 0 1 0 1 0 1  data data !
 section data 0 4 0 1 0 1 0 1 bss bss !
 section bss 0 4 0 1 0 1 0 0 !
Index: packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi,v
retrieving revision 1.1
diff -u -r1.1 mlt_h8300_h8300h_aki3068net_rom.ldi
--- packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi	20 May 2002 22:22:38 -0000	1.1
+++ packages/hal/h8300/aki3068net/current/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi	30 Aug 2002 17:14:01 -0000
@@ -29,13 +29,13 @@
     SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
 #if !defined(CYGPKG_IO_ETH_DRIVERS)
-    SECTION_int_fook_table (ram, 0xffbf20,FOLLOWING (.gcc_except_table))
-    SECTION_data (ram, ALIGN (0x4),FOLLOWING (.int_fook_table))
+    SECTION_int_hook_table (ram, 0xffbf20,FOLLOWING (.gcc_except_table))
+    SECTION_data (ram, ALIGN (0x4),FOLLOWING (.int_hook_table))
     SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
 #else
     SECTION_data (ram, 0x5F4000,FOLLOWING (.gcc_except_table))
     SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
-    SECTION_int_fook_table (iram, 0xffbf20,FOLLOWING (.data))
+    SECTION_int_hook_table (iram, 0xffbf20,FOLLOWING (.data))
 #endif
     SECTIONS_END
 }
Index: packages/hal/h8300/h8300h/current/src/h8300_h8300h.ld
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/h8300h/current/src/h8300_h8300h.ld,v
retrieving revision 1.2
diff -u -r1.2 h8300_h8300h.ld
--- packages/hal/h8300/h8300h/current/src/h8300_h8300h.ld	23 May 2002 23:03:00 -0000	1.2
+++ packages/hal/h8300/h8300h/current/src/h8300_h8300h.ld	30 Aug 2002 17:14:04 -0000
@@ -92,13 +92,13 @@
     { FORCE_OUTPUT; *(.gcc_except_table) } \
     > _region_
 
-#define SECTION_int_fook_table(_region_, _vma_, _lma_) \
-    .int_fook_table _vma_ : _lma_ \
-    { CYG_LABEL_DEFN(__int_fook_start) = ABSOLUTE (.); \
-      FORCE_OUTPUT; *(.int_fook_table) } \
+#define SECTION_int_hook_table(_region_, _vma_, _lma_) \
+    .int_hook_table _vma_ : _lma_ \
+    { CYG_LABEL_DEFN(__int_hook_start) = ABSOLUTE (.); \
+      FORCE_OUTPUT; *(.int_hook_table) } \
     > _region_ \
-    CYG_LABEL_DEFN(__rom_int_fook_start) = LOADADDR (.int_fook_table); \
-    CYG_LABEL_DEFN(__int_fook_end) = .;
+    CYG_LABEL_DEFN(__rom_int_hook_start) = LOADADDR (.int_hook_table); \
+    CYG_LABEL_DEFN(__int_hook_end) = .;
 
 #define SECTION_data(_region_, _vma_, _lma_) \
     .data _vma_ : _lma_ \
Index: packages/hal/h8300/sim/current/include/pkgconf/mlt_h8300_h8300h_sim_ram.ldi
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/sim/current/include/pkgconf/mlt_h8300_h8300h_sim_ram.ldi,v
retrieving revision 1.1
diff -u -r1.1 mlt_h8300_h8300h_sim_ram.ldi
--- packages/hal/h8300/sim/current/include/pkgconf/mlt_h8300_h8300h_sim_ram.ldi	20 May 2002 22:22:40 -0000	1.1
+++ packages/hal/h8300/sim/current/include/pkgconf/mlt_h8300_h8300h_sim_ram.ldi	30 Aug 2002 17:14:05 -0000
@@ -22,7 +22,7 @@
     SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_int_fook_table (ram, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_int_hook_table (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
