source: rtems/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h @ acc25ee

4.104.114.84.95
Last change on this file since acc25ee was acc25ee, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 2, 1999 at 2:31:19 PM

Merged of mcp750 and mvme2307 BSP by Eric Valette <valette@…>.
As part of this effort, the mpc750 libcpu code is now shared with the
ppc6xx.

  • Property mode set to 100644
File size: 5.1 KB
Line 
1/*
2 * raw_execption.h
3 *
4 *          This file contains implementation of C function to
5 *          Instanciate 60x ppc primary exception entries.
6 *          More detailled information can be found on motorola
7 *          site and more precisely in the following book :
8 *
9 *              MPC750
10 *              Risc Microporcessor User's Manual
11 *              Mtorola REF : MPC750UM/AD 8/97
12 *
13 * Copyright (C) 1999  Eric Valette (valette@crf.canon.fr)
14 *                     Canon Centre Recherche France.
15 *
16 *  The license and distribution terms for this file may be
17 *  found in found in the file LICENSE in this distribution or at
18 *  http://www.OARcorp.com/rtems/license.html.
19 *
20 * $Id$
21 */
22
23#ifndef _LIBCPU_MCP750_EXCEPTION_RAW_EXCEPTION_H
24#define _LIBCPU_MCP750_EXCEPTION_RAW_EXCEPTION_H
25
26/*
27 * Exception Vectors as defined in the MCP750 manual
28 */
29
30#define ASM_RESET_VECTOR        0x01
31#define ASM_MACH_VECTOR         0x02
32#define ASM_PROT_VECTOR         0x03
33#define ASM_ISI_VECTOR          0x04
34#define ASM_EXT_VECTOR          0x05
35#define ASM_ALIGN_VECTOR        0x06
36#define ASM_PROG_VECTOR         0x07
37#define ASM_FLOAT_VECTOR        0x08
38#define ASM_DEC_VECTOR          0x09
39#define ASM_SYS_VECTOR          0x0C
40#define ASM_TRACE_VECTOR        0x0D
41#define ASM_ADDR_VECTOR         0x13
42#define ASM_SYSMGMT_VECTOR      0x14
43#define ASM_ITM_VECTOR          0x17
44#define LAST_VALID_EXC          ASM_ITM_VECTOR
45
46/*
47 * Vector offsets as defined in the MCP750 manual
48 */
49
50#define ASM_RESET_VECTOR_OFFSET         (ASM_RESET_VECTOR << 8)
51#define ASM_MACH_VECTOR_OFFSET          (ASM_MACH_VECTOR  << 8)
52#define ASM_PROT_VECTOR_OFFSET          (ASM_PROT_VECTOR  << 8)
53#define ASM_ISI_VECTOR_OFFSET           (ASM_ISI_VECTOR   << 8)
54#define ASM_EXT_VECTOR_OFFSET           (ASM_EXT_VECTOR   << 8)
55#define ASM_ALIGN_VECTOR_OFFSET         (ASM_ALIGN_VECTOR << 8)
56#define ASM_PROG_VECTOR_OFFSET          (ASM_PROG_VECTOR  << 8)
57#define ASM_FLOAT_VECTOR_OFFSET         (ASM_FLOAT_VECTOR << 8)
58#define ASM_DEC_VECTOR_OFFSET           (ASM_DEC_VECTOR   << 8)
59#define ASM_SYS_VECTOR_OFFSET           (ASM_SYS_VECTOR   << 8)
60#define ASM_TRACE_VECTOR_OFFSET         (ASM_TRACE_VECTOR << 8)
61#define ASM_ADDR_VECTOR_OFFSET          (ASM_ADDR_VECTOR  << 8)
62#define ASM_SYSMGMT_VECTOR_OFFSET       (ASM_SYSMGMT_VECTOR << 8)
63#define ASM_ITM_VECTOR_OFFSET           (ASM_ITM_VECTOR   << 8)
64
65
66#ifndef ASM
67
68/*
69 * Type definition for raw exceptions.
70 */
71
72typedef unsigned char  rtems_vector;
73struct  __rtems_raw_except_connect_data__;
74typedef void            (*rtems_raw_except_func)                (void);
75typedef unsigned char   rtems_raw_except_hdl_size;
76
77typedef struct {
78  rtems_vector                  vector;
79  rtems_raw_except_func         raw_hdl;
80  rtems_raw_except_hdl_size     raw_hdl_size;
81}rtems_raw_except_hdl;
82 
83typedef void (*rtems_raw_except_enable)         (const struct __rtems_raw_except_connect_data__*);
84typedef void (*rtems_raw_except_disable)        (const struct __rtems_raw_except_connect_data__*);
85typedef int  (*rtems_raw_except_is_enabled)     (const struct __rtems_raw_except_connect_data__*);
86
87typedef struct __rtems_raw_except_connect_data__{
88 /*
89  * Exception vector (As defined in the manual)
90  */
91  rtems_vector                  exceptIndex;
92  /*
93   * Exception raw handler. See comment on handler properties below in function prototype.
94   */
95  rtems_raw_except_hdl          hdl;
96  /*
97   * function for enabling raw exceptions. In order to be consistent
98   * with the fact that the raw connexion can defined in the
99   * libcpu library, this library should have no knowledge of
100   * board specific hardware to manage exceptions and thus the
101   * "on" routine must enable the except at processor level only.
102   *
103   */
104    rtems_raw_except_enable     on;     
105  /*
106   * function for disabling raw exceptions. In order to be consistent
107   * with the fact that the raw connexion can defined in the
108   * libcpu library, this library should have no knowledge of
109   * board specific hardware to manage exceptions and thus the
110   * "on" routine must disable the except both at device and PIC level.
111   *
112   */
113  rtems_raw_except_disable      off;
114  /*
115   * function enabling to know what exception may currently occur
116   */
117  rtems_raw_except_is_enabled   isOn;
118}rtems_raw_except_connect_data;
119
120typedef struct {
121  /*
122   * size of all the table fields (*Tbl) described below.
123   */
124  unsigned int                          exceptSize;
125  /*
126   * Default handler used when disconnecting exceptions.
127   */
128  rtems_raw_except_connect_data         defaultRawEntry;
129  /*
130   * Table containing initials/current value.
131   */
132  rtems_raw_except_connect_data*        rawExceptHdlTbl;
133}rtems_raw_except_global_settings;
134
135/*
136 * C callable function enabling to set up one raw idt entry
137 */
138extern int mpc60x_set_exception (const rtems_raw_except_connect_data*);
139
140/*
141 * C callable function enabling to get one current raw idt entry
142 */
143extern int mpc60x_get_current_exception (rtems_raw_except_connect_data*);
144
145/*
146 * C callable function enabling to remove one current raw idt entry
147 */
148extern int mpc60x_delete_exception (const rtems_raw_except_connect_data*);
149
150/*
151 * C callable function enabling to check if vector is valid
152 */
153extern int mpc750_vector_is_valid(rtems_vector vector);
154
155inline static  void* mpc60x_get_vector_addr(rtems_vector vector)
156{
157  return ((void*)  (((unsigned) vector) << 8));
158}
159/*
160 * Exception global init.
161 */
162extern int mpc60x_init_exceptions (rtems_raw_except_global_settings* config);
163extern int mpc60x_get_exception_config (rtems_raw_except_global_settings** config);
164
165# endif /* ASM */
166
167#endif
168
Note: See TracBrowser for help on using the repository browser.