~ubuntu-branches/ubuntu/lucid/skyeye/lucid-proposed

« back to all changes in this revision

Viewing changes to arch/ppc/common/ppc_mmu.h

  • Committer: Bazaar Package Importer
  • Author(s): Yu Guanghui
  • Date: 2007-08-07 13:25:49 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20070807132549-96159k1obat1fxr0
Tags: 1.2.3-1
* New upstream release
* Added NO_BFD=1, don't require libbfd now. (Closes:Bug#423933) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      PearPC
 
3
 *      ppc_mmu.h
 
4
 *
 
5
 *      Copyright (C) 2003, 2004 Sebastian Biallas (sb@biallas.net)
 
6
 *      Copyright (C) 2004 Daniel Foesch (dfoesch@cs.nmsu.edu)
 
7
 *
 
8
 *      This program is free software; you can redistribute it and/or modify
 
9
 *      it under the terms of the GNU General Public License version 2 as
 
10
 *      published by the Free Software Foundation.
 
11
 *
 
12
 *      This program is distributed in the hope that it will be useful,
 
13
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *      GNU General Public License for more details.
 
16
 *
 
17
 *      You should have received a copy of the GNU General Public License
 
18
 *      along with this program; if not, write to the Free Software
 
19
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 */
 
21
 
 
22
#ifndef __PPC_MMU_H__
 
23
#define __PPC_MMU_H__
 
24
 
 
25
#include "types.h"
 
26
 
 
27
extern byte *gMemory;
 
28
extern uint32 gMemorySize;
 
29
 
 
30
#define PPC_MMU_READ  1
 
31
#define PPC_MMU_WRITE 2
 
32
#define PPC_MMU_CODE  4
 
33
#define PPC_MMU_SV    8
 
34
#define PPC_MMU_NO_EXC 16
 
35
 
 
36
#define PPC_MMU_OK 0
 
37
#define PPC_MMU_EXC 1
 
38
#define PPC_MMU_FATAL 2
 
39
 
 
40
int FASTCALL ppc_effective_to_physical(uint32 addr, int flags, uint32 *result);
 
41
bool FASTCALL ppc_mmu_set_sdr1(uint32 newval, bool quiesce);
 
42
void ppc_mmu_tlb_invalidate();
 
43
 
 
44
int FASTCALL ppc_read_physical_dword(uint32 addr, uint64 *result);
 
45
int FASTCALL ppc_read_physical_word(uint32 addr, uint32 *result);
 
46
int FASTCALL ppc_read_physical_half(uint32 addr, uint16 *result);
 
47
int FASTCALL ppc_read_physical_byte(uint32 addr, uint8 *result);
 
48
 
 
49
int FASTCALL ppc_read_effective_code(uint32 addr, uint32 *result);
 
50
int FASTCALL ppc_read_effective_dword(uint32 addr, uint64 *result);
 
51
int FASTCALL ppc_read_effective_word(uint32 addr, uint32 *result);
 
52
int FASTCALL ppc_read_effective_half(uint32 addr, uint16 *result);
 
53
int FASTCALL ppc_read_effective_byte(uint32 addr, uint8 *result);
 
54
 
 
55
int FASTCALL ppc_write_physical_dword(uint32 addr, uint64 data);
 
56
int FASTCALL ppc_write_physical_word(uint32 addr, uint32 data);
 
57
int FASTCALL ppc_write_physical_half(uint32 addr, uint16 data);
 
58
int FASTCALL ppc_write_physical_byte(uint32 addr, uint8 data);
 
59
 
 
60
int FASTCALL ppc_write_effective_dword(uint32 addr, uint64 data);
 
61
int FASTCALL ppc_write_effective_word(uint32 addr, uint32 data);
 
62
int FASTCALL ppc_write_effective_half(uint32 addr, uint16 data);
 
63
int FASTCALL ppc_write_effective_byte(uint32 addr, uint8 data);
 
64
 
 
65
int FASTCALL ppc_direct_physical_memory_handle(uint32 addr, byte *ptr);
 
66
int FASTCALL ppc_direct_effective_memory_handle(uint32 addr, byte *ptr);
 
67
int FASTCALL ppc_direct_effective_memory_handle_code(uint32 addr, byte *ptr);
 
68
bool FASTCALL ppc_mmu_page_create(uint32 ea, uint32 pa);
 
69
bool FASTCALL ppc_mmu_page_free(uint32 ea);
 
70
bool FASTCALL ppc_init_physical_memory(uint size);
 
71
 
 
72
/*
 
73
pte: (page table entry)
 
74
1st word:
 
75
0     V    Valid
 
76
1-24  VSID Virtual Segment ID
 
77
25    H    Hash function
 
78
26-31 API  Abbreviated page index
 
79
2nd word:
 
80
0-19  RPN  Physical page number
 
81
20-22 res
 
82
23    R    Referenced bit
 
83
24    C    Changed bit
 
84
25-28 WIMG Memory/cache control bits
 
85
29    res
 
86
30-31 PP   Page protection bits
 
87
*/
 
88
 
 
89
/*
 
90
 *      MMU Opcodes
 
91
 */
 
92
void ppc_opc_dcbz();
 
93
void ppc_opc_dcbtls();
 
94
 
 
95
void ppc_opc_lbz();
 
96
void ppc_opc_lbzu();
 
97
void ppc_opc_lbzux();
 
98
void ppc_opc_lbzx();
 
99
void ppc_opc_lfd();
 
100
void ppc_opc_lfdu();
 
101
void ppc_opc_lfdux();
 
102
void ppc_opc_lfdx();
 
103
void ppc_opc_lfs();
 
104
void ppc_opc_lfsu();
 
105
void ppc_opc_lfsux();
 
106
void ppc_opc_lfsx();
 
107
void ppc_opc_lha();
 
108
void ppc_opc_lhau();
 
109
void ppc_opc_lhaux();
 
110
void ppc_opc_lhax();
 
111
void ppc_opc_lhbrx();
 
112
void ppc_opc_lhz();
 
113
void ppc_opc_lhzu();
 
114
void ppc_opc_lhzux();
 
115
void ppc_opc_lhzx();
 
116
void ppc_opc_lmw();
 
117
void ppc_opc_lswi();
 
118
void ppc_opc_lswx();
 
119
void ppc_opc_lwarx();
 
120
void ppc_opc_lwbrx();
 
121
void ppc_opc_lwz();
 
122
void ppc_opc_lwzu();
 
123
void ppc_opc_lwzux();
 
124
void ppc_opc_lwzx();
 
125
void ppc_opc_lvx();             /* for altivec support */
 
126
void ppc_opc_lvxl();
 
127
void ppc_opc_lvebx();
 
128
void ppc_opc_lvehx();
 
129
void ppc_opc_lvewx();
 
130
void ppc_opc_lvsl();
 
131
void ppc_opc_lvsr();
 
132
void ppc_opc_dst();
 
133
 
 
134
void ppc_opc_stb();
 
135
void ppc_opc_stbu();
 
136
void ppc_opc_stbux();
 
137
void ppc_opc_stbx();
 
138
void ppc_opc_stfd();
 
139
void ppc_opc_stfdu();
 
140
void ppc_opc_stfdux();
 
141
void ppc_opc_stfdx();
 
142
void ppc_opc_stfiwx();
 
143
void ppc_opc_stfs();
 
144
void ppc_opc_stfsu();
 
145
void ppc_opc_stfsux();
 
146
void ppc_opc_stfsx();
 
147
void ppc_opc_sth();
 
148
void ppc_opc_sthbrx();
 
149
void ppc_opc_sthu();
 
150
void ppc_opc_sthux();
 
151
void ppc_opc_sthx();
 
152
void ppc_opc_stmw();
 
153
void ppc_opc_stswi();
 
154
void ppc_opc_stswx();
 
155
void ppc_opc_stw();
 
156
void ppc_opc_stwbrx();
 
157
void ppc_opc_stwcx_();
 
158
void ppc_opc_stwu();
 
159
void ppc_opc_stwux();
 
160
void ppc_opc_stwx();
 
161
void ppc_opc_stvx();            /* for altivec support */
 
162
void ppc_opc_stvxl();
 
163
void ppc_opc_stvebx();
 
164
void ppc_opc_stvehx();
 
165
void ppc_opc_stvewx();
 
166
void ppc_opc_dstst();
 
167
void ppc_opc_dss();
 
168
void ppc_opc_tlbivax();
 
169
void ppc_opc_tlbwe();
 
170
 
 
171
#endif
 
172