source: rtems/cpukit/score/cpu/m68k/rtems/score/cpu.h @ 01b32d4

5
Last change on this file since 01b32d4 was 01b32d4, checked in by Sebastian Huber <sebastian.huber@…>, on 01/25/16 at 07:54:17

score: Delete obsolete CPU_TIMESTAMP_* defines

Update #2271.

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