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

4.104.114.84.95
Last change on this file since 21e1c44 was 21e1c44, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:10

2003-09-04 Joel Sherrill <joel@…>

  • mpc6xx/clock/c_clock.c, mpc6xx/clock/c_clock.h, mpc6xx/exceptions/raw_exception.c, mpc6xx/exceptions/raw_exception.h, mpc6xx/mmu/bat.c, mpc6xx/mmu/bat.h, mpc6xx/mmu/mmuAsm.S, mpc6xx/timer/timer.c, mpc8260/clock/clock.c, mpc8260/console-generic/console-generic.c, mpc8260/cpm/brg.c, mpc8260/exceptions/raw_exception.c, mpc8260/exceptions/raw_exception.h, mpc8260/include/cpm.h, mpc8260/include/mmu.h, mpc8260/mmu/mmu.c, mpc8260/timer/timer.c, mpc8xx/clock/clock.c, mpc8xx/console-generic/console-generic.c, mpc8xx/exceptions/raw_exception.c, mpc8xx/exceptions/raw_exception.h, mpc8xx/include/cpm.h, mpc8xx/include/mmu.h, mpc8xx/mmu/mmu.c, mpc8xx/timer/timer.c, ppc403/clock/clock.c, ppc403/console/console.c.polled, ppc403/timer/timer.c, rtems/powerpc/debugmod.h, shared/include/byteorder.h, shared/include/cpuIdent.c, shared/include/cpuIdent.h, shared/include/io.h, shared/include/mmu.h, shared/include/page.h, shared/include/pgtable.h, shared/include/spr.h: URL for license changed.
  • Property mode set to 100644
File size: 5.3 KB
RevLine 
[acc25ee]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 *
[95273a6]16 * Enhanced by Jay Kulpinski <jskulpin@eng01.gdds.com>
17 * to support 603, 603e, 604, 604e exceptions
18 *
[acc25ee]19 *  The license and distribution terms for this file may be
20 *  found in found in the file LICENSE in this distribution or at
[21e1c44]21 *  http://www.rtems.com/license/LICENSE.
[acc25ee]22 *
23 * $Id$
24 */
25
26#ifndef _LIBCPU_MCP750_EXCEPTION_RAW_EXCEPTION_H
27#define _LIBCPU_MCP750_EXCEPTION_RAW_EXCEPTION_H
28
29/*
30 * Exception Vectors as defined in the MCP750 manual
31 */
32
33#define ASM_RESET_VECTOR        0x01
34#define ASM_MACH_VECTOR         0x02
35#define ASM_PROT_VECTOR         0x03
36#define ASM_ISI_VECTOR          0x04
37#define ASM_EXT_VECTOR          0x05
38#define ASM_ALIGN_VECTOR        0x06
39#define ASM_PROG_VECTOR         0x07
40#define ASM_FLOAT_VECTOR        0x08
41#define ASM_DEC_VECTOR          0x09
42#define ASM_SYS_VECTOR          0x0C
43#define ASM_TRACE_VECTOR        0x0D
[95273a6]44#define ASM_PERFMON_VECTOR      0x0F
45#define ASM_IMISS_VECTOR        0x10
46#define ASM_DLMISS_VECTOR       0x11
47#define ASM_DSMISS_VECTOR       0x12
[acc25ee]48#define ASM_ADDR_VECTOR         0x13
49#define ASM_SYSMGMT_VECTOR      0x14
50#define ASM_ITM_VECTOR          0x17
51#define LAST_VALID_EXC          ASM_ITM_VECTOR
52
53/*
54 * Vector offsets as defined in the MCP750 manual
55 */
56
57#define ASM_RESET_VECTOR_OFFSET         (ASM_RESET_VECTOR << 8)
58#define ASM_MACH_VECTOR_OFFSET          (ASM_MACH_VECTOR  << 8)
59#define ASM_PROT_VECTOR_OFFSET          (ASM_PROT_VECTOR  << 8)
60#define ASM_ISI_VECTOR_OFFSET           (ASM_ISI_VECTOR   << 8)
61#define ASM_EXT_VECTOR_OFFSET           (ASM_EXT_VECTOR   << 8)
62#define ASM_ALIGN_VECTOR_OFFSET         (ASM_ALIGN_VECTOR << 8)
63#define ASM_PROG_VECTOR_OFFSET          (ASM_PROG_VECTOR  << 8)
64#define ASM_FLOAT_VECTOR_OFFSET         (ASM_FLOAT_VECTOR << 8)
65#define ASM_DEC_VECTOR_OFFSET           (ASM_DEC_VECTOR   << 8)
66#define ASM_SYS_VECTOR_OFFSET           (ASM_SYS_VECTOR   << 8)
67#define ASM_TRACE_VECTOR_OFFSET         (ASM_TRACE_VECTOR << 8)
68#define ASM_ADDR_VECTOR_OFFSET          (ASM_ADDR_VECTOR  << 8)
69#define ASM_SYSMGMT_VECTOR_OFFSET       (ASM_SYSMGMT_VECTOR << 8)
70#define ASM_ITM_VECTOR_OFFSET           (ASM_ITM_VECTOR   << 8)
71
72
73#ifndef ASM
74
75/*
76 * Type definition for raw exceptions.
77 */
78
79typedef unsigned char  rtems_vector;
80struct  __rtems_raw_except_connect_data__;
81typedef void            (*rtems_raw_except_func)                (void);
82typedef unsigned char   rtems_raw_except_hdl_size;
83
84typedef struct {
85  rtems_vector                  vector;
86  rtems_raw_except_func         raw_hdl;
87  rtems_raw_except_hdl_size     raw_hdl_size;
88}rtems_raw_except_hdl;
89 
90typedef void (*rtems_raw_except_enable)         (const struct __rtems_raw_except_connect_data__*);
91typedef void (*rtems_raw_except_disable)        (const struct __rtems_raw_except_connect_data__*);
92typedef int  (*rtems_raw_except_is_enabled)     (const struct __rtems_raw_except_connect_data__*);
93
94typedef struct __rtems_raw_except_connect_data__{
95 /*
96  * Exception vector (As defined in the manual)
97  */
98  rtems_vector                  exceptIndex;
99  /*
100   * Exception raw handler. See comment on handler properties below in function prototype.
101   */
102  rtems_raw_except_hdl          hdl;
103  /*
104   * function for enabling raw exceptions. In order to be consistent
105   * with the fact that the raw connexion can defined in the
106   * libcpu library, this library should have no knowledge of
107   * board specific hardware to manage exceptions and thus the
108   * "on" routine must enable the except at processor level only.
109   *
110   */
111    rtems_raw_except_enable     on;     
112  /*
113   * function for disabling raw exceptions. In order to be consistent
114   * with the fact that the raw connexion can defined in the
115   * libcpu library, this library should have no knowledge of
116   * board specific hardware to manage exceptions and thus the
117   * "on" routine must disable the except both at device and PIC level.
118   *
119   */
120  rtems_raw_except_disable      off;
121  /*
122   * function enabling to know what exception may currently occur
123   */
124  rtems_raw_except_is_enabled   isOn;
125}rtems_raw_except_connect_data;
126
127typedef struct {
128  /*
129   * size of all the table fields (*Tbl) described below.
130   */
131  unsigned int                          exceptSize;
132  /*
133   * Default handler used when disconnecting exceptions.
134   */
135  rtems_raw_except_connect_data         defaultRawEntry;
136  /*
137   * Table containing initials/current value.
138   */
139  rtems_raw_except_connect_data*        rawExceptHdlTbl;
140}rtems_raw_except_global_settings;
141
142/*
143 * C callable function enabling to set up one raw idt entry
144 */
145extern int mpc60x_set_exception (const rtems_raw_except_connect_data*);
146
147/*
148 * C callable function enabling to get one current raw idt entry
149 */
150extern int mpc60x_get_current_exception (rtems_raw_except_connect_data*);
151
152/*
153 * C callable function enabling to remove one current raw idt entry
154 */
155extern int mpc60x_delete_exception (const rtems_raw_except_connect_data*);
156
157/*
158 * C callable function enabling to check if vector is valid
159 */
160extern int mpc750_vector_is_valid(rtems_vector vector);
161
162inline static  void* mpc60x_get_vector_addr(rtems_vector vector)
163{
164  return ((void*)  (((unsigned) vector) << 8));
165}
166/*
167 * Exception global init.
168 */
169extern int mpc60x_init_exceptions (rtems_raw_except_global_settings* config);
170extern int mpc60x_get_exception_config (rtems_raw_except_global_settings** config);
171
172# endif /* ASM */
173
174#endif
175
Note: See TracBrowser for help on using the repository browser.