source: rtems/c/src/lib/libcpu/powerpc/mpc8260/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: 5.6 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 *  Modified Andy Dachs <a.dachs@sstl.co.uk>
17 *  Surrey Satellite Technology Limited (SSTL), 2001
18 *  for MPC8260
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.rtems.com/license/LICENSE.
23 *
24 * $Id$
25 */
26
27#ifndef _LIBCPU_MPC8XX_EXCEPTION_RAW_EXCEPTION_H
28#define _LIBCPU_MPC8XX_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_ITLBMISS_VECTOR     0x10
49#define ASM_DTLBLMISS_VECTOR    0x11
50#define ASM_DTLBSMISS_VECTOR    0x12
51#define ASM_IBREAK_VECTOR       0x13
52#define ASM_SYSMANAGE_VECTOR    0x14
53
54#define LAST_VALID_EXC          ASM_SYSMANAGE_VECTOR
55
56/*
57 * Vector offsets as defined in the MPC8260 manual
58 */
59
60#define ASM_RESET_VECTOR_OFFSET         (ASM_RESET_VECTOR << 8)
61#define ASM_MACH_VECTOR_OFFSET          (ASM_MACH_VECTOR  << 8)
62#define ASM_PROT_VECTOR_OFFSET          (ASM_PROT_VECTOR  << 8)
63#define ASM_ISI_VECTOR_OFFSET           (ASM_ISI_VECTOR   << 8)
64#define ASM_EXT_VECTOR_OFFSET           (ASM_EXT_VECTOR   << 8)
65#define ASM_ALIGN_VECTOR_OFFSET         (ASM_ALIGN_VECTOR << 8)
66#define ASM_PROG_VECTOR_OFFSET          (ASM_PROG_VECTOR  << 8)
67#define ASM_FLOAT_VECTOR_OFFSET         (ASM_FLOAT_VECTOR << 8)
68#define ASM_DEC_VECTOR_OFFSET           (ASM_DEC_VECTOR   << 8)
69
70#define ASM_SYS_VECTOR_OFFSET           (ASM_SYS_VECTOR   << 8)
71#define ASM_TRACE_VECTOR_OFFSET         (ASM_TRACE_VECTOR << 8)
72#define ASM_FLOATASSIST_VECTOR_OFFSET   (ASM_FLOATASSIST_VECTOR << 8)
73
74#define ASM_ITLBMISS_VECTOR_OFFSET      (ASM_ITLBMISS_VECTOR << 8)
75#define ASM_DTLBLMISS_VECTOR_OFFSET     (ASM_DTLBLMISS_VECTOR << 8)
76#define ASM_DTLBSMISS_VECTOR_OFFSET     (ASM_DTLBSMISS_VECTOR << 8)
77
78#define ASM_IBREAK_VECTOR_OFFSET        (ASM_IBREAK_VECTOR << 8)
79#define ASM_SYSMANAGE_VECTOR_OFFSET     (ASM_SYSMANAGE_VECTOR << 8)
80
81#ifndef ASM
82
83/*
84 * Type definition for raw exceptions.
85 */
86
87typedef unsigned char  rtems_vector;
88struct  __rtems_raw_except_connect_data__;
89typedef void            (*rtems_raw_except_func)                (void);
90typedef unsigned char   rtems_raw_except_hdl_size;
91
92typedef struct {
93  rtems_vector                  vector;
94  rtems_raw_except_func         raw_hdl;
95  rtems_raw_except_hdl_size     raw_hdl_size;
96}rtems_raw_except_hdl;
97 
98typedef void (*rtems_raw_except_enable)         (const struct __rtems_raw_except_connect_data__*);
99typedef void (*rtems_raw_except_disable)        (const struct __rtems_raw_except_connect_data__*);
100typedef int  (*rtems_raw_except_is_enabled)     (const struct __rtems_raw_except_connect_data__*);
101
102typedef struct __rtems_raw_except_connect_data__{
103 /*
104  * Exception vector (As defined in the manual)
105  */
106  rtems_vector                  exceptIndex;
107  /*
108   * Exception raw handler. See comment on handler properties below in function prototype.
109   */
110  rtems_raw_except_hdl          hdl;
111  /*
112   * function for enabling raw exceptions. In order to be consistent
113   * with the fact that the raw connexion can defined in the
114   * libcpu library, this library should have no knowledge of
115   * board specific hardware to manage exceptions and thus the
116   * "on" routine must enable the except at processor level only.
117   *
118   */
119    rtems_raw_except_enable     on;     
120  /*
121   * function for disabling raw exceptions. In order to be consistent
122   * with the fact that the raw connexion can defined in the
123   * libcpu library, this library should have no knowledge of
124   * board specific hardware to manage exceptions and thus the
125   * "on" routine must disable the except both at device and PIC level.
126   *
127   */
128  rtems_raw_except_disable      off;
129  /*
130   * function enabling to know what exception may currently occur
131   */
132  rtems_raw_except_is_enabled   isOn;
133}rtems_raw_except_connect_data;
134
135typedef struct {
136  /*
137   * size of all the table fields (*Tbl) described below.
138   */
139  unsigned int                          exceptSize;
140  /*
141   * Default handler used when disconnecting exceptions.
142   */
143  rtems_raw_except_connect_data         defaultRawEntry;
144  /*
145   * Table containing initials/current value.
146   */
147  rtems_raw_except_connect_data*        rawExceptHdlTbl;
148}rtems_raw_except_global_settings;
149
150/*
151 * C callable function enabling to set up one raw idt entry
152 */
153extern int mpc8xx_set_exception (const rtems_raw_except_connect_data*);
154
155/*
156 * C callable function enabling to get one current raw idt entry
157 */
158extern int mpc8xx_get_current_exception (rtems_raw_except_connect_data*);
159
160/*
161 * C callable function enabling to remove one current raw idt entry
162 */
163extern int mpc8xx_delete_exception (const rtems_raw_except_connect_data*);
164
165/*
166 * C callable function enabling to check if vector is valid
167 */
168extern int mpc8xx_vector_is_valid(rtems_vector vector);
169
170inline static  void* mpc8xx_get_vector_addr(rtems_vector vector)
171{
172  return ((void*)  (((unsigned) vector) << 8));
173}
174/*
175 * Exception global init.
176 */
177extern int mpc8xx_init_exceptions (rtems_raw_except_global_settings* config);
178extern int mpc8xx_get_exception_config (rtems_raw_except_global_settings** config);
179
180# endif /* ASM */
181
182#endif
Note: See TracBrowser for help on using the repository browser.