5
* Copyright (C) 2003, 2004 Sebastian Biallas (sb@biallas.net)
6
* Copyright (C) 2004 Daniel Foesch (dfoesch@cs.nmsu.edu)
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.
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.
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.
28
extern uint32 gMemorySize;
30
#define PPC_MMU_READ 1
31
#define PPC_MMU_WRITE 2
32
#define PPC_MMU_CODE 4
34
#define PPC_MMU_NO_EXC 16
38
#define PPC_MMU_FATAL 2
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();
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);
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);
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);
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);
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);
73
pte: (page table entry)
76
1-24 VSID Virtual Segment ID
78
26-31 API Abbreviated page index
80
0-19 RPN Physical page number
84
25-28 WIMG Memory/cache control bits
86
30-31 PP Page protection bits
93
void ppc_opc_dcbtls();
101
void ppc_opc_lfdux();
105
void ppc_opc_lfsux();
109
void ppc_opc_lhaux();
111
void ppc_opc_lhbrx();
114
void ppc_opc_lhzux();
119
void ppc_opc_lwarx();
120
void ppc_opc_lwbrx();
123
void ppc_opc_lwzux();
125
void ppc_opc_lvx(); /* for altivec support */
127
void ppc_opc_lvebx();
128
void ppc_opc_lvehx();
129
void ppc_opc_lvewx();
136
void ppc_opc_stbux();
139
void ppc_opc_stfdu();
140
void ppc_opc_stfdux();
141
void ppc_opc_stfdx();
142
void ppc_opc_stfiwx();
144
void ppc_opc_stfsu();
145
void ppc_opc_stfsux();
146
void ppc_opc_stfsx();
148
void ppc_opc_sthbrx();
150
void ppc_opc_sthux();
153
void ppc_opc_stswi();
154
void ppc_opc_stswx();
156
void ppc_opc_stwbrx();
157
void ppc_opc_stwcx_();
159
void ppc_opc_stwux();
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();
168
void ppc_opc_tlbivax();
169
void ppc_opc_tlbwe();