This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: SH1 port of eCos
- To: Aaron Passey <aaronp at ngwee dot ugcs dot caltech dot edu>
- Subject: Re: [ECOS] SH1 port of eCos
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Tue, 16 Jan 2001 02:40:12 +0000
- Cc: Jesper Skov <jskov at redhat dot com>, ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <20010115234901.E4E05CC001@ngwee.ugcs.caltech.edu>
Aaron Passey wrote:
> You have one nice interrupt routine and another exception routine. I need
> potentially 256 copies of this routine. I could do this with a bunch of
> macros and a lot of code duplication (not pretty) or possibly have a macro
> that saves a little bit of state, calls another routine to save the rest,
> and then jumps to the right ISR. I have to think about this a little bit
> more.
I don't know the details here, but I think certain GAS constructs may be
useful in this, e.g. paraphrased from the v850 vectors.S
.macro INTERRUPT
.org reset_vector+(0x0010*VECTOR)
addi -CYGARC_EXCEPTION_FRAME_SIZE,sp,sp
st.w r1,CYGARC_REG_R1[sp]
movea VECTOR,r0,r1
jr exception
.set VECTOR, VECTOR+1
.endm
and then later:
.set VECTOR, 8
.rept CYGNUM_HAL_ISR_COUNT
INTERRUPT
.endr
Do you see what this does and how it does it? A small preamble that
identifies the vector in a register, followed by a jump. And all contained
in a macro in a way that is clean, even though CYGNUM_HAL_ISR_COUNT is very
large on the v850, like the SH1.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine