Ignore:
Timestamp:
Dec 3, 2014, 10:35:52 AM (5 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
adc1dbeb
Parents:
4081032
git-author:
Daniel Hellstrom <daniel@…> (12/03/14 10:35:52)
git-committer:
Daniel Hellstrom <daniel@…> (12/04/14 11:51:11)
Message:

SPARC: optimize IRQ enable & disable

  • Coding style cleanups.
  • Use OS reserved trap 0x89 for IRQ Disable
  • Use OS reserved trap 0x8A for IRQ Enable
  • Add to SPARC CPU supplement documentation

This will result in faster Disable/Enable? code since the
system trap handler does not need to decode which function
the user wants. Besides the IRQ disable/enabled can now
be inline which avoids the caller to take into account that
o0-o7+g1-g4 registers are destroyed by trap handler.

It was also possible to reduce the interrupt trap handler by
five instructions due to this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/sparc/rtems/score/sparc.h

    r4081032 rdff1803  
    150150#define LEON3_ASR17_PROCESSOR_INDEX_SHIFT 28
    151151
     152/* SPARC Software Trap number definitions */
     153#define SPARC_SWTRAP_SYSCALL 0
     154#define SPARC_SWTRAP_IRQDIS 9
     155#define SPARC_SWTRAP_IRQEN 10
     156
    152157#ifndef ASM
    153158
     
    299304 * @return This method returns the entire PSR contents.
    300305 */
    301 uint32_t sparc_disable_interrupts(void);
     306static inline uint32_t sparc_disable_interrupts(void)
     307{
     308  register uint32_t psr __asm__("g1"); /* return value of trap handler */
     309  __asm__ volatile ( "ta %1\n\t" : "=r" (psr) : "i" (SPARC_SWTRAP_IRQDIS));
     310  return psr;
     311}
    302312
    303313/**
     
    308318 * @param[in] psr is the PSR returned by @ref sparc_disable_interrupts.
    309319 */
    310 void sparc_enable_interrupts(uint32_t psr);
     320static inline void sparc_enable_interrupts(uint32_t psr)
     321{
     322  register uint32_t _psr __asm__("g1") = psr; /* input to trap handler */
     323  __asm__ volatile ( "ta %0\n" :: "i" (SPARC_SWTRAP_IRQEN), "r" (_psr));
     324}
    311325
    312326/**
Note: See TracChangeset for help on using the changeset viewer.