source: rtems/cpukit/score/cpu/m68k/rtems/score/cpu.h @ 8ac3549

4.115
Last change on this file since 8ac3549 was 8ac3549, checked in by Sebastian Huber <sebastian.huber@…>, on 03/04/15 at 15:13:49

score: Delete unused CPU_UNROLL_ENQUEUE_PRIORITY

  • Property mode set to 100644
File size: 20.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief Motorola M68K CPU Dependent Source
5 *
6 * This include file contains information pertaining to the Motorola
7 * m68xxx processor family.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_SCORE_CPU_H
20#define _RTEMS_SCORE_CPU_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <rtems/score/types.h>
27#include <rtems/score/m68k.h>
28
29/* conditional compilation parameters */
30
31#define CPU_INLINE_ENABLE_DISPATCH       TRUE
32
33/*
34 *  Does the CPU follow the simple vectored interrupt model?
35 *
36 *  If TRUE, then RTEMS allocates the vector table it internally manages.
37 *  If FALSE, then the BSP is assumed to allocate and manage the vector
38 *  table
39 *
40 *  M68K Specific Information:
41 *
42 *  XXX document implementation including references if appropriate
43 */
44#define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
45
46/*
47 *  Use the m68k's hardware interrupt stack support and have the
48 *  interrupt manager allocate the memory for it.
49 */
50
51#if ( M68K_HAS_SEPARATE_STACKS == 1)
52#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 0
53#define CPU_HAS_HARDWARE_INTERRUPT_STACK 1
54#else
55#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 1
56#define CPU_HAS_HARDWARE_INTERRUPT_STACK 0
57#endif
58#define CPU_ALLOCATE_INTERRUPT_STACK     1
59
60/*
61 *  Does the RTEMS invoke the user's ISR with the vector number and
62 *  a pointer to the saved interrupt frame (1) or just the vector
63 *  number (0)?
64 */
65
66#define CPU_ISR_PASSES_FRAME_POINTER 0
67
68/*
69 *  Some family members have no FP, some have an FPU such as the
70 *  MC68881/MC68882 for the MC68020, others have it built in (MC68030, 040).
71 *
72 *  NOTE:  If on a CPU without hardware FP, then one can use software
73 *         emulation.  The gcc software FP emulation code has data which
74 *         must be contexted switched on a per task basis.
75 */
76
77#if ( M68K_HAS_FPU == 1 ) || ( M68K_HAS_EMAC == 1 )
78  #define CPU_HARDWARE_FP TRUE
79  #define CPU_SOFTWARE_FP FALSE
80#else
81  #define CPU_HARDWARE_FP FALSE
82  #if defined( __GNUC__ )
83    #define CPU_SOFTWARE_FP TRUE
84  #else
85    #define CPU_SOFTWARE_FP FALSE
86  #endif
87#endif
88
89/*
90 *  All tasks are not by default floating point tasks on this CPU.
91 *  The IDLE task does not have a floating point context on this CPU.
92 *  It is safe to use the deferred floating point context switch
93 *  algorithm on this CPU.
94 */
95
96#define CPU_ALL_TASKS_ARE_FP             FALSE
97#define CPU_IDLE_TASK_IS_FP              FALSE
98#define CPU_USE_DEFERRED_FP_SWITCH       TRUE
99
100#define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
101#define CPU_STACK_GROWS_UP               FALSE
102#define CPU_STRUCTURE_ALIGNMENT          __attribute__ ((aligned (4)))
103
104#define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC TRUE
105
106/*
107 *  Define what is required to specify how the network to host conversion
108 *  routines are handled.
109 */
110
111#define CPU_BIG_ENDIAN                           TRUE
112#define CPU_LITTLE_ENDIAN                        FALSE
113
114#define CPU_PER_CPU_CONTROL_SIZE 0
115
116#if ( CPU_HARDWARE_FP == TRUE ) && !defined( __mcoldfire__ )
117  #if defined( __mc68060__ )
118    #define M68K_FP_STATE_SIZE 16
119  #else
120    #define M68K_FP_STATE_SIZE 216
121  #endif
122#endif
123
124#ifndef ASM
125
126/* structures */
127
128typedef struct {
129  /* There is no CPU specific per-CPU state */
130} CPU_Per_CPU_control;
131
132/*
133 *  Basic integer context for the m68k family.
134 */
135
136typedef struct {
137  uint32_t    sr;                /* (sr) status register */
138  uint32_t    d2;                /* (d2) data register 2 */
139  uint32_t    d3;                /* (d3) data register 3 */
140  uint32_t    d4;                /* (d4) data register 4 */
141  uint32_t    d5;                /* (d5) data register 5 */
142  uint32_t    d6;                /* (d6) data register 6 */
143  uint32_t    d7;                /* (d7) data register 7 */
144  void       *a2;                /* (a2) address register 2 */
145  void       *a3;                /* (a3) address register 3 */
146  void       *a4;                /* (a4) address register 4 */
147  void       *a5;                /* (a5) address register 5 */
148  void       *a6;                /* (a6) address register 6 */
149  void       *a7_msp;            /* (a7) master stack pointer */
150  #if defined( __mcoldfire__ ) && ( M68K_HAS_FPU == 1 )
151    uint8_t   fpu_dis;
152  #endif
153} Context_Control;
154
155#define _CPU_Context_Get_SP( _context ) \
156  (_context)->a7_msp
157
158/*
159 *  Floating point context areas and support routines
160 */
161
162#if ( CPU_SOFTWARE_FP == TRUE )
163  /*
164   *  This is the same as gcc's view of the software FP condition code
165   *  register _fpCCR.  The implementation of the emulation code is
166   *  in the gcc-VERSION/config/m68k directory.  This structure is
167   *  correct as of gcc 2.7.2.2.
168   */
169  typedef struct {
170    uint16_t _exception_bits;
171    uint16_t _trap_enable_bits;
172    uint16_t _sticky_bits;
173    uint16_t _rounding_mode;
174    uint16_t _format;
175    uint16_t _last_operation;
176    union {
177      float sf;
178      double df;
179    } _operand1;
180    union {
181      float sf;
182      double df;
183    } _operand2;
184  } Context_Control_fp;
185
186  /*
187   *  This software FP implementation is only for GCC.
188   */
189  #define _CPU_Context_Fp_start( _base, _offset ) \
190     ((void *) _Addresses_Add_offset( (_base), (_offset) ) )
191
192  #define _CPU_Context_Initialize_fp( _fp_area ) \
193     { \
194       Context_Control_fp *_fp; \
195       _fp = *(Context_Control_fp **)_fp_area; \
196       _fp->_exception_bits = 0; \
197       _fp->_trap_enable_bits = 0; \
198       _fp->_sticky_bits = 0; \
199       _fp->_rounding_mode = 0;  /* ROUND_TO_NEAREST */ \
200       _fp->_format = 0;         /* NIL */ \
201       _fp->_last_operation = 0; /* NOOP */ \
202       _fp->_operand1.df = 0; \
203       _fp->_operand2.df = 0; \
204     }
205#endif
206
207#if ( CPU_HARDWARE_FP == TRUE )
208  #if defined( __mcoldfire__ )
209    /* We need memset() to initialize the FP context */
210    #include <string.h>
211
212    #if ( M68K_HAS_FPU == 1 )
213      /*
214       * The Cache Control Register (CACR) has write-only access.  It is also
215       * used to enable and disable the FPU.  We need to maintain a copy of
216       * this register to allow per thread values.
217       */
218      extern uint32_t _CPU_cacr_shadow;
219    #endif
220
221    /* We assume that each ColdFire core with a FPU has also an EMAC unit */
222    typedef struct {
223      uint32_t emac_macsr;
224      uint32_t emac_acc0;
225      uint32_t emac_acc1;
226      uint32_t emac_acc2;
227      uint32_t emac_acc3;
228      uint32_t emac_accext01;
229      uint32_t emac_accext23;
230      uint32_t emac_mask;
231      #if ( M68K_HAS_FPU == 1 )
232        uint16_t fp_state_format;
233        uint16_t fp_state_fpcr;
234        double fp_state_op;
235        uint32_t fp_state_fpsr;
236
237        /*
238         * We need to save the FP Instruction Address Register (FPIAR), because
239         * a context switch can occur within a FP exception before the handler
240         * was able to save this register.
241         */
242        uint32_t fp_fpiar;
243
244        double fp_data [8];
245      #endif
246    } Context_Control_fp;
247
248    #define _CPU_Context_Fp_start( _base, _offset ) \
249      ((void *) _Addresses_Add_offset( (_base), (_offset) ))
250
251    /*
252     * The reset value for all context relevant registers except the FP data
253     * registers is zero.  The reset value of the FP data register is NAN.  The
254     * restore of the reset FP state will reset the FP data registers, so the
255     * initial value of them can be arbitrary here.
256     */
257    #define _CPU_Context_Initialize_fp( _fp_area ) \
258      memset( *(_fp_area), 0, sizeof( Context_Control_fp ) )
259  #else
260    /*
261     *  FP context save area for the M68881/M68882 and 68060 numeric
262     *  coprocessors.
263     */
264    typedef struct {
265      /*
266       * M68K_FP_STATE_SIZE bytes for FSAVE/FRESTORE
267       * 96 bytes for FMOVEM FP0-7
268       * 12 bytes for FMOVEM CREGS
269       * 4 bytes for non-null flag
270       */
271      uint8_t fp_save_area [M68K_FP_STATE_SIZE + 112];
272    } Context_Control_fp;
273
274    #define _CPU_Context_Fp_start( _base, _offset ) \
275       ( \
276         (void *) _Addresses_Add_offset( \
277            (_base), \
278            (_offset) + CPU_CONTEXT_FP_SIZE - 4 \
279         ) \
280       )
281
282    #define _CPU_Context_Initialize_fp( _fp_area ) \
283       { \
284         uint32_t   *_fp_context = (uint32_t *)*(_fp_area); \
285         *(--(_fp_context)) = 0; \
286         *(_fp_area) = (void *)(_fp_context); \
287       }
288  #endif
289#endif
290
291/*
292 *  The following structures define the set of information saved
293 *  on the current stack by RTEMS upon receipt of each exc/interrupt.
294 *  These are not used by m68k handlers.
295 *  The exception frame is for rdbg.
296 */
297
298typedef struct {
299  uint32_t   vecnum; /* vector number */
300} CPU_Interrupt_frame;
301
302typedef struct {
303  uint32_t   vecnum; /* vector number */
304  uint32_t   sr; /* status register */
305  uint32_t   pc; /* program counter */
306  uint32_t   d0, d1, d2, d3, d4, d5, d6, d7;
307  uint32_t   a0, a1, a2, a3, a4, a5, a6, a7;
308} CPU_Exception_frame;
309
310/* variables */
311
312extern void*                     _VBR;
313
314#if ( M68K_HAS_VBR == 0 )
315
316/*
317 * Table of ISR handler entries that resides in RAM. The FORMAT/ID is
318 * pushed onto the stack. This is not is the same order as VBR processors.
319 * The ISR handler takes the format and uses it for dispatching the user
320 * handler.
321 *
322 * FIXME : should be moved to below CPU_INTERRUPT_NUMBER_OF_VECTORS
323 *
324 */
325
326typedef struct {
327  uint16_t   move_a7;            /* move #FORMAT_ID,%a7@- */
328  uint16_t   format_id;
329  uint16_t   jmp;                /* jmp  _ISR_Handlers */
330  uint32_t   isr_handler;
331} _CPU_ISR_handler_entry;
332
333#define M68K_MOVE_A7 0x3F3C
334#define M68K_JMP     0x4EF9
335
336      /* points to jsr-exception-table in targets wo/ VBR register */
337SCORE_EXTERN _CPU_ISR_handler_entry _CPU_ISR_jump_table[256];
338
339#endif /* M68K_HAS_VBR */
340
341#endif /* ASM */
342
343/* constants */
344
345/*
346 *  This defines the number of levels and the mask used to pick those
347 *  bits out of a thread mode.
348 */
349
350#define CPU_MODES_INTERRUPT_LEVEL  0x00000007 /* interrupt level in mode */
351#define CPU_MODES_INTERRUPT_MASK   0x00000007 /* interrupt level in mode */
352
353/*
354 *  context size area for floating point
355 */
356
357#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
358
359/*
360 *  extra stack required by the MPCI receive server thread
361 */
362
363#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024
364
365/*
366 *  m68k family supports 256 distinct vectors.
367 */
368
369#define CPU_INTERRUPT_NUMBER_OF_VECTORS      256
370#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER  (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
371
372/*
373 *  This is defined if the port has a special way to report the ISR nesting
374 *  level.  Most ports maintain the variable _ISR_Nest_level.
375 */
376
377#define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE
378
379/*
380 *  Minimum size of a thread's stack.
381 */
382
383#define CPU_STACK_MINIMUM_SIZE           M68K_CPU_STACK_MINIMUM_SIZE
384
385/*
386 *  Maximum priority of a thread. Note based from 0 which is the idle task.
387 */
388#define CPU_PRIORITY_MAXIMUM             M68K_CPU_PRIORITY_MAXIMUM
389
390#define CPU_SIZEOF_POINTER 4
391
392/*
393 *  m68k is pretty tolerant of alignment.  Just put things on 4 byte boundaries.
394 */
395
396#define CPU_ALIGNMENT                    4
397#define CPU_HEAP_ALIGNMENT               CPU_ALIGNMENT
398#define CPU_PARTITION_ALIGNMENT          CPU_ALIGNMENT
399
400/*
401 *  On m68k thread stacks require no further alignment after allocation
402 *  from the Workspace.
403 */
404
405#define CPU_STACK_ALIGNMENT        0
406
407#ifndef ASM
408
409/* macros */
410
411/*
412 *  ISR handler macros
413 *
414 *  These macros perform the following functions:
415 *     + initialize the RTEMS vector table
416 *     + disable all maskable CPU interrupts
417 *     + restore previous interrupt level (enable)
418 *     + temporarily restore interrupts (flash)
419 *     + set a particular level
420 */
421
422#define _CPU_Initialize_vectors()
423
424#define _CPU_ISR_Disable( _level ) \
425  m68k_disable_interrupts( _level )
426
427#define _CPU_ISR_Enable( _level ) \
428  m68k_enable_interrupts( _level )
429
430#define _CPU_ISR_Flash( _level ) \
431  m68k_flash_interrupts( _level )
432
433#define _CPU_ISR_Set_level( _newlevel ) \
434   m68k_set_interrupt_level( _newlevel )
435
436uint32_t   _CPU_ISR_Get_level( void );
437
438/* end of ISR handler macros */
439
440/*
441 *  Context handler macros
442 *
443 *  These macros perform the following functions:
444 *     + initialize a context area
445 *     + restart the current thread
446 *     + calculate the initial pointer into a FP context area
447 *     + initialize an FP context area
448 */
449
450void _CPU_Context_Initialize(
451  Context_Control *the_context,
452  void *stack_area_begin,
453  size_t stack_area_size,
454  uint32_t new_level,
455  void (*entry_point)( void ),
456  bool is_fp,
457  void *tls_area
458);
459
460/* end of Context handler macros */
461
462/*
463 *  _CPU_Thread_Idle_body
464 *
465 *  This routine is the CPU dependent IDLE thread body.
466 *
467 *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
468 *         is TRUE.
469 */
470
471void *_CPU_Thread_Idle_body( uintptr_t ignored );
472
473/*
474 *  Fatal Error manager macros
475 *
476 *  These macros perform the following functions:
477 *    + disable interrupts and halt the CPU
478 */
479
480#if ( defined(__mcoldfire__) )
481#define _CPU_Fatal_halt( _source, _error ) \
482  { __asm__ volatile( "move.w %%sr,%%d0\n\t" \
483                  "or.l %2,%%d0\n\t" \
484                  "move.w %%d0,%%sr\n\t" \
485                  "move.l %1,%%d0\n\t" \
486                  "move.l #0xDEADBEEF,%%d1\n\t" \
487                  "halt" \
488                  : "=g" (_error) \
489                  : "0" (_error), "d"(0x0700) \
490                  : "d0", "d1" ); \
491  }
492#else
493#define _CPU_Fatal_halt( _source, _error ) \
494  { __asm__ volatile( "movl  %0,%%d0; " \
495                  "orw   #0x0700,%%sr; " \
496                  "stop  #0x2700" : "=d" ((_error)) : "0" ((_error)) ); \
497  }
498#endif
499
500/* end of Fatal Error manager macros */
501
502/*
503 *  Bitfield handler macros
504 *
505 *  These macros perform the following functions:
506 *     + scan for the highest numbered (MSB) set in a 16 bit bitfield
507 *
508 *  NOTE:
509 *
510 *    It appears that on the M68020 bitfield are always 32 bits wide
511 *    when in a register.  This code forces the bitfield to be in
512 *    memory (it really always is anyway). This allows us to
513 *    have a real 16 bit wide bitfield which operates "correctly."
514 */
515
516#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
517#define CPU_USE_GENERIC_BITFIELD_DATA FALSE
518
519#if ( M68K_HAS_BFFFO != 1 )
520/*
521 *  Lookup table for BFFFO simulation
522 */
523extern const unsigned char _CPU_m68k_BFFFO_table[256];
524#endif
525
526#if ( M68K_HAS_BFFFO == 1 )
527
528#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
529  __asm__ volatile( "bfffo (%1),#0,#16,%0" : "=d" (_output) : "a" (&_value));
530
531#elif ( __mcfisaaplus__ )
532  /* This is simplified by the fact that RTEMS never calls it with _value=0 */
533#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
534    __asm__ volatile ( \
535       "   swap     %0\n"        \
536       "   ff1.l    %0\n"        \
537       : "=d" ((_output))        \
538       : "0" ((_value))          \
539       : "cc" ) ;
540
541#else
542/* duplicates BFFFO results for 16 bits (i.e., 15-(_priority) in
543   _CPU_Priority_bits_index is not needed), handles the 0 case, and
544   does not molest _value -- jsg */
545#if ( defined(__mcoldfire__) )
546
547#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
548  { \
549    register int dumby; \
550    \
551    __asm__ volatile ( \
552       "   clr.l   %1\n"         \
553       "   move.w  %2,%1\n"      \
554       "   lsr.l   #8,%1\n"      \
555       "   beq.s   1f\n"         \
556       "   move.b  (%3,%1),%0\n" \
557       "   bra.s   0f\n"         \
558       "1: move.w  %2,%1\n"      \
559       "   move.b  (%3,%1),%0\n" \
560       "   addq.l  #8,%0\n"      \
561       "0: and.l   #0xff,%0\n"   \
562       : "=&d" ((_output)), "=&d" ((dumby))    \
563       : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
564       : "cc" ) ; \
565  }
566#elif ( M68K_HAS_EXTB_L == 1 )
567#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
568  { \
569    register int dumby; \
570    \
571    __asm__ volatile ( "   move.w  %2,%1\n"        \
572       "   lsr.w   #8,%1\n"        \
573       "   beq.s   1f\n"           \
574       "   move.b  (%3,%1.w),%0\n" \
575       "   extb.l  %0\n"           \
576       "   bra.s   0f\n"           \
577       "1: moveq.l #8,%0\n"        \
578       "   add.b   (%3,%2.w),%0\n" \
579       "0:\n"                      \
580       : "=&d" ((_output)), "=&d" ((dumby)) \
581       : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
582       : "cc" ) ; \
583  }
584#else
585#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
586  { \
587    register int dumby; \
588    \
589    __asm__ volatile ( "   move.w  %2,%1\n"        \
590       "   lsr.w   #8,%1\n"        \
591       "   beq.s   1f\n"           \
592       "   move.b  (%3,%1.w),%0\n" \
593       "   and.l   #0x000000ff,%0\n"\
594       "   bra.s   0f\n"           \
595       "1: moveq.l #8,%0\n"        \
596       "   add.b   (%3,%2.w),%0\n" \
597       "0:\n"                      \
598       : "=&d" ((_output)), "=&d" ((dumby)) \
599       : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
600       : "cc" ) ; \
601  }
602#endif
603
604#endif
605
606/* end of Bitfield handler macros */
607
608/*
609 *  Priority handler macros
610 *
611 *  These macros perform the following functions:
612 *    + return a mask with the bit for this major/minor portion of
613 *      of thread priority set.
614 *    + translate the bit number returned by "Bitfield_find_first_bit"
615 *      into an index into the thread ready chain bit maps
616 */
617
618#define _CPU_Priority_Mask( _bit_number ) \
619  ( 0x8000 >> (_bit_number) )
620
621#define _CPU_Priority_bits_index( _priority ) \
622  (_priority)
623
624/* end of Priority handler macros */
625
626/* functions */
627
628/*
629 *  _CPU_Initialize
630 *
631 *  This routine performs CPU dependent initialization.
632 */
633
634void _CPU_Initialize(void);
635
636/*
637 *  _CPU_ISR_install_raw_handler
638 *
639 *  This routine installs a "raw" interrupt handler directly into the
640 *  processor's vector table.
641 */
642
643void _CPU_ISR_install_raw_handler(
644  uint32_t    vector,
645  proc_ptr    new_handler,
646  proc_ptr   *old_handler
647);
648
649/*
650 *  _CPU_ISR_install_vector
651 *
652 *  This routine installs an interrupt vector.
653 */
654
655void _CPU_ISR_install_vector(
656  uint32_t         vector,
657  proc_ptr         new_handler,
658  proc_ptr        *old_handler
659);
660
661/*
662 *  _CPU_Install_interrupt_stack
663 *
664 *  This routine installs the hardware interrupt stack pointer.
665 */
666
667void _CPU_Install_interrupt_stack( void );
668
669/*
670 *  _CPU_Context_switch
671 *
672 *  This routine switches from the run context to the heir context.
673 */
674
675void _CPU_Context_switch(
676  Context_Control  *run,
677  Context_Control  *heir
678);
679
680void _CPU_Context_Restart_self(
681  Context_Control  *the_context
682) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
683
684/*
685 *  _CPU_Context_save_fp
686 *
687 *  This routine saves the floating point context passed to it.
688 */
689
690void _CPU_Context_save_fp(
691  Context_Control_fp **fp_context_ptr
692);
693
694/*
695 *  _CPU_Context_restore_fp
696 *
697 *  This routine restores the floating point context passed to it.
698 */
699
700void _CPU_Context_restore_fp(
701  Context_Control_fp **fp_context_ptr
702);
703
704static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
705{
706  /* TODO */
707}
708
709static inline void _CPU_Context_validate( uintptr_t pattern )
710{
711  while (1) {
712    /* TODO */
713  }
714}
715
716/**
717 *  This method prints the CPU exception frame.
718 *
719 *  @param[in] frame points to the frame to be printed
720 */
721void _CPU_Exception_frame_print(
722  const CPU_Exception_frame *frame
723);
724
725typedef uint32_t CPU_Counter_ticks;
726
727CPU_Counter_ticks _CPU_Counter_read( void );
728
729static inline CPU_Counter_ticks _CPU_Counter_difference(
730  CPU_Counter_ticks second,
731  CPU_Counter_ticks first
732)
733{
734  return second - first;
735}
736
737#if (M68K_HAS_FPSP_PACKAGE == 1)
738/*
739 *  Hooks for the Floating Point Support Package (FPSP) provided by Motorola
740 *
741 *  NOTES:
742 *
743 *  Motorola 68k family CPU's before the 68040 used a coprocessor
744 *  (68881 or 68882) to handle floating point.  The 68040 has internal
745 *  floating point support -- but *not* the complete support provided by
746 *  the 68881 or 68882.  The leftover functions are taken care of by the
747 *  M68040 Floating Point Support Package.  Quoting from the MC68040
748 *  Microprocessors User's Manual, Section 9, Floating-Point Unit (MC68040):
749 *
750 *    "When used with the M68040FPSP, the MC68040 FPU is fully
751 *    compliant with IEEE floating-point standards."
752 *
753 *  M68KFPSPInstallExceptionHandlers is in libcpu/m68k/MODEL/fpsp and
754 *  is invoked early in the application code to ensure that proper FP
755 *  behavior is installed.  This is not left to the BSP to call, since
756 *  this would force all applications using that BSP to use FPSP which
757 *  is not necessarily desirable.
758 *
759 *  There is a similar package for the 68060 but RTEMS does not yet
760 *  support the 68060.
761 */
762
763void M68KFPSPInstallExceptionHandlers (void);
764
765SCORE_EXTERN int (*_FPSP_install_raw_handler)(
766  uint32_t   vector,
767  proc_ptr new_handler,
768  proc_ptr *old_handler
769);
770
771#endif
772
773
774#endif
775
776#ifdef __cplusplus
777}
778#endif
779
780#endif
Note: See TracBrowser for help on using the repository browser.