public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Dan Hovang <dan.hovang@cpen.com>
To: Ecos Discuss <ecos-discuss@sourceware.cygnus.com>
Subject: Re: [ECOS] on ARM: Using the FIQ vector
Date: Fri, 28 Jan 2000 07:10:00 -0000	[thread overview]
Message-ID: <3891B199.AF1F0C5E@cpen.com> (raw)
In-Reply-To: <XFMail.000128072010.gthomas@redhat.com>

Gary Thomas wrote:
> 
> Firstly, I'd suggest that you keep up with eCos development by using
> CVS. Recent changes to the eCos source base are available via CVS,
> on a [more or less] weekly basis.  The code base you're using is
> extremely old.

I'm using the 1.2.1 (latest?) release sourcecode. I thought the cvs
code was purely development code, thus unstable and untested.

> I'm a little confused about what you want to accomplish.  Are you
> interested in masking _all_ FIQ interrupts or just one.  Perhaps if
> you could provide a pseudo-code scenario, I can make some suggestions.

I want to tell eCos "don't touch the disable FIQ bit of the cpsr, no
matter what". I've removed the default FIQ handling code since it
contains, from my point of view, a huge overhead. I get FIQ at about
400 kHz.

I've made a hack which solves my situation by adding this to context.S
(our platform is called Eye):

FUNC_START(hal_thread_load_context)
        ldr     fp,[r0]                 // get context to restore
        mrs     r0,cpsr                 // disable IRQ's
        orr     r0,r0,#CPSR_IRQ_DISABLE
        msr     cpsr,r0
#ifdef CYG_HAL_ARM_EYE // Don't touch the FIQ bit on Eye, DH 2000-01-28
        ands r1, r0, #CPSR_FIQ_DISABLE
#endif
        ldr r0,[fp,#armreg_cpsr]
#ifdef CYG_HAL_ARM_EYE
        biceq r0, r0, #CPSR_FIQ_DISABLE
        orrne r0, r0, #CPSR_FIQ_DISABLE
#endif
        msr     spsr,r0
        ldmfd   fp,{r0-r10,fp,sp,lr}    // also restores saved PSR
        movs    pc,lr

I've also modified the HAL macros which affects the cpsr, like this:

#ifdef CYG_HAL_ARM_EYE // FIQ should be excluded on platform eye
#define HAL_DISABLE_INTERRUPTS(_old_)           \
    asm volatile (                              \
        "mrs %0,cpsr;"                          \
        "mrs r4,cpsr;"                          \
        "orr r4,r4,#0x80;"                      \
        "msr cpsr,r4"                           \
        : "=r"(_old_)                           \
        :                                       \
        : "r4"                                  \
        );

But it would be nice if it was possible to have some more 'permanent'
solution which integrates well into eCos.

Also, I checked the anonymous cvs version of context.S and hal_intr.h
and I could not see any changes relevant to this issue.

/Dan

  reply	other threads:[~2000-01-28  7:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-28  5:48 Dan Hovang
2000-01-28  6:20 ` Gary Thomas
2000-01-28  7:10   ` Dan Hovang [this message]
2000-01-28 11:40     ` Gary Thomas
2000-01-28  7:15 ` Hugo 'NOx' Tyson
2000-01-28  7:15   ` Hugo 'NOx' Tyson
2000-01-28  7:37   ` Dan Hovang
2000-01-28  7:50     ` Gary Thomas

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=3891B199.AF1F0C5E@cpen.com \
    --to=dan.hovang@cpen.com \
    --cc=ecos-discuss@sourceware.cygnus.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).