Ignore:
Timestamp:
Mar 25, 1998, 6:46:47 PM (24 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.