OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [powerpc/] [arch/] [v2_0/] [include/] [ppc_regs.h] - Blame information for rev 249

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_HAL_PPC_REGS_H
2
#define CYGONCE_HAL_PPC_REGS_H
3
 
4
//==========================================================================
5
//
6
//      ppc_regs.h
7
//
8
//      PowerPC CPU definitions
9
//
10
//==========================================================================
11
//####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later version.
19
//
20
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
22
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
23
// for more details.
24
//
25
// You should have received a copy of the GNU General Public License along
26
// with eCos; if not, write to the Free Software Foundation, Inc.,
27
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28
//
29
// As a special exception, if other files instantiate templates or use macros
30
// or inline functions from this file, or you compile this file and link it
31
// with other works to produce a work based on this file, this file does not
32
// by itself cause the resulting work to be covered by the GNU General Public
33
// License. However the source code for this file must still be made available
34
// in accordance with section (3) of the GNU General Public License.
35
//
36
// This exception does not invalidate any other reasons why a work based on
37
// this file might be covered by the GNU General Public License.
38
//
39
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40
// at http://sources.redhat.com/ecos/ecos-license/
41
// -------------------------------------------
42
//####ECOSGPLCOPYRIGHTEND####
43
//==========================================================================
44
//#####DESCRIPTIONBEGIN####
45
//
46
// Author(s):    jskov
47
// Contributors: jskov
48
// Date:         1999-02-19
49
// Purpose:      Provide PPC register definitions
50
// Description:  Provide PPC register definitions
51
//               The short difinitions (sans CYGARC_REG_) are exported only
52
//               if CYGARC_HAL_COMMON_EXPORT_CPU_MACROS is defined.
53
// Usage:
54
//               #include <cyg/hal/ppc_regs.h>
55
//               ...
56
//              
57
//
58
//####DESCRIPTIONEND####
59
//
60
//==========================================================================
61
 
62
#include <pkgconf/hal.h>
63
 
64
#include <cyg/hal/var_regs.h>
65
 
66
//--------------------------------------------------------------------------
67
// SPR access macros.
68
#define CYGARC_MTSPR(_spr_, _v_) \
69
    asm volatile ("mtspr %0, %1;" :: "I" (_spr_), "r" (_v_));
70
#define CYGARC_MFSPR(_spr_, _v_) \
71
    asm volatile ("mfspr %0, %1;" : "=r" (_v_) : "I" (_spr_));
72
 
73
//--------------------------------------------------------------------------
74
// TB access macros.
75
#define CYGARC_MTTB(_tbr_, _v_) \
76
    asm volatile ("mttb %0, %1;" :: "I" (_tbr_), "r" (_v_));
77
#define CYGARC_MFTB(_tbr_, _v_) \
78
    asm volatile ("mftb %0, %1;" : "=r" (_v_) : "I" (_tbr_));
79
 
80
//--------------------------------------------------------------------------
81
// Generic PowerPC Family Definitions
82
//--------------------------------------------------------------------------
83
 
84
//--------------------------------------------------------------------------
85
// Some SPRs
86
#define CYGARC_REG_DSISR    18
87
#define CYGARC_REG_DAR      19
88
#define CYGARC_REG_DEC      22
89
#define CYGARC_REG_SRR0     26
90
#define CYGARC_REG_SRR1     27
91
#define CYGARC_REG_SPRG0   272
92
#define CYGARC_REG_SPRG1   273
93
#define CYGARC_REG_SPRG2   274
94
#define CYGARC_REG_SPRG3   275
95
#define CYGARC_REG_PVR     287
96
 
97
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
98
#define DSISR      CYGARC_REG_DSISR
99
#define DAR        CYGARC_REG_DAR
100
#define DEC        CYGARC_REG_DEC
101
#define SRR0       CYGARC_REG_SRR0
102
#define SRR1       CYGARC_REG_SRR1
103
#define SPRG0      CYGARC_REG_SPRG0
104
#define SPRG1      CYGARC_REG_SPRG1
105
#define SPRG2      CYGARC_REG_SPRG2
106
#define SPRG3      CYGARC_REG_SPRG3
107
#define PVR        CYGARC_REG_PVR
108
#endif
109
 
110
//--------------------------------------------------------------------------
111
// MSR bits
112
#define CYGARC_REG_MSR_LE       0x00000001   // little-endian mode enable
113
#define CYGARC_REG_MSR_RI       0x00000002   // recoverable exception
114
#define CYGARC_REG_MSR_DR       0x00000010   // data address translation
115
#define CYGARC_REG_MSR_IR       0x00000020   // instruction address translation
116
#define CYGARC_REG_MSR_IP       0x00000040   // exception prefix
117
#define CYGARC_REG_MSR_FE1      0x00000100   // floating-point exception mode 1
118
#define CYGARC_REG_MSR_BE       0x00000200   // branch trace enable
119
#define CYGARC_REG_MSR_SE       0x00000400   // single-step trace enable
120
#define CYGARC_REG_MSR_FE0      0x00000800   // floating-point exception mode 0
121
#define CYGARC_REG_MSR_ME       0x00001000   // machine check enable
122
#define CYGARC_REG_MSR_FP       0x00002000   // floating-point available
123
#define CYGARC_REG_MSR_PR       0x00004000   // privilege level
124
#define CYGARC_REG_MSR_EE       0x00008000   // external interrupt enable
125
#define CYGARC_REG_MSR_ILE      0x00010000   // exception little-endian mode
126
#define CYGARC_REG_MSR_POW      0x00040000   // power management enable
127
 
128
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
129
#define MSR_LE          CYGARC_REG_MSR_LE 
130
#define MSR_RI          CYGARC_REG_MSR_RI 
131
#define MSR_DR          CYGARC_REG_MSR_DR 
132
#define MSR_IR          CYGARC_REG_MSR_IR 
133
#define MSR_IP          CYGARC_REG_MSR_IP 
134
#define MSR_FE1         CYGARC_REG_MSR_FE1
135
#define MSR_BE          CYGARC_REG_MSR_BE 
136
#define MSR_SE          CYGARC_REG_MSR_SE 
137
#define MSR_FE0         CYGARC_REG_MSR_FE0
138
#define MSR_ME          CYGARC_REG_MSR_ME 
139
#define MSR_FP          CYGARC_REG_MSR_FP 
140
#define MSR_PR          CYGARC_REG_MSR_PR 
141
#define MSR_EE          CYGARC_REG_MSR_EE 
142
#define MSR_ILE         CYGARC_REG_MSR_ILE
143
#define MSR_POW         CYGARC_REG_MSR_POW
144
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
145
 
146
//--------------------------------------------------------------------------
147
// Time Base Registers
148
// READ and WRITE are different addresses!
149
#define CYGARC_REG_TBL_W   284
150
#define CYGARC_REG_TBU_W   285
151
#define CYGARC_REG_TBL_R   268
152
#define CYGARC_REG_TBU_R   269
153
 
154
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
155
#define TBL_W      CYGARC_REG_TBL_W
156
#define TBU_W      CYGARC_REG_TBU_W
157
#define TBL_R      CYGARC_REG_TBL_R
158
#define TBU_R      CYGARC_REG_TBU_R
159
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
160
 
161
//-----------------------------------------------------------------------------
162
#endif // ifdef CYGONCE_HAL_PPC_REGS_H
163
// End of ppc_regs.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.