source: rtems/c/src/exec/rtems/include/rtems/rtems/modes.h @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*  modes.h
2 *
3 *  This include file contains all constants and structures associated
4 *  with the RTEMS thread and RTEMS_ASR modes.
5 *
6 *  COPYRIGHT (c) 1989-1997.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may in
11 *  the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __RTEMS_MODES_h
18#define __RTEMS_MODES_h
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <rtems/score/isr.h>
25
26/*
27 *  The following type defines the control block used to manage
28 *  each a mode set.
29 */
30
31typedef unsigned32 Modes_Control;
32
33/*
34 *  The following constants define the individual modes and masks
35 *  which may be used to compose a mode set and to alter modes.
36 */
37
38#define RTEMS_ALL_MODE_MASKS     0x0000ffff
39
40#define RTEMS_DEFAULT_MODES     0x00000000
41#define RTEMS_CURRENT_MODE      0
42
43#define RTEMS_PREEMPT_MASK    0x00000100  /* preemption bit           */
44#define RTEMS_TIMESLICE_MASK  0x00000200  /* timeslice bit            */
45#define RTEMS_ASR_MASK        0x00000400  /* RTEMS_ASR enable bit           */
46#define RTEMS_INTERRUPT_MASK  CPU_MODES_INTERRUPT_MASK
47
48#define RTEMS_PREEMPT      0x00000000     /* enable preemption        */
49#define RTEMS_NO_PREEMPT   0x00000100     /* disable preemption       */
50
51#define RTEMS_NO_TIMESLICE 0x00000000     /* disable timeslicing      */
52#define RTEMS_TIMESLICE    0x00000200     /* enable timeslicing       */
53
54#define RTEMS_ASR          0x00000000     /* enable RTEMS_ASR               */
55#define RTEMS_NO_ASR       0x00000400     /* disable RTEMS_ASR              */
56
57/*
58 *  The number of bits for interrupt levels is CPU dependent.
59 *  RTEMS supports 0 to 256 levels in bits 0-7 of the mode.
60 */
61
62/*PAGE
63 *
64 *  RTEMS_INTERRUPT_LEVEL
65 *
66 *  DESCRIPTION:
67 *
68 *  This function returns the processor dependent interrupt
69 *  level which corresponds to the requested interrupt level.
70 *
71 * NOTE: RTEMS supports 256 interrupt levels using the least
72 *       significant eight bits of MODES.CONTROL.  On any
73 *       particular CPU, fewer than 256 levels may be supported.
74 */
75
76#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
77  ( (_mode_set) & RTEMS_INTERRUPT_MASK )
78 
79
80#ifndef __RTEMS_APPLICATION__
81#include <rtems/rtems/modes.inl>
82#endif
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif
89/* end of include file */
Note: See TracBrowser for help on using the repository browser.