Changeset c80add4 in rtems


Ignore:
Timestamp:
Mar 25, 1998, 6:46:47 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
5e0fbcc
Parents:
059dbcf
Message:

m68k software interrupt stack support from Chris Johns and Eric Norum.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/cpu/m68k/cpu.c

    r059dbcf rc80add4  
    148148
    149149  asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
    150 #else
    151 #warning "PLEASE IMPLEMENT ME... There is NO dedicated interrupt stack"
    152 #warning "on CPUs without a dedicated hardware interrupt stack!!!"
    153 #warning "INTERRUPTS RUN ON A TASK STACK!!!"
    154150#endif
    155151}
  • c/src/exec/score/cpu/m68k/cpu.h

    r059dbcf rc80add4  
    3535 *  Use the m68k's hardware interrupt stack support and have the
    3636 *  interrupt manager allocate the memory for it.
    37  *
    38  *  NOTE:  The definitions when M68K_HAS_SEPARATE_STACKS is 0 should
    39  *         change when the software interrupt stack support is implemented.
    4037 */
    4138
    4239#if ( M68K_HAS_SEPARATE_STACKS == 1)
    43 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
    44 #define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
    45 #define CPU_ALLOCATE_INTERRUPT_STACK     TRUE
     40#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 0
     41#define CPU_HAS_HARDWARE_INTERRUPT_STACK 1
     42#define CPU_ALLOCATE_INTERRUPT_STACK     1
    4643#else
    47 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
    48 #define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
    49 #define CPU_ALLOCATE_INTERRUPT_STACK     FALSE
     44#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 1
     45#define CPU_HAS_HARDWARE_INTERRUPT_STACK 0
     46#define CPU_ALLOCATE_INTERRUPT_STACK     1
    5047#endif
    5148
  • c/src/exec/score/cpu/m68k/cpu_asm.s

    r059dbcf rc80add4  
    109109 */
    110110
    111 /*  m68000 notes:
    112  *
    113  *  with this approach, lower interrupts (1-5 for efi68k) may
     111/*
     112 *  With this approach, lower priority interrupts may
    114113 *  execute twice if a higher priority interrupt is
    115114 *  acknowledged before _Thread_Dispatch_disable is
     
    120119 *  permitted by the new interrupt level mask, and (2) when
    121120 *  the original context regains the cpu.
    122  *
    123  *  XXX: Code for switching to a software maintained interrupt stack is
    124  *       not in place.
    125121 */
    126122 
     
    142138SYM (_ISR_Handler):
    143139        addql   #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking
    144         addql   #1,SYM (_ISR_Nest_level) | one nest level deeper
    145140        moveml  d0-d1/a0-a1,a7@-         | save d0-d1,a0-a1
    146 
    147 /*
    148  *  NOTE FOR CPUs WITHOUT HARDWARE INTERRUPT STACK:
    149  *
    150  *  After the interrupted codes registers have been saved, it is save
    151  *  to switch to the software maintained interrupt stack.
    152  *
    153  *  PLEASE, if you have a m68k without a dedicated interrupt stack,
    154  *          implement the stack switching code.
    155  */
    156 
    157141        movew   a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
    158142        andl    #0x0fff,d0               | d0 = vector offset in vbr
     143
     144
     145#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
     146        movew   sr,d1                   | Save status register
     147        oriw    #0x700,sr               | Disable interrupts
     148        tstl    SYM (_ISR_Nest_level)   | Interrupting an interrupt handler?
     149        bne     1f                      | Yes, just skip over stack switch code
     150        movel   SYM(_CPU_Interrupt_stack_high),a0       | End of interrupt stack
     151        movel   a7,a0@-                 | Save task stack pointer
     152        movel   a0,a7                   | Switch to interrupt stack
     1531:
     154        addql   #1,SYM(_ISR_Nest_level) | one nest level deeper
     155        movew   d1,sr                   | Restore status register
     156#else
     157        addql   #1,SYM (_ISR_Nest_level) | one nest level deeper
     158#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
    159159
    160160#if ( M68K_HAS_PREINDEXING == 1 )
     
    171171        addql   #4,a7                    | remove vector number
    172172
    173         subql   #1,SYM (_ISR_Nest_level) | one less nest level
     173#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
     174        movew   sr,d0                   | Save status register
     175        oriw    #0x700,sr               | Disable interrupts
     176        subql   #1,SYM(_ISR_Nest_level) | Reduce interrupt-nesting count
     177        bne     1f                      | Skip if return to interrupt
     178        movel   (a7),a7                 | Restore task stack pointer
     1791:
     180        movew   d0,sr                   | Restore status register
     181#else
     182        subql   #1,SYM (_ISR_Nest_level) | one less nest level
     183#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
     184
    174185        subql   #1,SYM (_Thread_Dispatch_disable_level)
    175186                                         | unnest multitasking
  • c/src/lib/libbsp/m68k/gen68360/start/start360.s

    r059dbcf rc80add4  
    328328#if ( M68K_HAS_SEPARATE_STACKS == 1 )
    329329        oriw    #0x3000,sr              | Switch to Master Stack Pointer
    330         lea     SYM(m360)+1024-64,a7    | Load stack pointer with space
    331                                         |   for the Interrupt Stack
     330        lea     SYM(m360)+1024-64,a7    | Put stack in dual-port ram
     331                                        | a little below the interrupt stack
    332332#endif
    333333
  • c/src/lib/libbsp/m68k/gen68360/start360/start360.s

    r059dbcf rc80add4  
    328328#if ( M68K_HAS_SEPARATE_STACKS == 1 )
    329329        oriw    #0x3000,sr              | Switch to Master Stack Pointer
    330         lea     SYM(m360)+1024-64,a7    | Load stack pointer with space
    331                                         |   for the Interrupt Stack
     330        lea     SYM(m360)+1024-64,a7    | Put stack in dual-port ram
     331                                        | a little below the interrupt stack
    332332#endif
    333333
  • cpukit/score/cpu/m68k/cpu.c

    r059dbcf rc80add4  
    148148
    149149  asm volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
    150 #else
    151 #warning "PLEASE IMPLEMENT ME... There is NO dedicated interrupt stack"
    152 #warning "on CPUs without a dedicated hardware interrupt stack!!!"
    153 #warning "INTERRUPTS RUN ON A TASK STACK!!!"
    154150#endif
    155151}
Note: See TracChangeset for help on using the changeset viewer.