public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: Aaron Passey <aaronp@ngwee.ugcs.caltech.edu>
Cc: Jesper Skov <jskov@redhat.com>, ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] SH1 port of eCos
Date: Mon, 15 Jan 2001 18:40:00 -0000	[thread overview]
Message-ID: <3A63B48C.A4338AFE@redhat.com> (raw)
In-Reply-To: <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

  reply	other threads:[~2001-01-15 18:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-11 13:02 Aaron Passey
2001-01-12  0:42 ` Jesper Skov
2001-01-15 15:49   ` Aaron Passey
2001-01-15 18:40     ` Jonathan Larmour [this message]
2001-01-15 20:10       ` Aaron Passey
2001-01-15 23:55     ` Jesper Skov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A63B48C.A4338AFE@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=aaronp@ngwee.ugcs.caltech.edu \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=jskov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).