source: rtems/cpukit/score/cpu/sh/include/rtems/score/cpu.h @ 511dc4b

5
Last change on this file since 511dc4b was 511dc4b, checked in by Sebastian Huber <sebastian.huber@…>, on 06/19/18 at 07:09:51

Rework initialization and interrupt stack support

Statically initialize the interrupt stack area
(_Configuration_Interrupt_stack_area_begin,
_Configuration_Interrupt_stack_area_end, and
_Configuration_Interrupt_stack_size) via <rtems/confdefs.h>. Place the
interrupt stack area in a special section ".rtemsstack.interrupt". Let
BSPs define the optimal placement of this section in their linker
command files (e.g. in a fast on-chip memory).

This change makes makes the CPU_HAS_SOFTWARE_INTERRUPT_STACK and
CPU_HAS_HARDWARE_INTERRUPT_STACK CPU port defines superfluous, since the
low level initialization code has all information available via global
symbols.

This change makes the CPU_ALLOCATE_INTERRUPT_STACK CPU port define
superfluous, since the interrupt stacks are allocated by confdefs.h for
all architectures. There is no need for BSP-specific linker command
file magic (except the section placement), see previous ARM linker
command file as a bad example.

Remove _CPU_Install_interrupt_stack(). Initialize the hardware
interrupt stack in _CPU_Initialize() if necessary (e.g.
m68k_install_interrupt_stack()).

The optional _CPU_Interrupt_stack_setup() is still useful to customize
the registration of the interrupt stack area in the per-CPU information.

The initialization stack can reuse the interrupt stack, since

  • interrupts are disabled during the sequential system initialization, and
  • the boot_card() function does not return.

This stack resuse saves memory.

Changes per architecture:

arm:

  • Mostly replace the linker symbol based configuration of stacks with the standard <rtems/confdefs.h> configuration via CONFIGURE_INTERRUPT_STACK_SIZE. The size of the FIQ, ABT and UND mode stack is still defined via linker symbols. These modes are rarely used in applications and the default values provided by the BSP should be sufficient in most cases.
  • Remove the bsp_processor_count linker symbol hack used for the SMP support. This is possible since the interrupt stack area is now allocated by the linker and not allocated from the heap. This makes some configure.ac stuff obsolete. Remove the now superfluous BSP variants altcycv_devkit_smp and realview_pbx_a9_qemu_smp.

bfin:

  • Remove unused magic linker command file allocation of initialization stack. Maybe a previous linker command file copy and paste problem? In the start.S the initialization stack is set to a hard coded value.

lm32, m32c, mips, nios2, riscv, sh, v850:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.

m68k:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.

powerpc:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.
  • Used dedicated memory region (REGION_RTEMSSTACK) for the interrupt stack on BSPs using the shared linkcmds.base (replacement for REGION_RWEXTRA).

sparc:

  • Remove the hard coded initialization stack. Use the interrupt stack for the initialization stack on the boot processor. This saves 16KiB of RAM.

Update #3459.

  • Property mode set to 100644
File size: 19.7 KB
Line 
1/**
2 * @file rtems/score/cpu.h
3 */
4
5/*
6 *  This include file contains information pertaining to the Hitachi SH
7 *  processor.
8 *
9 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
10 *           Bernd Becker (becker@faw.uni-ulm.de)
11 *
12 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
13 *
14 *  This program is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 *
19 *  COPYRIGHT (c) 1998-2006.
20 *  On-Line Applications Research Corporation (OAR).
21 *
22 *  The license and distribution terms for this file may be
23 *  found in the file LICENSE in this distribution or at
24 *  http://www.rtems.org/license/LICENSE.
25 */
26
27#ifndef _RTEMS_SCORE_CPU_H
28#define _RTEMS_SCORE_CPU_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <rtems/score/basedefs.h>
35#include <rtems/score/sh.h>
36
37/* conditional compilation parameters */
38
39/*
40 *  Does the CPU follow the simple vectored interrupt model?
41 *
42 *  If TRUE, then RTEMS allocates the vector table it internally manages.
43 *  If FALSE, then the BSP is assumed to allocate and manage the vector
44 *  table
45 *
46 *  SH Specific Information:
47 *
48 *  XXX document implementation including references if appropriate
49 */
50#define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
51
52/*
53 *  Does the RTEMS invoke the user's ISR with the vector number and
54 *  a pointer to the saved interrupt frame (1) or just the vector
55 *  number (0)?
56 */
57
58#define CPU_ISR_PASSES_FRAME_POINTER FALSE
59
60/*
61 *  Does the CPU have hardware floating point?
62 *
63 *  If TRUE, then the RTEMS_FLOATING_POINT task attribute is supported.
64 *  If FALSE, then the RTEMS_FLOATING_POINT task attribute is ignored.
65 *
66 *  We currently support sh1 only, which has no FPU, other SHes have an FPU
67 *
68 *  The macro name "SH_HAS_FPU" should be made CPU specific.
69 *  It indicates whether or not this CPU model has FP support.  For
70 *  example, it would be possible to have an i386_nofp CPU model
71 *  which set this to false to indicate that you have an i386 without
72 *  an i387 and wish to leave floating point support out of RTEMS.
73 */
74
75#if SH_HAS_FPU
76#define CPU_HARDWARE_FP TRUE
77#define CPU_SOFTWARE_FP FALSE
78#else
79#define CPU_SOFTWARE_FP FALSE
80#define CPU_HARDWARE_FP FALSE
81#endif
82
83/*
84 *  Are all tasks RTEMS_FLOATING_POINT tasks implicitly?
85 *
86 *  If TRUE, then the RTEMS_FLOATING_POINT task attribute is assumed.
87 *  If FALSE, then the RTEMS_FLOATING_POINT task attribute is followed.
88 *
89 *  If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.
90 */
91
92#if SH_HAS_FPU
93#define CPU_ALL_TASKS_ARE_FP     TRUE
94#else
95#define CPU_ALL_TASKS_ARE_FP     FALSE
96#endif
97
98/*
99 *  Should the IDLE task have a floating point context?
100 *
101 *  If TRUE, then the IDLE task is created as a RTEMS_FLOATING_POINT task
102 *  and it has a floating point context which is switched in and out.
103 *  If FALSE, then the IDLE task does not have a floating point context.
104 *
105 *  Setting this to TRUE negatively impacts the time required to preempt
106 *  the IDLE task from an interrupt because the floating point context
107 *  must be saved as part of the preemption.
108 */
109
110#if SH_HAS_FPU
111#define CPU_IDLE_TASK_IS_FP     TRUE
112#else
113#define CPU_IDLE_TASK_IS_FP      FALSE
114#endif
115
116/*
117 *  Should the saving of the floating point registers be deferred
118 *  until a context switch is made to another different floating point
119 *  task?
120 *
121 *  If TRUE, then the floating point context will not be stored until
122 *  necessary.  It will remain in the floating point registers and not
123 *  disturned until another floating point task is switched to.
124 *
125 *  If FALSE, then the floating point context is saved when a floating
126 *  point task is switched out and restored when the next floating point
127 *  task is restored.  The state of the floating point registers between
128 *  those two operations is not specified.
129 *
130 *  If the floating point context does NOT have to be saved as part of
131 *  interrupt dispatching, then it should be safe to set this to TRUE.
132 *
133 *  Setting this flag to TRUE results in using a different algorithm
134 *  for deciding when to save and restore the floating point context.
135 *  The deferred FP switch algorithm minimizes the number of times
136 *  the FP context is saved and restored.  The FP context is not saved
137 *  until a context switch is made to another, different FP task.
138 *  Thus in a system with only one FP task, the FP context will never
139 *  be saved or restored.
140 */
141
142#if SH_HAS_FPU
143#define CPU_USE_DEFERRED_FP_SWITCH      FALSE
144#else
145#define CPU_USE_DEFERRED_FP_SWITCH      TRUE
146#endif
147
148#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
149
150/*
151 *  Does this port provide a CPU dependent IDLE task implementation?
152 *
153 *  If TRUE, then the routine _CPU_Thread_Idle_body
154 *  must be provided and is the default IDLE thread body instead of
155 *  _CPU_Thread_Idle_body.
156 *
157 *  If FALSE, then use the generic IDLE thread body if the BSP does
158 *  not provide one.
159 *
160 *  This is intended to allow for supporting processors which have
161 *  a low power or idle mode.  When the IDLE thread is executed, then
162 *  the CPU can be powered down.
163 *
164 *  The order of precedence for selecting the IDLE thread body is:
165 *
166 *    1.  BSP provided
167 *    2.  CPU dependent (if provided)
168 *    3.  generic (if no BSP and no CPU dependent)
169 */
170
171#define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
172
173/*
174 *  Does the stack grow up (toward higher addresses) or down
175 *  (toward lower addresses)?
176 *
177 *  If TRUE, then the grows upward.
178 *  If FALSE, then the grows toward smaller addresses.
179 */
180
181#define CPU_STACK_GROWS_UP               FALSE
182
183/* FIXME: Is this the right value? */
184#define CPU_CACHE_LINE_BYTES 16
185
186#define CPU_STRUCTURE_ALIGNMENT RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES )
187
188/*
189 *  The following defines the number of bits actually used in the
190 *  interrupt field of the task mode.  How those bits map to the
191 *  CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().
192 */
193
194#define CPU_MODES_INTERRUPT_MASK   0x0000000f
195
196#define CPU_MAXIMUM_PROCESSORS 32
197
198/*
199 *  Processor defined structures required for cpukit/score.
200 */
201
202/* may need to put some structures here.  */
203
204/*
205 * Contexts
206 *
207 *  Generally there are 2 types of context to save.
208 *     1. Interrupt registers to save
209 *     2. Task level registers to save
210 *
211 *  This means we have the following 3 context items:
212 *     1. task level context stuff::  Context_Control
213 *     2. floating point task stuff:: Context_Control_fp
214 *     3. special interrupt level context :: Context_Control_interrupt
215 *
216 *  On some processors, it is cost-effective to save only the callee
217 *  preserved registers during a task context switch.  This means
218 *  that the ISR code needs to save those registers which do not
219 *  persist across function calls.  It is not mandatory to make this
220 *  distinctions between the caller/callee saves registers for the
221 *  purpose of minimizing context saved during task switch and on interrupts.
222 *  If the cost of saving extra registers is minimal, simplicity is the
223 *  choice.  Save the same context on interrupt entry as for tasks in
224 *  this case.
225 *
226 *  Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then
227 *  care should be used in designing the context area.
228 *
229 *  On some CPUs with hardware floating point support, the Context_Control_fp
230 *  structure will not be used or it simply consist of an array of a
231 *  fixed number of bytes.   This is done when the floating point context
232 *  is dumped by a "FP save context" type instruction and the format
233 *  is not really defined by the CPU.  In this case, there is no need
234 *  to figure out the exact format -- only the size.  Of course, although
235 *  this is enough information for RTEMS, it is probably not enough for
236 *  a debugger such as gdb.  But that is another problem.
237 */
238
239typedef struct {
240  uint32_t   *r15;      /* stack pointer */
241
242  uint32_t   macl;
243  uint32_t   mach;
244  uint32_t   *pr;
245
246  uint32_t   *r14;      /* frame pointer/call saved */
247
248  uint32_t   r13;       /* call saved */
249  uint32_t   r12;       /* call saved */
250  uint32_t   r11;       /* call saved */
251  uint32_t   r10;       /* call saved */
252  uint32_t   r9;        /* call saved */
253  uint32_t   r8;        /* call saved */
254
255  uint32_t   *r7;       /* arg in */
256  uint32_t   *r6;       /* arg in */
257
258#if 0
259  uint32_t   *r5;       /* arg in */
260  uint32_t   *r4;       /* arg in */
261#endif
262
263  uint32_t   *r3;       /* scratch */
264  uint32_t   *r2;       /* scratch */
265  uint32_t   *r1;       /* scratch */
266
267  uint32_t   *r0;       /* arg return */
268
269  uint32_t   gbr;
270  uint32_t   sr;
271
272} Context_Control;
273
274#define _CPU_Context_Get_SP( _context ) \
275  (_context)->r15
276
277typedef struct {
278#if SH_HAS_FPU
279#ifdef SH4_USE_X_REGISTERS
280  union {
281    float f[16];
282    double d[8];
283  } x;
284#endif
285  union {
286    float f[16];
287    double d[8];
288  } r;
289  float fpul;       /* fp communication register */
290  uint32_t   fpscr; /* fp control register */
291#endif /* SH_HAS_FPU */
292} Context_Control_fp;
293
294typedef struct {
295} CPU_Interrupt_frame;
296
297/*
298 *  This variable is optional.  It is used on CPUs on which it is difficult
299 *  to generate an "uninitialized" FP context.  It is filled in by
300 *  _CPU_Initialize and copied into the task's FP context area during
301 *  _CPU_Context_Initialize.
302 */
303
304#if SH_HAS_FPU
305extern Context_Control_fp _CPU_Null_fp_context;
306#endif
307
308/*
309 *  Nothing prevents the porter from declaring more CPU specific variables.
310 */
311
312/* XXX: if needed, put more variables here */
313void CPU_delay( uint32_t   microseconds );
314
315/*
316 *  The size of the floating point context area.  On some CPUs this
317 *  will not be a "sizeof" because the format of the floating point
318 *  area is not defined -- only the size is.  This is usually on
319 *  CPUs with a "floating point save context" instruction.
320 */
321
322#define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
323
324/*
325 *  Amount of extra stack (above minimum stack size) required by
326 *  MPCI receive server thread.  Remember that in a multiprocessor
327 *  system this thread must exist and be able to process all directives.
328 */
329
330#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
331
332/*
333 *  This defines the number of entries in the ISR_Vector_table managed
334 *  by RTEMS.
335 */
336
337#define CPU_INTERRUPT_NUMBER_OF_VECTORS      256
338#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER  (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
339
340/*
341 *  This is defined if the port has a special way to report the ISR nesting
342 *  level.  Most ports maintain the variable _ISR_Nest_level.
343 */
344
345#define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE
346
347/*
348 *  Should be large enough to run all RTEMS tests.  This ensures
349 *  that a "reasonable" small application should not have any problems.
350 *
351 *  We have been able to run the sptests with this value, but have not
352 *  been able to run the tmtest suite.
353 */
354
355#define CPU_STACK_MINIMUM_SIZE          4096
356
357#define CPU_SIZEOF_POINTER 4
358
359/*
360 *  CPU's worst alignment requirement for data types on a byte boundary.  This
361 *  alignment does not take into account the requirements for the stack.
362 */
363#if defined(__SH4__)
364/* FIXME: sh3 and SH3E? */
365#define CPU_ALIGNMENT              8
366#else
367#define CPU_ALIGNMENT              4
368#endif
369
370/*
371 *  This number corresponds to the byte alignment requirement for the
372 *  heap handler.  This alignment requirement may be stricter than that
373 *  for the data types alignment specified by CPU_ALIGNMENT.  It is
374 *  common for the heap to follow the same alignment requirement as
375 *  CPU_ALIGNMENT.  If the CPU_ALIGNMENT is strict enough for the heap,
376 *  then this should be set to CPU_ALIGNMENT.
377 *
378 *  NOTE:  This does not have to be a power of 2.  It does have to
379 *         be greater or equal to than CPU_ALIGNMENT.
380 */
381
382#define CPU_HEAP_ALIGNMENT         CPU_ALIGNMENT
383
384/*
385 *  This number corresponds to the byte alignment requirement for memory
386 *  buffers allocated by the partition manager.  This alignment requirement
387 *  may be stricter than that for the data types alignment specified by
388 *  CPU_ALIGNMENT.  It is common for the partition to follow the same
389 *  alignment requirement as CPU_ALIGNMENT.  If the CPU_ALIGNMENT is strict
390 *  enough for the partition, then this should be set to CPU_ALIGNMENT.
391 *
392 *  NOTE:  This does not have to be a power of 2.  It does have to
393 *         be greater or equal to than CPU_ALIGNMENT.
394 */
395
396#define CPU_PARTITION_ALIGNMENT    CPU_ALIGNMENT
397
398/*
399 *  This number corresponds to the byte alignment requirement for the
400 *  stack.  This alignment requirement may be stricter than that for the
401 *  data types alignment specified by CPU_ALIGNMENT.  If the CPU_ALIGNMENT
402 *  is strict enough for the stack, then this should be set to 0.
403 *
404 *  NOTE:  This must be a power of 2 either 0 or greater than CPU_ALIGNMENT.
405 */
406
407#define CPU_STACK_ALIGNMENT        CPU_ALIGNMENT
408
409#define CPU_INTERRUPT_STACK_ALIGNMENT CPU_CACHE_LINE_BYTES
410
411/*
412 *  ISR handler macros
413 */
414
415/*
416 *  Support routine to initialize the RTEMS vector table after it is allocated.
417 *
418 *  SH Specific Information: NONE
419 */
420
421#define _CPU_Initialize_vectors()
422
423/*
424 *  Disable all interrupts for an RTEMS critical section.  The previous
425 *  level is returned in _level.
426 */
427
428#define _CPU_ISR_Disable( _level) \
429  sh_disable_interrupts( _level )
430
431/*
432 *  Enable interrupts to the previous level (returned by _CPU_ISR_Disable).
433 *  This indicates the end of an RTEMS critical section.  The parameter
434 *  _level is not modified.
435 */
436
437#define _CPU_ISR_Enable( _level) \
438   sh_enable_interrupts( _level)
439
440/*
441 *  This temporarily restores the interrupt to _level before immediately
442 *  disabling them again.  This is used to divide long RTEMS critical
443 *  sections into two or more parts.  The parameter _level is not
444 * modified.
445 */
446
447#define _CPU_ISR_Flash( _level) \
448  sh_flash_interrupts( _level)
449
450RTEMS_INLINE_ROUTINE bool _CPU_ISR_Is_enabled( uint32_t level )
451{
452  sh_get_interrupt_level( level );
453  return level == 0;
454}
455
456/*
457 *  Map interrupt level in task mode onto the hardware that the CPU
458 *  actually provides.  Currently, interrupt levels which do not
459 *  map onto the CPU in a generic fashion are undefined.  Someday,
460 *  it would be nice if these were "mapped" by the application
461 *  via a callout.  For example, m68k has 8 levels 0 - 7, levels
462 *  8 - 255 would be available for bsp/application specific meaning.
463 *  This could be used to manage a programmable interrupt controller
464 *  via the rtems_task_mode directive.
465 */
466
467#define _CPU_ISR_Set_level( _newlevel) \
468  sh_set_interrupt_level(_newlevel)
469
470uint32_t   _CPU_ISR_Get_level( void );
471
472/* end of ISR handler macros */
473
474/* Context handler macros */
475
476/*
477 *  Initialize the context to a state suitable for starting a
478 *  task after a context restore operation.  Generally, this
479 *  involves:
480 *
481 *     - setting a starting address
482 *     - preparing the stack
483 *     - preparing the stack and frame pointers
484 *     - setting the proper interrupt level in the context
485 *     - initializing the floating point context
486 *
487 *  This routine generally does not set any unnecessary register
488 *  in the context.  The state of the "general data" registers is
489 *  undefined at task start time.
490 *
491 *  NOTE: This is_fp parameter is TRUE if the thread is to be a floating
492 *        point thread.  This is typically only used on CPUs where the
493 *        FPU may be easily disabled by software such as on the SPARC
494 *        where the PSR contains an enable FPU bit.
495 */
496
497/*
498 * FIXME: defined as a function for debugging - should be a macro
499 */
500void _CPU_Context_Initialize(
501  Context_Control       *_the_context,
502  void                  *_stack_base,
503  uint32_t              _size,
504  uint32_t              _isr,
505  void    (*_entry_point)(void),
506  int                   _is_fp,
507  void                  *_tls_area );
508
509/*
510 *  This routine is responsible for somehow restarting the currently
511 *  executing task.  If you are lucky, then all that is necessary
512 *  is restoring the context.  Otherwise, there will need to be
513 *  a special assembly routine which does something special in this
514 *  case.  Context_Restore should work most of the time.  It will
515 *  not work if restarting self conflicts with the stack frame
516 *  assumptions of restoring a context.
517 */
518
519#define _CPU_Context_Restart_self( _the_context ) \
520   _CPU_Context_restore( (_the_context) );
521
522/*
523 *  This routine initializes the FP context area passed to it to.
524 *  There are a few standard ways in which to initialize the
525 *  floating point context.  The code included for this macro assumes
526 *  that this is a CPU in which a "initial" FP context was saved into
527 *  _CPU_Null_fp_context and it simply copies it to the destination
528 *  context passed to it.
529 *
530 *  Other models include (1) not doing anything, and (2) putting
531 *  a "null FP status word" in the correct place in the FP context.
532 *  SH1, SH2, SH3 have no FPU, but the SH3e and SH4 have.
533 */
534
535#if SH_HAS_FPU
536#define _CPU_Context_Initialize_fp( _destination ) \
537  do { \
538     *(*(_destination)) = _CPU_Null_fp_context;\
539  } while(0)
540#else
541#define _CPU_Context_Initialize_fp( _destination ) \
542  {  }
543#endif
544
545/* end of Context handler macros */
546
547/* Fatal Error manager macros */
548
549/*
550 * FIXME: Trap32 ???
551 *
552 *  This routine copies _error into a known place -- typically a stack
553 *  location or a register, optionally disables interrupts, and
554 *  invokes a Trap32 Instruction which returns to the breakpoint
555 *  routine of cmon.
556 */
557
558#ifdef BSP_FATAL_HALT
559  /* we manage the fatal error in the board support package */
560  void bsp_fatal_halt( uint32_t   _error);
561#define _CPU_Fatal_halt( _source, _error ) bsp_fatal_halt( _error)
562#else
563#define _CPU_Fatal_halt( _source, _error)\
564{ \
565  __asm__ volatile("mov.l %0,r0"::"m" (_error)); \
566  __asm__ volatile("mov #1, r4"); \
567  __asm__ volatile("trapa #34"); \
568}
569#endif
570
571/* end of Fatal Error manager macros */
572
573#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
574
575/* functions */
576
577/*
578 *  @brief CPU Initialize
579 *
580 *  _CPU_Initialize
581 *
582 *  This routine performs CPU dependent initialization.
583 */
584void _CPU_Initialize(void);
585
586/*
587 *  _CPU_ISR_install_raw_handler
588 *
589 *  This routine installs a "raw" interrupt handler directly into the
590 *  processor's vector table.
591 */
592
593void _CPU_ISR_install_raw_handler(
594  uint32_t    vector,
595  proc_ptr    new_handler,
596  proc_ptr   *old_handler
597);
598
599/*
600 *  _CPU_ISR_install_vector
601 *
602 *  This routine installs an interrupt vector.
603 */
604
605void _CPU_ISR_install_vector(
606  uint32_t    vector,
607  proc_ptr    new_handler,
608  proc_ptr   *old_handler
609);
610
611/*
612 *  _CPU_Thread_Idle_body
613 *
614 *  This routine is the CPU dependent IDLE thread body.
615 *
616 *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
617 *         is TRUE.
618 */
619
620void *_CPU_Thread_Idle_body( uintptr_t ignored );
621
622/*
623 *  _CPU_Context_switch
624 *
625 *  This routine switches from the run context to the heir context.
626 */
627
628void _CPU_Context_switch(
629  Context_Control  *run,
630  Context_Control  *heir
631);
632
633/*
634 *  _CPU_Context_restore
635 *
636 *  This routine is generally used only to restart self in an
637 *  efficient manner.  It may simply be a label in _CPU_Context_switch.
638 */
639
640void _CPU_Context_restore(
641  Context_Control *new_context
642) RTEMS_NO_RETURN;
643
644/*
645 *  @brief This routine saves the floating point context passed to it.
646 *
647 *  _CPU_Context_save_fp
648 *
649 */
650void _CPU_Context_save_fp(
651  Context_Control_fp **fp_context_ptr
652);
653
654/*
655 *  @brief This routine restores the floating point context passed to it.
656 *
657 *  _CPU_Context_restore_fp
658 *
659 */
660void _CPU_Context_restore_fp(
661  Context_Control_fp **fp_context_ptr
662);
663
664static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
665{
666  /* TODO */
667}
668
669static inline void _CPU_Context_validate( uintptr_t pattern )
670{
671  while (1) {
672    /* TODO */
673  }
674}
675
676/* FIXME */
677typedef CPU_Interrupt_frame CPU_Exception_frame;
678
679void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
680
681typedef uint32_t CPU_Counter_ticks;
682
683uint32_t _CPU_Counter_frequency( void );
684
685CPU_Counter_ticks _CPU_Counter_read( void );
686
687static inline CPU_Counter_ticks _CPU_Counter_difference(
688  CPU_Counter_ticks second,
689  CPU_Counter_ticks first
690)
691{
692  return second - first;
693}
694
695/** Type that can store a 32-bit integer or a pointer. */
696typedef uintptr_t CPU_Uint32ptr;
697
698/** Types related to SH specific ISRs */
699typedef void sh_isr;
700typedef void ( *sh_isr_entry )( void );
701
702#ifdef __cplusplus
703}
704#endif
705
706#endif
Note: See TracBrowser for help on using the repository browser.