Changeset f4b7e297 in rtems


Ignore:
Timestamp:
Dec 2, 1996, 7:43:22 PM (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
29d8227e
Parents:
331d9e3b
Message:

Update from Chris Johns <cjohns@…> to add better support for
68000 class CPUs.

Files:
4 edited

Legend:

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

    r331d9e3b rf4b7e297  
    3232)
    3333{
     34#if ( M68K_HAS_VBR == 0 )
     35  /* fill the isr redirect table with the code to place the format/id
     36     onto the stack */
     37
     38  unsigned32 slot;
     39
     40  for (slot = 0; slot < CPU_INTERRUPT_NUMBER_OF_VECTORS; slot++)
     41  {
     42    _CPU_ISR_jump_table[slot].move_a7 = M68K_MOVE_A7;
     43    _CPU_ISR_jump_table[slot].format_id = slot << 2;
     44    _CPU_ISR_jump_table[slot].jmp = M68K_JMP;
     45    _CPU_ISR_jump_table[slot].isr_handler = (unsigned32) 0xDEADDEAD;
     46  }
     47#endif /* M68K_HAS_VBR */
     48
    3449  _CPU_Table = *cpu_table;
    3550}
     
    6479  m68k_get_vbr( interrupt_table );
    6580
    66 #if ( M68K_HAS_VBR == 1)
    6781  *old_handler = interrupt_table[ vector ];
     82
     83#if ( M68K_HAS_VBR == 1 )
    6884  interrupt_table[ vector ] = new_handler;
    6985#else
    70   *old_handler = *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10);
    71   *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10) = new_handler;
     86  _CPU_ISR_jump_table[vector].isr_handler = (unsigned32) new_handler;
     87  interrupt_table[ vector ] = (proc_ptr) &_CPU_ISR_jump_table[vector];
    7288#endif /* M68K_HAS_VBR */
    7389}
  • c/src/exec/score/cpu/m68k/cpu.h

    r331d9e3b rf4b7e297  
    140140/* variables */
    141141
    142 SCORE_EXTERN void               *_CPU_Interrupt_stack_low;
    143 SCORE_EXTERN void               *_CPU_Interrupt_stack_high;
     142SCORE_EXTERN void                   *_CPU_Interrupt_stack_low;
     143SCORE_EXTERN void                   *_CPU_Interrupt_stack_high;
     144
     145extern char                         _VBR[];
     146
     147#if ( M68K_HAS_VBR == 0 )
     148
     149/*
     150 * Table of ISR handler entries that resides in RAM. The FORMAT/ID is
     151 * pushed onto the stack. This is not is the same order as VBR processors.
     152 * The ISR handler takes the format and uses it for dispatching the user
     153 * handler.
     154 *
     155 * FIXME : should be moved to below CPU_INTERRUPT_NUMBER_OF_VECTORS
     156 *
     157 */
     158
     159typedef struct {
     160  unsigned16 move_a7;            /* move #FORMAT_ID,%a7@- */
     161  unsigned16 format_id;
     162  unsigned16 jmp;                /* jmp  _ISR_Handlers */
     163  unsigned32 isr_handler;
     164} _CPU_ISR_handler_entry;
     165
     166#define M68K_MOVE_A7 0x3F3C
     167#define M68K_JMP     0x4EF9
     168
    144169      /* points to jsr-exception-table in targets wo/ VBR register */
    145 extern char                      _VBR[];
     170SCORE_EXTERN _CPU_ISR_handler_entry _CPU_ISR_jump_table[256];
     171
     172#endif /* M68K_HAS_VBR */
    146173
    147174/* constants */
  • c/src/exec/score/cpu/m68k/cpu_asm.s

    r331d9e3b rf4b7e297  
    123123.set FVO_OFFSET,   6                     | Format/vector offset
    124124#else
    125 .set JSR_OFFSET,   0                     | return address from jsr table
    126 .set SR_OFFSET,    4
    127 .set PC_OFFSET,    6
     125.set SR_OFFSET,    2                     | Status register offset
     126.set PC_OFFSET,    4                     | Program Counter offset
     127.set FVO_OFFSET,   0                     | Format/vector offset placed in the stack
    128128#endif /* M68K_HAS_VBR */
    129129 
     
    145145 */
    146146
    147 #if ( M68K_HAS_VBR == 0)
    148         movel   a7@(SAVED+JSR_OFFSET),d0 | assume the exception table at 0x0000
    149         addql   #6,d0                    | points to a jump table (jsr) in RAM
    150         subl    #_VBR,d0                 | VBR is the location of the jump table
    151         divs    #3,d0
    152         lsll    #1,d0
    153         extl    d0
    154 #else
    155147        movew   a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
    156148        andl    #0x0fff,d0               | d0 = vector offset in vbr
    157 #endif
    158149
    159150#if ( M68K_HAS_PREINDEXING == 1 )
     
    213204
    214205exit:   moveml  a7@+,d0-d1/a0-a1         | restore d0-d1,a0-a1
    215 #if ( M68K_HAS_VBR == 0)
    216         addql   #4,a7                    | pop vector address
     206#if ( M68K_HAS_VBR == 0 )
     207        addql   #2,a7                    | pop format/id
    217208#endif /* M68K_HAS_VBR */
    218209        rte                              | return to thread
     
    238229        jsr     SYM (_Thread_Dispatch)
    239230        movml   a7@+,d0-d1/a0-a1
    240 #if ( M68K_HAS_VBR == 0)
    241         addql   #4,a7                    | pop vector address
     231#if ( M68K_HAS_VBR == 0 )
     232        addql   #2,a7                    | pop format/id
    242233#endif /* M68K_HAS_VBR */
    243234        rte
  • cpukit/score/cpu/m68k/cpu.c

    r331d9e3b rf4b7e297  
    3232)
    3333{
     34#if ( M68K_HAS_VBR == 0 )
     35  /* fill the isr redirect table with the code to place the format/id
     36     onto the stack */
     37
     38  unsigned32 slot;
     39
     40  for (slot = 0; slot < CPU_INTERRUPT_NUMBER_OF_VECTORS; slot++)
     41  {
     42    _CPU_ISR_jump_table[slot].move_a7 = M68K_MOVE_A7;
     43    _CPU_ISR_jump_table[slot].format_id = slot << 2;
     44    _CPU_ISR_jump_table[slot].jmp = M68K_JMP;
     45    _CPU_ISR_jump_table[slot].isr_handler = (unsigned32) 0xDEADDEAD;
     46  }
     47#endif /* M68K_HAS_VBR */
     48
    3449  _CPU_Table = *cpu_table;
    3550}
     
    6479  m68k_get_vbr( interrupt_table );
    6580
    66 #if ( M68K_HAS_VBR == 1)
    6781  *old_handler = interrupt_table[ vector ];
     82
     83#if ( M68K_HAS_VBR == 1 )
    6884  interrupt_table[ vector ] = new_handler;
    6985#else
    70   *old_handler = *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10);
    71   *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10) = new_handler;
     86  _CPU_ISR_jump_table[vector].isr_handler = (unsigned32) new_handler;
     87  interrupt_table[ vector ] = (proc_ptr) &_CPU_ISR_jump_table[vector];
    7288#endif /* M68K_HAS_VBR */
    7389}
Note: See TracChangeset for help on using the changeset viewer.