Changeset 38ffa0c in rtems
- Timestamp:
- 09/19/95 18:32:18 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 84ee59f5
- Parents:
- 3652ad35
- Files:
-
- 6 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
c/ACKNOWLEDGEMENTS
r3652ad35 r38ffa0c 55 55 as within the Internet community as a whole. 56 56 57 + John S. Gwynne (jsg@coulomb.eng.ohio-state.edu) of Ohio State University 58 submitted the support for the Motorola MC68332 CPU as well as completing 59 the support for CPUs based on the MC68000 core. This included the "efi68k" 60 and "efi332" BSPs as well as completing the modifications to the m68k 61 dependent executive code to support m68k family members based on the 62 MC68000 core. "efi68k" and "efi332" are single board computers designed 63 primarily for automotive electronic fuel injection (EFI) control, but can 64 be considered general purpose controllers when used without the EFI 65 companion board(s). See the README in each BSP for more information. 66 57 67 Finally, the RTEMS project would like to thank those who have contributed 58 68 to the other free software efforts which RTEMS utilizes. The primary RTEMS -
c/src/exec/score/cpu/m68k/cpu.c
r3652ad35 r38ffa0c 1 1 /* 2 * Motorola MC68 020Dependent Source2 * Motorola MC68xxx Dependent Source 3 3 * 4 4 * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. … … 33 33 ) 34 34 { 35 36 35 _CPU_Table = *cpu_table; 37 38 36 } 39 37 … … 67 65 m68k_get_vbr( interrupt_table ); 68 66 67 #if ( M68K_HAS_VBR == 1) 69 68 *old_handler = interrupt_table[ vector ]; 70 71 69 interrupt_table[ vector ] = new_handler; 70 #else 71 *old_handler = *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10); 72 *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10) = new_handler; 73 #endif /* M68K_HAS_VBR */ 72 74 } 73 75 … … 121 123 #if ( M68K_HAS_BFFFO != 1 ) 122 124 /* 123 * Returns log2(x) 0<x<256125 * Returns table for duplication of the BFFFO instruction (16 bits only) 124 126 */ 125 const unsigned char __ log2table[256] = {126 0, 0, 1, 0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 1, 1, 1, 1, 1, 1, 133 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 134 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 135 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 142 144 }; 143 145 #endif -
c/src/exec/score/cpu/m68k/cpu.h
r3652ad35 r38ffa0c 147 147 EXTERN void *_CPU_Interrupt_stack_low; 148 148 EXTERN void *_CPU_Interrupt_stack_high; 149 /* points to jsr-exception-table in targets wo/ VBR register */ 150 extern char _VBR[]; 149 151 150 152 /* constants */ … … 325 327 #else 326 328 329 /* duplicates BFFFO results for 16 bits (i.e., 15-(_priority) in 330 _CPU_Priority_Bits_index is not needed), handles the 0 case, and 331 does not molest _value -- jsg */ 332 #ifndef m68000 327 333 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ 328 334 { \ 329 extern const unsigned char __log2table[256]; \ 335 extern const unsigned char __BFFFOtable[256]; \ 336 register int dumby; \ 330 337 \ 331 asm ( " tst.b %1\n" /* check for bits in ls byte */ \ 332 " beq.s 0f\n" /* branch if no bits set */ \ 333 " moveq.l #0,%0\n" /* set up for bits 0..7 */ \ 334 " andi.w #0x00ff,%1\n" /* clear ms byte for add inst */ \ 335 " bra.s 1f\n" /* go add */ \ 336 "0: moveq.l #8,%0\n" /* set up for bits 8..15 */ \ 337 " lsr.w #8,%1\n" /* shift ms byte to ls byte, */ \ 338 /* filling ms byte with 0s */ \ 339 "1: add.b (%2,%1.w),%0\n" /* add offset for bit pattern */ \ 340 : "=&d" ((_output)) \ 341 : "d" ((_value)), "ao" (__log2table) \ 342 : "cc" ) ; \ 343 } 338 asm volatile ( " move.w %2,%1\n" \ 339 " lsr.w #8,%1\n" \ 340 " beq.s 1f\n" \ 341 " move.b (%3,%1.w),%0\n" \ 342 " extb.l %0\n" \ 343 " bra.s 0f\n" \ 344 "1: moveq.l #8,%0\n" \ 345 " add.b (%3,%2.w),%0\n" \ 346 "0:\n" \ 347 : "=&d" ((_output)), "=&d" ((dumby)) \ 348 : "d" ((_value)), "ao" ((__BFFFOtable)) \ 349 : "cc" ) ; \ 350 } 351 #else 352 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ 353 { \ 354 extern const unsigned char __BFFFOtable[256]; \ 355 register int dumby; \ 356 \ 357 asm volatile ( " move.w %2,%1\n" \ 358 " lsr.w #8,%1\n" \ 359 " beq.s 1f\n" \ 360 " move.b (%3,%1.w),%0\n" \ 361 " and.l #0x000000ff,%0\n"\ 362 " bra.s 0f\n" \ 363 "1: moveq.l #8,%0\n" \ 364 " add.b (%3,%2.w),%0\n" \ 365 "0:\n" \ 366 : "=&d" ((_output)), "=&d" ((dumby)) \ 367 : "d" ((_value)), "ao" ((__BFFFOtable)) \ 368 : "cc" ) ; \ 369 } 370 #endif /* m68000 */ 344 371 345 372 #endif … … 360 387 ( 0x8000 >> (_bit_number) ) 361 388 362 #if ( M68K_HAS_BFFFO == 1 )363 389 #define _CPU_Priority_Bits_index( _priority ) \ 364 390 (_priority) 365 #else366 #define _CPU_Priority_Bits_index( _priority ) \367 (15 - (_priority))368 #endif369 391 370 392 /* end of Priority handler macros */ -
c/src/exec/score/cpu/m68k/cpu_asm.s
r3652ad35 r38ffa0c 102 102 */ 103 103 104 /* m68000 notes: 105 * 106 * with this approach, lower interrupts (1-5 for efi68k) may 107 * execute twice if a higher priority interrupt is 108 * acknowledged before _Thread_Dispatch_disable is 109 * increamented and the higher priority interrupt 110 * preforms a context switch after executing. The lower 111 * priority intterrupt will execute (1) at the end of the 112 * higher priority interrupt in the new context if 113 * permitted by the new interrupt level mask, and (2) when 114 * the original context regains the cpu. 115 */ 116 117 #if ( M68K_HAS_VBR == 1) 104 118 .set SR_OFFSET, 0 | Status register offset 105 119 .set PC_OFFSET, 2 | Program Counter offset 106 120 .set FVO_OFFSET, 6 | Format/vector offset 107 121 #else 122 .set JSR_OFFSET, 0 | return address from jsr table 123 .set SR_OFFSET, 4 124 .set PC_OFFSET, 6 125 #endif /* M68K_HAS_VBR */ 126 108 127 .set SAVED, 16 | space for saved registers 109 128 … … 112 131 113 132 SYM (_ISR_Handler): 114 moveml d0-d1/a0-a1,a7@- | save d0-d1,a0-a1 115 addql #1,SYM (_ISR_Nest_level) | one nest level deeper 116 addql #1,SYM (_Thread_Dispatch_disable_level) 117 | disable multitasking 133 addql #1,SYM (_ISR_Nest_level) | one nest level deeper 134 addql #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking 135 moveml d0-d1/a0-a1,a7@- | save d0-d1,a0-a1 136 137 #if ( M68K_HAS_VBR == 0) 138 movel a7@(SAVED+JSR_OFFSET),d0 | assume the exception table at 0x0000 139 addql #6,d0 | points to a jump table (jsr) in RAM 140 subl #_VBR,d0 | VBR is the location of the jump table 141 divs #3,d0 142 lsll #1,d0 143 extl d0 144 #else 118 145 movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO 119 andl #0x0fff,d0 | d0 = vector offset in vbr 146 andl #0x0fff,d0 | d0 = vector offset in vbr 147 #endif 120 148 121 149 #if ( M68K_HAS_PREINDEXING == 1 ) … … 123 151 #else 124 152 movel # SYM (_ISR_Vector_table),a0 | a0 = base of RTEMS table 125 addal d0,a0 | a0 = address of vector 126 movel @(a0),a0 | a0 = address of user routine 127 #warning "UNTESTED CODE!!!" 128 #endif 129 130 lsrl #2,d0 | d0 = vector number 131 movel d0,a7@- | push vector number 132 jbsr a0@ | invoke the user ISR 133 addql #4,a7 | remove vector number 153 addal d0,a0 | a0 = address of vector 154 movel (a0),a0 | a0 = address of user routine 155 #endif 156 157 lsrl #2,d0 | d0 = vector number 158 movel d0,a7@- | push vector number 159 jbsr a0@ | invoke the user ISR 160 addql #4,a7 | remove vector number 134 161 135 162 /* … … 141 168 SYM (_ISR_Exit): 142 169 143 subql #1,SYM (_ISR_Nest_level) 170 subql #1,SYM (_ISR_Nest_level) | one less nest level 144 171 subql #1,SYM (_Thread_Dispatch_disable_level) 145 172 | unnest multitasking … … 147 174 148 175 #if ( M68K_HAS_SEPARATE_STACKS == 1 ) 149 movew #0xf000,d0 | isolate format nibble176 movew #0xf000,d0 | isolate format nibble 150 177 andw a7@(SAVED+FVO_OFFSET),d0 | get F/VO 151 cmpiw #0x1000,d0 | is it a throwaway isf?178 cmpiw #0x1000,d0 | is it a throwaway isf? 152 179 bne exit | NOT outer level, so branch 153 180 #endif … … 168 195 movec msp,a0 | a0 = master stack pointer 169 196 movew #0,a0@- | push format word 170 movel # SYM (_ISR_Dispatch),a0@- 197 movel # SYM (_ISR_Dispatch),a0@- | push return addr 171 198 movew a0@(6+SR_OFFSET),a0@- | push thread sr 172 199 movec a0,msp | set master stack pointer … … 179 206 180 207 exit: moveml a7@+,d0-d1/a0-a1 | restore d0-d1,a0-a1 208 #if ( M68K_HAS_VBR == 0) 209 addql #4,a7 | pop vector address 210 #endif /* M68K_HAS_VBR */ 181 211 rte | return to thread 182 212 | OR _Isr_dispatch … … 201 231 jsr SYM (_Thread_Dispatch) 202 232 movml a7@+,d0-d1/a0-a1 203 rte 204 205 206 207 208 209 210 211 212 213 214 233 #if ( M68K_HAS_VBR == 0) 234 addql #4,a7 | pop vector address 235 #endif /* M68K_HAS_VBR */ 236 rte -
c/src/exec/score/cpu/m68k/m68k.h
r3652ad35 r38ffa0c 140 140 #define M68K_HAS_PREINDEXING 1 141 141 142 #elif defined(m68332) 143 144 #define RTEMS_MODEL_NAME "m68332" 145 #define M68K_HAS_VBR 1 146 #define M68K_HAS_SEPARATE_STACKS 0 147 #define M68K_HAS_FPU 0 148 #define M68K_HAS_BFFFO 0 149 #define M68K_HAS_PREINDEXING 0 150 142 151 #else 143 152 … … 236 245 } 237 246 #else 238 #define m68k_get_vbr( _vbr ) _vbr = 0247 #define m68k_get_vbr( _vbr ) _vbr = (void *)_VBR 239 248 #define m68k_set_vbr( _vbr ) 240 249 #endif -
c/src/tests/mptests/mp05/init.c
r3652ad35 r38ffa0c 44 44 Task_name[Multiprocessing_configuration.node], 45 45 1, 46 RTEMS_MINIMUM_STACK_SIZE ,46 RTEMS_MINIMUM_STACK_SIZE * 2, 47 47 RTEMS_TIMESLICE, 48 48 RTEMS_GLOBAL, -
cpukit/score/cpu/m68k/cpu.c
r3652ad35 r38ffa0c 1 1 /* 2 * Motorola MC68 020Dependent Source2 * Motorola MC68xxx Dependent Source 3 3 * 4 4 * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. … … 33 33 ) 34 34 { 35 36 35 _CPU_Table = *cpu_table; 37 38 36 } 39 37 … … 67 65 m68k_get_vbr( interrupt_table ); 68 66 67 #if ( M68K_HAS_VBR == 1) 69 68 *old_handler = interrupt_table[ vector ]; 70 71 69 interrupt_table[ vector ] = new_handler; 70 #else 71 *old_handler = *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10); 72 *(proc_ptr *)( (int)interrupt_table+ (int)vector*6-10) = new_handler; 73 #endif /* M68K_HAS_VBR */ 72 74 } 73 75 … … 121 123 #if ( M68K_HAS_BFFFO != 1 ) 122 124 /* 123 * Returns log2(x) 0<x<256125 * Returns table for duplication of the BFFFO instruction (16 bits only) 124 126 */ 125 const unsigned char __ log2table[256] = {126 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 133 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 134 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 135 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 142 144 }; 143 145 #endif -
testsuites/mptests/mp05/init.c
r3652ad35 r38ffa0c 44 44 Task_name[Multiprocessing_configuration.node], 45 45 1, 46 RTEMS_MINIMUM_STACK_SIZE ,46 RTEMS_MINIMUM_STACK_SIZE * 2, 47 47 RTEMS_TIMESLICE, 48 48 RTEMS_GLOBAL,
Note: See TracChangeset
for help on using the changeset viewer.