Changeset 9e86dd7d in rtems


Ignore:
Timestamp:
Jun 7, 1995, 1:27:28 AM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
9526d217
Parents:
459f770
Message:

incorporated mc68302 support

Files:
14 added
7 edited

Legend:

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

    r459f770 r9e86dd7d  
    9696}
    9797
     98#if ( M68K_HAS_BFFFO != 1 )
     99/*
     100 * Returns log2(x)  0<x<256
     101 */
     102const unsigned char __log2table[256] = {
     103    0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
     104    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
     105    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
     106    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
     107    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     108    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     109    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     110    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     111    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     112    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     113    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     114    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     115    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     116    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     117    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     118    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     119};
     120#endif
  • c/src/exec/score/cpu/m68k/cpu.h

    r459f770 r9e86dd7d  
    4444 *  Use the m68k's hardware interrupt stack support and have the
    4545 *  interrupt manager allocate the memory for it.
    46  */
    47 
     46 *
     47 *  NOTE:  The definitions when M68K_HAS_SEPARATE_STACKS is 0 should
     48 *         change when the software interrupt stack support is implemented.
     49 */
     50
     51#if ( M68K_HAS_SEPARATE_STACKS == 1)
    4852#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
    4953#define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE
    5054#define CPU_ALLOCATE_INTERRUPT_STACK     TRUE
     55#else
     56#define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE
     57#define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
     58#define CPU_ALLOCATE_INTERRUPT_STACK     FALSE
     59#endif
    5160
    5261/*
     
    317326
    318327#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    319   (_output) = 0   /* avoids warnings */
    320 
    321 #warning "FIX ME... NEEDS A SOFTWARE BFFFO IMPLEMENTATION"
    322 #warning "SEE no_cpu/cpu.h FOR POSSIBLE ALGORITHMS"
     328  { \
     329    extern const unsigned char __log2table[256]; \
     330    \
     331    (_output) = 0;  /* avoids warnings */ \
     332    asm         (  "move.w     %1,%0\n"\
     333     "\tandi.w     #0xff00,%0\n"\
     334     "\tjbne       0f\n"\
     335     "\tmoveq.l    #0,%0\n"\
     336     "\tmove.b     (%2,%1.w),%0\n"\
     337     "\tjbra       1f\n"\
     338     "0:\tmoveq.l    #8,%0\n"\
     339     "\tlsr.w      #8,%1\n"\
     340     "\tadd.b      (%2,%1.w),%0\n"\
     341     "1:"\
     342     : "=&d" ((_output)) \
     343     : "d" ((_value)), "ao" (__log2table) \
     344     : "cc" ) ; \
     345  }
    323346
    324347#endif
     
    339362  ( 0x8000 >> (_bit_number) )
    340363
     364#if ( M68K_HAS_BFFFO == 1 )
    341365#define _CPU_Priority_Bits_index( _priority ) \
    342366  (_priority)
     367#else
     368#define _CPU_Priority_Bits_index( _priority ) \
     369  (15 - (_priority))
     370#endif
    343371
    344372/* end of Priority handler macros */
  • c/src/exec/score/cpu/m68k/cpu_asm.s

    r459f770 r9e86dd7d  
    133133        addql   #4,a7                   | remove vector number
    134134
     135/*
     136 *   The following entry should be unnecessary once the support is
     137 *   in place to know what vector we got on a 68000 core.
     138 */
     139
     140        .global SYM (_ISR_Exit)
     141SYM (_ISR_Exit):
     142
    135143        subql   #1,SYM (_ISR_Nest_level)       | one less nest level
    136144        subql   #1,SYM (_Thread_Dispatch_disable_level)
     
    138146        bne     exit                     | If dispatch disabled, exit
    139147
     148#if ( M68K_HAS_SEPARATE_STACKS == 1 )
    140149        movew   #0xf000,d0              | isolate format nibble
    141150        andw    a7@(SAVED+FVO_OFFSET),d0 | get F/VO
    142151        cmpiw   #0x1000,d0              | is it a throwaway isf?
    143152        bne     exit                     | NOT outer level, so branch
     153#endif
    144154
    145155        tstl    SYM (_Context_Switch_necessary)
     
    156166                                         | If sent, will be processed
    157167#if ( M68K_HAS_SEPARATE_STACKS == 1 )
    158         movec   msp,a0                 | a0 = master stack pointer
    159         movew   #0,a0@-                 | push format word
     168        movec   msp,a0                   | a0 = master stack pointer
     169        movew   #0,a0@-                  | push format word
    160170        movel   # SYM (_ISR_Dispatch),a0@-    | push return addr
    161         movew   a0@(6+SR_OFFSET),a0@-  | push thread sr
    162         movec   a0,msp                 | set master stack pointer
     171        movew   a0@(6+SR_OFFSET),a0@-    | push thread sr
     172        movec   a0,msp                   | set master stack pointer
    163173#else
    164 #warning "FIX ME ... HOW DO I DISPATCH FROM AN INTERRUPT?"
    165 /* probably will simply need to push the _ISR_Dispatch frame */
    166 #endif
    167 
    168 exit:   moveml  a7@+,d0-d1/a0-a1    | restore d0-d1,a0-a1
     174
     175        movew   a7@(16+SR_OFFSET),sr
     176        jsr     SYM (_Thread_Dispatch)
     177
     178#endif
     179
     180exit:   moveml  a7@+,d0-d1/a0-a1         | restore d0-d1,a0-a1
    169181        rte                              | return to thread
    170182                                         |   OR _Isr_dispatch
  • c/src/lib/libmisc/stackchk/check.c

    r459f770 r9e86dd7d  
    330330   */
    331331
    332   base += 4;
     332  base += PATTERN_SIZE_WORDS;
    333333  for (ebase = base + length; base < ebase; base++)
    334334      if (*base != U32_PATTERN)
  • c/src/libmisc/stackchk/check.c

    r459f770 r9e86dd7d  
    330330   */
    331331
    332   base += 4;
     332  base += PATTERN_SIZE_WORDS;
    333333  for (ebase = base + length; base < ebase; base++)
    334334      if (*base != U32_PATTERN)
  • cpukit/libmisc/stackchk/check.c

    r459f770 r9e86dd7d  
    330330   */
    331331
    332   base += 4;
     332  base += PATTERN_SIZE_WORDS;
    333333  for (ebase = base + length; base < ebase; base++)
    334334      if (*base != U32_PATTERN)
  • cpukit/score/cpu/m68k/cpu.c

    r459f770 r9e86dd7d  
    9696}
    9797
     98#if ( M68K_HAS_BFFFO != 1 )
     99/*
     100 * Returns log2(x)  0<x<256
     101 */
     102const unsigned char __log2table[256] = {
     103    0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
     104    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
     105    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
     106    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
     107    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     108    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     109    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     110    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
     111    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     112    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     113    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     114    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     115    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     116    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     117    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     118    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     119};
     120#endif
Note: See TracChangeset for help on using the changeset viewer.