This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: on ARM: Using the FIQ vector


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]