source: rtems/c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.h @ 73b5bd5d

4.104.114.84.95
Last change on this file since 73b5bd5d was 73b5bd5d, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 15, 2004 at 1:33:58 PM

Remove stray white spaces.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/*
2 * raw_execption.h
3 *
4 *          This file contains implementation of C function to
5 *          Instantiate mpc5xx primary exception entries.
6 *          More detailled information can be found on the Motorola
7 *          site and more precisely in the following book:
8 *
9 *              MPC555/MPC556 User's Manual
10 *              Motorola REF : MPC555UM/D Rev. 3, 2000 October 15
11 *
12 *
13 *  MPC5xx port sponsored by Defence Research and Development Canada - Suffield
14 *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
15 *
16 *  Derived from libcpu/powerpc/mpc8xx/exceptions/raw_exception.h:
17 *
18 *  Copyright (C) 1999  Eric Valette (valette@crf.canon.fr)
19 *                     Canon Centre Recherche France.
20 *
21 *  The license and distribution terms for this file may be
22 *  found in found in the file LICENSE in this distribution or at
23 *  http://www.rtems.com/license/LICENSE.
24 *
25 *  $Id$
26 */
27
28#ifndef _LIBCPU_MPC5XX_EXCEPTION_RAW_EXCEPTION_H
29#define _LIBCPU_MPC5XX_EXCEPTION_RAW_EXCEPTION_H
30
31#include <libcpu/vectors.h>
32
33/*
34 * Exception Vectors as defined in the MPC555 User's Manual
35 */
36
37#define ASM_RESET_VECTOR        0x01
38#define ASM_MACH_VECTOR         0x02
39
40#define ASM_EXT_VECTOR          0x05
41#define ASM_ALIGN_VECTOR        0x06
42#define ASM_PROG_VECTOR         0x07
43#define ASM_FLOAT_VECTOR        0x08
44#define ASM_DEC_VECTOR          0x09
45
46#define ASM_SYS_VECTOR          0x0C
47#define ASM_TRACE_VECTOR        0x0D
48#define ASM_FLOATASSIST_VECTOR  0x0E
49
50#define ASM_SOFTEMUL_VECTOR     0x10
51
52#define ASM_IPROT_VECTOR        0x13
53#define ASM_DPROT_VECTOR        0x14
54
55#define ASM_DBREAK_VECTOR       0x1C
56#define ASM_IBREAK_VECTOR       0x1D
57#define ASM_MEBREAK_VECTOR      0x1E
58#define ASM_NMEBREAK_VECTOR     0x1F
59
60#define LAST_VALID_EXC          ASM_NMEBREAK_VECTOR
61
62#ifndef ASM
63
64/*
65 * Type definition for raw exceptions.
66 */
67
68typedef unsigned char  rtems_vector;
69struct  __rtems_raw_except_connect_data__;
70typedef unsigned char   rtems_raw_except_hdl_size;
71
72typedef struct {
73  rtems_vector                  vector;
74  rtems_exception_handler_t*    raw_hdl;
75}rtems_raw_except_hdl;
76 
77typedef void (*rtems_raw_except_enable)         (const struct __rtems_raw_except_connect_data__*);
78typedef void (*rtems_raw_except_disable)        (const struct __rtems_raw_except_connect_data__*);
79typedef int  (*rtems_raw_except_is_enabled)     (const struct __rtems_raw_except_connect_data__*);
80
81typedef struct __rtems_raw_except_connect_data__{
82 /*
83  * Exception vector (As defined in the manual)
84  */
85  rtems_vector                  exceptIndex;
86  /*
87   * Exception raw handler. See comment on handler properties below in function prototype.
88   */
89  rtems_raw_except_hdl          hdl;
90  /*
91   * function for enabling raw exceptions. In order to be consistent
92   * with the fact that the raw connexion can defined in the
93   * libcpu library, this library should have no knowledge of
94   * board specific hardware to manage exceptions and thus the
95   * "on" routine must enable the except at processor level only.
96   *
97   */
98    rtems_raw_except_enable     on;     
99  /*
100   * function for disabling raw exceptions. In order to be consistent
101   * with the fact that the raw connexion can defined in the
102   * libcpu library, this library should have no knowledge of
103   * board specific hardware to manage exceptions and thus the
104   * "on" routine must disable the except both at device and PIC level.
105   *
106   */
107  rtems_raw_except_disable      off;
108  /*
109   * function enabling to know what exception may currently occur
110   */
111  rtems_raw_except_is_enabled   isOn;
112}rtems_raw_except_connect_data;
113
114typedef struct {
115  /*
116   * size of all the table fields (*Tbl) described below.
117   */
118  unsigned int                          exceptSize;
119  /*
120   * Default handler used when disconnecting exceptions.
121   */
122  rtems_raw_except_connect_data         defaultRawEntry;
123  /*
124   * Table containing initials/current value.
125   */
126  rtems_raw_except_connect_data*        rawExceptHdlTbl;
127}rtems_raw_except_global_settings;
128
129/*
130 * C callable function enabling to set up one raw idt entry
131 */
132extern int mpc5xx_set_exception (const rtems_raw_except_connect_data*);
133
134/*
135 * C callable function enabling to get one current raw idt entry
136 */
137extern int mpc5xx_get_current_exception (rtems_raw_except_connect_data*);
138
139/*
140 * C callable function enabling to remove one current raw idt entry
141 */
142extern int mpc5xx_delete_exception (const rtems_raw_except_connect_data*);
143
144/*
145 * C callable function enabling to check if vector is valid
146 */
147extern int mpc5xx_vector_is_valid(rtems_vector vector);
148
149inline static  void* mpc5xx_get_vector_addr(rtems_vector vector)
150{
151  return ((void*)  (((unsigned) vector) << 8));
152}
153/*
154 * Exception global init.
155 */
156extern int mpc5xx_init_exceptions (rtems_raw_except_global_settings* config);
157extern int mpc5xx_get_exception_config (rtems_raw_except_global_settings** config);
158
159# endif /* ASM */
160
161#define SIZEOF_
162
163#endif
Note: See TracBrowser for help on using the repository browser.