| 1 |
/* |
| 2 |
* Cisco router simulation platform. |
| 3 |
* Copyright (c) 2006 Christophe Fillot ([email protected]) |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef __PPC32_MEM_H__ |
| 7 |
#define __PPC32_MEM_H__ |
| 8 |
|
| 9 |
/* Initialize the MTS subsystem for the specified CPU */ |
| 10 |
int ppc32_mem_init(cpu_ppc_t *cpu); |
| 11 |
|
| 12 |
/* Free memory used by MTS */ |
| 13 |
void ppc32_mem_shutdown(cpu_ppc_t *cpu); |
| 14 |
|
| 15 |
/* Invalidate the MTS caches (instruction and data) */ |
| 16 |
void ppc32_mem_invalidate_cache(cpu_ppc_t *cpu); |
| 17 |
|
| 18 |
/* Set a BAT register */ |
| 19 |
int ppc32_set_bat(cpu_ppc_t *cpu,struct ppc32_bat_prog *bp); |
| 20 |
|
| 21 |
/* Load BAT registers from a BAT array */ |
| 22 |
void ppc32_load_bat_array(cpu_ppc_t *cpu,struct ppc32_bat_prog *bp); |
| 23 |
|
| 24 |
/* Get the host address for SDR1 */ |
| 25 |
int ppc32_set_sdr1(cpu_ppc_t *cpu,m_uint32_t sdr1); |
| 26 |
|
| 27 |
/* Initialize the page table */ |
| 28 |
int ppc32_init_page_table(cpu_ppc_t *cpu); |
| 29 |
|
| 30 |
/* Map a page */ |
| 31 |
int ppc32_map_page(cpu_ppc_t *cpu,u_int vsid,m_uint32_t vaddr,m_uint64_t paddr, |
| 32 |
u_int wimg,u_int pp); |
| 33 |
|
| 34 |
/* Map a memory zone */ |
| 35 |
int ppc32_map_zone(cpu_ppc_t *cpu,u_int vsid,m_uint32_t vaddr,m_uint64_t paddr, |
| 36 |
m_uint32_t size,u_int wimg,u_int pp); |
| 37 |
|
| 38 |
/* Get a BAT SPR */ |
| 39 |
m_uint32_t ppc32_get_bat_spr(cpu_ppc_t *cpu,u_int spr); |
| 40 |
|
| 41 |
/* Set a BAT SPR */ |
| 42 |
void ppc32_set_bat_spr(cpu_ppc_t *cpu,u_int spr,m_uint32_t val); |
| 43 |
|
| 44 |
/* Initialize memory access vectors */ |
| 45 |
void ppc32_init_memop_vectors(cpu_ppc_t *cpu); |
| 46 |
|
| 47 |
/* Restart the memory subsystem */ |
| 48 |
int ppc32_mem_restart(cpu_ppc_t *cpu); |
| 49 |
|
| 50 |
#endif |