source: rtems/c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.h @ 0aee2be5

4.104.114.84.95
Last change on this file since 0aee2be5 was 0aee2be5, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 8, 2004 at 3:36:03 PM

2004-03-08 Ralf Corsepius <corsepiu@…>

  • mpc5xx/.cvsignore, mpc5xx/Makefile.am: New.
  • mpc5xx/exceptions/asm_utils.S, mpc5xx/exceptions/raw_exception.c, mpc5xx/exceptions/raw_exception.h, mpc5xx/ictrl/ictrl.c, mpc5xx/ictrl/ictrl.h, mpc5xx/timer/timer.c: New (Submission from Wilfried Busalski <w.busalski@…>).
  • Property mode set to 100644
File size: 5.8 KB
Line 
1/*
2 * raw_execption.h
3 *
4 *          This file contains implementation of C function to
5 *          Instanciate 8xx ppc primary exception entries.
6 *          More detailled information can be found on motorola
7 *          site and more precisely in the following book :
8 *
9 *              MPC860
10 *              Risc Microporcessor User's Manual
11 *              Motorola REF : MPC860UM/AD 07/98 Rev .1
12 *
13 * Copyright (C) 1999  Eric Valette (valette@crf.canon.fr)
14 *                     Canon Centre Recherche France.
15 *
16 * Changes for MPC5XX Wilfried Busalski (w.busalski@lancier-monitoring.de)
17 * Copyright (C) 2003 Lancier Monitoring GmbH
18 
19 *
20 *  The license and distribution terms for this file may be
21 *  found in found in the file LICENSE in this distribution or at
22 *  http://www.OARcorp.com/rtems/license.html.
23 *
24 * raw_exception.h,v 1.1 2001/04/06 15:54:18 joel Exp
25 */
26
27#ifndef _LIBCPU_MPC5XX_EXCEPTION_RAW_EXCEPTION_H
28#define _LIBCPU_MPC5XX_EXCEPTION_RAW_EXCEPTION_H
29
30/*
31 * Exception Vectors as defined in the MCP750 manual
32 */
33
34#define ASM_RESET_VECTOR                0x01
35#define ASM_MACH_VECTOR                 0x02
36#define ASM_PROT_VECTOR                 0x03
37#define ASM_ISI_VECTOR                  0x04
38#define ASM_EXT_VECTOR                  0x05
39#define ASM_ALIGN_VECTOR                0x06
40#define ASM_PROG_VECTOR                 0x07
41#define ASM_FLOAT_VECTOR                0x08
42#define ASM_DEC_VECTOR                  0x09
43
44#define ASM_SYS_VECTOR                  0x0C
45#define ASM_TRACE_VECTOR                0x0D
46#define ASM_FLOATASSIST_VECTOR  0x0E
47
48#define ASM_SOFTEMUL_VECTOR             0x10
49
50#define ASM_ITLBERROR_VECTOR    0x13
51#define ASM_DTLBERROR_VECTOR    0x14
52
53#define ASM_DBREAK_VECTOR               0x1C
54#define ASM_IBREAK_VECTOR               0x1D
55#define ASM_PERIFBREAK_VECTOR   0x1E
56#define ASM_DEVPORT_VECTOR              0x1F
57
58#define LAST_VALID_EXC          ASM_DEVPORT_VECTOR
59
60/*
61 * Vector offsets as defined in the MPC860 manual
62 */
63
64#define ASM_RESET_VECTOR_OFFSET                 (ASM_RESET_VECTOR << 8)
65#define ASM_MACH_VECTOR_OFFSET                  (ASM_MACH_VECTOR  << 8)
66#define ASM_PROT_VECTOR_OFFSET                  (ASM_PROT_VECTOR  << 8)
67#define ASM_ISI_VECTOR_OFFSET                   (ASM_ISI_VECTOR   << 8)
68#define ASM_EXT_VECTOR_OFFSET                   (ASM_EXT_VECTOR   << 8)
69#define ASM_ALIGN_VECTOR_OFFSET                 (ASM_ALIGN_VECTOR << 8)
70#define ASM_PROG_VECTOR_OFFSET                  (ASM_PROG_VECTOR  << 8)
71#define ASM_FLOAT_VECTOR_OFFSET                 (ASM_FLOAT_VECTOR << 8)
72#define ASM_DEC_VECTOR_OFFSET                   (ASM_DEC_VECTOR   << 8)
73
74#define ASM_SYS_VECTOR_OFFSET                   (ASM_SYS_VECTOR   << 8)
75#define ASM_TRACE_VECTOR_OFFSET                 (ASM_TRACE_VECTOR << 8)
76#define ASM_FLOATASSIST_VECTOR_OFFSET   (ASM_FLOATASSIST_VECTOR << 8)
77
78#define ASM_SOFTEMUL_VECTOR_OFFSET              (ASM_SOFTEMUL_VECTOR << 8)
79
80#define ASM_ITLBERROR_VECTOR_OFFSET             (ASM_ITLBERROR_VECTOR << 8)
81#define ASM_DTLBERROR_VECTOR_OFFSET             (ASM_DTLBERROR_VECTOR << 8)
82
83#define ASM_DBREAK_VECTOR_OFFSET                (ASM_DBREAK_VECTOR << 8)
84#define ASM_IBREAK_VECTOR_OFFSET                (ASM_IBREAK_VECTOR << 8)
85#define ASM_PERIFBREAK_VECTOR_OFFSET    (ASM_PERIFBREAK_VECTOR << 8)
86#define ASM_DEVPORT_VECTOR_OFFSET               (ASM_DEVPORT_VECTOR_OFFSET << 8)
87
88#ifndef ASM
89
90/*
91 * Type definition for raw exceptions.
92 */
93
94typedef unsigned char  rtems_vector;
95struct  __rtems_raw_except_connect_data__;
96typedef void            (*rtems_raw_except_func)                (void);
97typedef unsigned char   rtems_raw_except_hdl_size;
98
99typedef struct {
100  rtems_vector                  vector;
101  rtems_raw_except_func         raw_hdl;
102  rtems_raw_except_hdl_size     raw_hdl_size;
103}rtems_raw_except_hdl;
104 
105typedef void (*rtems_raw_except_enable)         (const struct __rtems_raw_except_connect_data__*);
106typedef void (*rtems_raw_except_disable)        (const struct __rtems_raw_except_connect_data__*);
107typedef int  (*rtems_raw_except_is_enabled)     (const struct __rtems_raw_except_connect_data__*);
108
109typedef struct __rtems_raw_except_connect_data__{
110 /*
111  * Exception vector (As defined in the manual)
112  */
113  rtems_vector                  exceptIndex;
114  /*
115   * Exception raw handler. See comment on handler properties below in function prototype.
116   */
117  rtems_raw_except_hdl          hdl;
118  /*
119   * function for enabling raw exceptions. In order to be consistent
120   * with the fact that the raw connexion can defined in the
121   * libcpu library, this library should have no knowledge of
122   * board specific hardware to manage exceptions and thus the
123   * "on" routine must enable the except at processor level only.
124   *
125   */
126    rtems_raw_except_enable     on;     
127  /*
128   * function for disabling raw exceptions. In order to be consistent
129   * with the fact that the raw connexion can defined in the
130   * libcpu library, this library should have no knowledge of
131   * board specific hardware to manage exceptions and thus the
132   * "on" routine must disable the except both at device and PIC level.
133   *
134   */
135  rtems_raw_except_disable      off;
136  /*
137   * function enabling to know what exception may currently occur
138   */
139  rtems_raw_except_is_enabled   isOn;
140}rtems_raw_except_connect_data;
141
142typedef struct {
143  /*
144   * size of all the table fields (*Tbl) described below.
145   */
146  unsigned int                          exceptSize;
147  /*
148   * Default handler used when disconnecting exceptions.
149   */
150  rtems_raw_except_connect_data         defaultRawEntry;
151  /*
152   * Table containing initials/current value.
153   */
154  rtems_raw_except_connect_data*        rawExceptHdlTbl;
155}rtems_raw_except_global_settings;
156
157/*
158 * C callable function enabling to set up one raw idt entry
159 */
160extern int mpc5xx_set_exception (const rtems_raw_except_connect_data*);
161
162/*
163 * C callable function enabling to get one current raw idt entry
164 */
165extern int mpc5xx_get_current_exception (rtems_raw_except_connect_data*);
166
167/*
168 * C callable function enabling to remove one current raw idt entry
169 */
170extern int mpc5xx_delete_exception (const rtems_raw_except_connect_data*);
171
172/*
173 * C callable function enabling to check if vector is valid
174 */
175extern int mpc5xx_vector_is_valid(rtems_vector vector);
176
177inline static  void* mpc5xx_get_vector_addr(rtems_vector vector)
178{
179  return ((void*)  (((unsigned) vector) << 8));
180}
181/*
182 * Exception global init.
183 */
184extern int mpc5xx_init_exceptions (rtems_raw_except_global_settings* config);
185extern int mpc5xx_get_exception_config (rtems_raw_except_global_settings** config);
186
187# endif /* ASM */
188
189#endif
190
Note: See TracBrowser for help on using the repository browser.