?? coproc.cpp
字號:
/*************************************************************************
Copyright (C) 2002,2003,2004,2005 Wei Qin
See file COPYING for more information.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
*************************************************************************/
#include <cstdio>
#include <armemul.h>
#include "coproc.h"
#include "emu_device.hpp"
#ifdef _MODULARIZE_
#define EMU(_x) emu->_x
#else
#define EMU(_x) _x
#endif
using namespace emulator;
/*RN and RD is switched for MLA*/
void impl_cpld(IMPL_FORMALS)
{
//r0 contains the device id
dev_id_t id = READ_REG(0);
// r1 contains the address
dev_addr_t addr = READ_REG(1);
dev_data_t data;
if (inst & 0X100) {
if (EMU(dev_master->receive(id, data, addr))) {
WRITE_REG(0, data);
}
else { // blocked, yield
EMU(stop());
}
}
else if (EMU(dev_master->receive(id, data))) {
WRITE_REG(0, data);
}
else { // blocked, yield
EMU(stop());
}
EMULATOR_STUB(cpld,inst);
}
void impl_cpst(IMPL_FORMALS)
{
// r0 contains the device id
dev_id_t id = READ_REG(0);
// r2 contains the address
dev_addr_t addr = READ_REG(2);
// r1 contains the value to write
dev_data_t data = READ_REG(1);
if (inst & 0X100) {
if (!EMU(dev_master->send(id, data, addr)))
EMU(stop());
}
else if (!EMU(dev_master->send(id, data))) {
EMU(stop());
}
EMULATOR_STUB(cpst, inst);
}
char *disasm_cpld(arm_inst_t inst, arm_addr_t addr, char *buf)
{
buf += sprintf(buf, "coproc ld");
return buf;
}
char *disasm_cpst(arm_inst_t inst, arm_addr_t addr, char *buf)
{
buf += sprintf(buf, "coproc st");
return buf;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -