/*
* PowerPC CPU initialization for qemu.
*
* Copyright (c) 2003-2007 Jocelyn Mayer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* A lot of PowerPC definition have been included here.
* Most of them are not usable for now but have been kept
* inside "#if defined(TODO) ... #endif" statements to make tests easier.
*/
#include "dis-asm.h"
#include "host-utils.h"
//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
//#define PPC_DUMP_SPR_ACCESSES
#if defined(CONFIG_USER_ONLY)
#define TODO_USER_ONLY 1
#endif
struct ppc_def_t {
const unsigned char *name;
uint32_t pvr;
uint32_t svr;
uint64_t insns_flags;
uint64_t msr_mask;
powerpc_mmu_t mmu_model;
powerpc_excp_t excp_model;
powerpc_input_t bus_model;
uint32_t flags;
int bfd_mach;
void (*init_proc)(CPUPPCState *env);
int (*check_pow)(CPUPPCState *env);
};
/* For user-mode emulation, we don't emulate any IRQ controller */
#if defined(CONFIG_USER_ONLY)
#define PPC_IRQ_INIT_FN(name) \
static inline void glue(glue(ppc, name),_irq_init) (CPUPPCState *env) \
{ \
}
#else
#define PPC_IRQ_INIT_FN(name) \
void glue(glue(ppc, name),_irq_init) (CPUPPCState *env);
#endif
PPC_IRQ_INIT_FN(40x);
PPC_IRQ_INIT_FN(6xx);
PPC_IRQ_INIT_FN(970);
/* Generic callbacks:
* do nothing but store/retrieve spr value
*/
#ifdef PPC_DUMP_SPR_ACCESSES
static void spr_read_generic (void *opaque, int sprn)
{
gen_op_load_dump_spr(sprn);
}
static void spr_write_generic (void *opaque, int sprn)
{
gen_op_store_dump_spr(sprn);
}
#else
static void spr_read_generic (void *opaque, int sprn)
{
gen_op_load_spr(sprn);
}
static void spr_write_generic (void *opaque, int sprn)
{
gen_op_store_spr(sprn);
}
#endif
#if !defined(CONFIG_USER_ONLY)
static void spr_write_clear (void *opaque, int sprn)
{
gen_op_mask_spr(sprn);
}
#endif
/* SPR common to all PowerPC */
/* XER */
static void spr_read_xer (void *opaque, int sprn)
{
gen_op_load_xer();
}
static void spr_write_xer (void *opaque, int sprn)
{
gen_op_store_xer();
}
/* LR */
static void spr_read_lr (void *opaque, int sprn)
{
gen_op_load_lr();
}
static void spr_write_lr (void *opaque, int sprn)
{
gen_op_store_lr();
}
/* CTR */
static void spr_read_ctr (void *opaque, int sprn)
{
gen_op_load_ctr();
}
static void spr_write_ctr (void *opaque, int sprn)
{
gen_op_store_ctr();
}
/* User read access to SPR */
/* USPRx */
/* UMMCRx */
/* UPMCx */
/* USIA */
/* UDECR */
static void spr_read_ureg (void *opaque, int sprn)
{
gen_op_load_spr(sprn + 0x10);
}
/* SPR common to all non-embedded PowerPC */
/* DECR */
#if !defined(CONFIG_USER_ONLY)
static void spr_read_decr (void *opaque, int sprn)
{
gen_op_load_decr();
}
static void spr_write_decr (void *opaque, int sprn)
{
gen_op_store_decr();
}
#endif
/* SPR common to all non-embedded PowerPC, except 601 */
/* Time base */
static void spr_read_tbl (void *opaque, int sprn)
{
gen_op_load_tbl();
}
static void spr_read_tbu (void *opaque, int sprn)
{
gen_op_load_tbu();
}
__attribute__ (( unused ))
static void spr_read_atbl (void *opaque, int sprn)
{
gen_op_load_atbl();
}
__attribute__ (( unused ))
static void spr_read_atbu (void *opaque, int sprn)
{
gen_op_load_atbu();
}
#if !defined(CONFIG_USER_ONLY)
static void spr_write_tbl (void *opaque, int sprn)
{
gen_op_store_tbl();
}
static void spr_write_tbu (void *opaque, int sprn)
{
gen_op_store_tbu();
}
__attribute__ (( unused ))
static void spr_write_atbl (void *opaque, int sprn)
{
gen_op_store_atbl();
}
__attribute__ (( unused ))
static void spr_write_atbu (void *opaque, int sprn)
{
gen_op_store_atbu();
}
#endif
#if !defined(CONFIG_USER_ONLY)
/* IBAT0U...IBAT0U */
/* IBAT0L...IBAT7L */
static void spr_read_ibat (void *opaque, int sprn)
{
gen_op_load_ibat(sprn & 1, (sprn - SPR_IBAT0U) / 2);
}
static void spr_read_ibat_h (void *opaque, int sprn)
{
gen_op_load_ibat(sprn & 1, (sprn - SPR_IBAT4U) / 2);
}
static void spr_write_ibatu (void *opaque, int sprn)
{
gen_op_store_ibatu((sprn - SPR_IBAT0U) / 2);
}
static void spr_write_ibatu_h (void *opaque, int sprn)
{
gen_op_store_ibatu((sprn - SPR_IBAT4U) / 2);
}
static void spr_write_ibatl (void *opaque, int sprn)
{
gen_op_store_ibatl((sprn - SPR_IBAT0L) / 2);
}
static void spr_write_ibatl_h (void *opaque, int sprn)
{
gen_op_store_ibatl((sprn - SPR_IBAT4L) / 2);
}
/* DBAT0U...DBAT7U */
/* DBAT0L...DBAT7L */
static void spr_read_dbat (void *opaque, int sprn)
{
gen_op_load_dbat(sprn & 1, (sprn - SPR_DBAT0U) / 2);
}
static void spr_read_dbat_h (void *opaque, int sprn)
{
gen_op_load_dbat(sprn & 1, ((sprn - SPR_DBAT4U) / 2) + 4);
}
static void spr_write_dbatu (void *opaque, int sprn)
{
gen_op_store_dbatu((sprn - SPR_DBAT0U) / 2);
}
static void spr_write_dbatu_h (void *opaque, int sprn)
{
gen_op_store_dbatu(((sprn - SPR_DBAT4U) / 2) + 4);
}
static void spr_write_dbatl (void *opaque, int sprn)
{
gen_op_store_dbatl((sprn - SPR_DBAT0L) / 2);
}
static void spr_write_dbatl_h (void *opaque, int sprn)
{
gen_op_store_dbatl(((sprn - SPR_DBAT4L) / 2) + 4);
}
/* SDR1 */
static void spr_read_sdr1 (void *opaque, int sprn)
{
gen_op_load_sdr1();
}
static void spr_write_sdr1 (void *opaque, int sprn)
{
gen_op_store_sdr1();
}
/* 64 bits PowerPC specific SPRs */
/* ASR */
#if defined(TARGET_PPC64)
static void spr_read_asr (void *opaque, int sprn)
{
gen_op_load_asr();
}
static void spr_write_asr (void *opaque, int sprn)
{
gen_op_store_asr();
}
#endif
#endif
/* PowerPC 601 specific registers */
/* RTC */
static void spr_read_601_rtcl (void *opaque, int sprn)
{
gen_op_load_601_rtcl();
}
static void spr_read_601_rtcu (void *opaque, int sprn)
{
gen_op_load_601_rtcu();
}
#if !defined(CONFIG_USER_ONLY)
static void spr_write_601_rtcu (void *opaque, int sprn)
{
gen_op_store_601_rtcu();
}
static void spr_write_601_rtcl (void *opaque, int sprn)
{
gen_op_store_601_rtcl();
}
static void spr_write_hid0_601 (void *opaque, int sprn)
{
DisasContext *ctx = opaque;
gen_op_store_hid0_601();
/* Must stop the translation as endianness may have changed */
GEN_STOP(ctx);
}
#endif
/* Unified bats */
#if !defined(CONFIG_USER_ONLY)
static void spr_read_601_ubat (void *opaque, int sprn)
{
gen_op_load_601_bat(sprn & 1, (sprn - SPR_IBAT0U) / 2);
}
static void spr_write_601_ubatu (void *opaque, int sprn)
{
gen_op_store_601_batu((sprn - SPR_IBAT0U) / 2);
}
static void spr_write_601_ubatl (void *opaque, int sprn)
{
gen_op_store_601_batl((sprn - SPR_IBAT0L) / 2);
}
#endif
/* PowerPC 40x specific registers */
#if !defined(CONFIG_USER_ONLY)
static void spr_read_40x_pit (void *opaque, int sprn)
{
gen_op_load_40x_pit();
}
static void spr_write_40x_pit (void *opaque, int sprn)
{
gen_op_store_40x_pit();
}
static void spr_write_40x_dbcr0 (void *opaque, int sprn)
{
DisasContext *ctx = opaque;
gen_op_store_40x_dbcr0();
/* We must stop translation as we may have rebooted */
GEN_STOP(ctx);
}
static void spr_write_40x_sler (void *opaque, int sprn)
{
gen_op_store_40x_sler();
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
FreeBSD系统上安装windows 所需要的软件qemu-0.9.1.tar.gz (771个子文件)
ar 2KB
ppc_rom.bin 512KB
bios.bin 128KB
vgabios.bin 37KB
vgabios-cirrus.bin 35KB
pxe-pcnet.bin 32KB
pxe-ne2k_pci.bin 32KB
pxe-rtl8139.bin 32KB
translate_init.c 403KB
translate.c 256KB
vl.c 233KB
translate.c 220KB
m68k-dis.c 212KB
translate.c 206KB
mips-dis.c 206KB
softfloat.c 194KB
translate.c 191KB
syscall.c 173KB
sparc-dis.c 171KB
omap.c 159KB
arm-dis.c 158KB
translate.c 139KB
helper.c 131KB
ppc-dis.c 129KB
ide.c 111KB
rtl8139.c 100KB
i386-dis.c 97KB
helper.c 96KB
cirrus_vga.c 96KB
dyngen.c 95KB
s390-dis.c 90KB
exec.c 88KB
sh4-dis.c 83KB
signal.c 81KB
cris-dis.c 81KB
alpha-dis.c 80KB
translate.c 80KB
block-vvfat.c 79KB
ppc405_uc.c 78KB
op_helper.c 76KB
main.c 75KB
block-qcow2.c 71KB
monitor.c 68KB
test-i386.c 68KB
pxa2xx.c 65KB
pcnet.c 63KB
op.c 62KB
fdc.c 61KB
vga.c 60KB
aes.c 60KB
translate.c 58KB
vnc.c 57KB
eepro100.c 57KB
op.c 56KB
op_helper.c 56KB
translate.c 56KB
lsi53c895a.c 52KB
helper.c 52KB
op.c 51KB
cpu-exec.c 50KB
tcp_input.c 48KB
syscall.c 48KB
audio.c 48KB
usb-ohci.c 47KB
op_helper.c 45KB
sd.c 44KB
op.c 44KB
elfload.c 41KB
ppc.c 40KB
sun4m.c 40KB
helper2.c 38KB
gdbstub.c 37KB
spitz.c 36KB
block.c 36KB
sb16.c 36KB
main.c 36KB
op.c 35KB
fmopl.c 35KB
translate.c 35KB
console.c 34KB
tcp_subr.c 34KB
vmware_vga.c 33KB
gt64xxx.c 33KB
stellaris.c 31KB
mips_malta.c 31KB
es1370.c 29KB
pc.c 29KB
pxa2xx_lcd.c 29KB
block-qcow.c 28KB
openpic.c 28KB
tsc210x.c 28KB
usb-uhci.c 28KB
apic.c 27KB
alpha_palcode.c 27KB
usb-linux.c 27KB
usb-hid.c 27KB
dsoundaudio.c 26KB
alsaaudio.c 26KB
machload.c 26KB
flatload.c 25KB
共 771 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
wjx1015
- 粉丝: 1
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于LSTM的SDN流量预测与负载均衡python源码+数据+详细注释(高分项目).zip
- 主机编号检测工具,可检测主机编号
- 基于LSTM的SDN流量预测与负载均衡python源码+数据+详细注释.zip
- WPF Prism框架-右键在位编辑 ListView
- 无线网络修复工具,适用win10,win11
- 无线网卡开关切换工具,更改无线网卡及蓝牙状态
- 医学图像分割数据:肝血管和肿瘤(HepaticVessel)切片分割【包含3个切面划分的数据集(3类别)、标签文件、可视化代码】
- vidstream-3-0.0.1.tar.gz
- 基于FPGA深度学习的SPI 驱动 HC595 点亮数码管
- 2023-2024学年教材费结算明细(公示) -V2.xls
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功