* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
{NULL, 0},
};
+void m68k_cpu_list(FILE *f, fprintf_function cpu_fprintf)
+{
+ unsigned int i;
+
+ for (i = 0; m68k_cpu_defs[i].name; i++) {
+ (*cpu_fprintf)(f, "%s\n", m68k_cpu_defs[i].name);
+ }
+}
+
static int fpu_gdb_get_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 8) {
static int inited;
env = qemu_mallocz(sizeof(CPUM68KState));
- if (!env)
- return NULL;
cpu_exec_init(env);
if (!inited) {
inited = 1;
}
cpu_reset(env);
+ qemu_init_vcpu(env);
return env;
}
env->current_sp = new_sp;
}
-/* MMU */
-
-/* TODO: This will need fixing once the MMU is implemented. */
-target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
-{
- return addr;
-}
-
#if defined(CONFIG_USER_ONLY)
int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
#else
+/* MMU */
+
+/* TODO: This will need fixing once the MMU is implemented. */
+target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+{
+ return addr;
+}
+
int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int mmu_idx, int is_softmmu)
{
int prot;
address &= TARGET_PAGE_MASK;
- prot = PAGE_READ | PAGE_WRITE;
- return tlb_set_page(env, address, address, prot, mmu_idx, is_softmmu);
+ prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
+ tlb_set_page(env, address, address, prot, mmu_idx, TARGET_PAGE_SIZE);
+ return 0;
}
/* Notify CPU of a pending interrupt. Prioritization and vectoring should
return a < b;
}
-uint32_t HELPER(btest)(uint32_t x)
-{
- return x != 0;
-}
-
void HELPER(set_sr)(CPUState *env, uint32_t val)
{
env->sr = val & 0xffff;
/* ??? Should flush denormals to zero. */
float64 res;
res = float64_sub(a, b, &env->fp_status);
- if (float64_is_nan(res)) {
+ if (float64_is_quiet_nan(res)) {
/* +/-inf compares equal against itself, but sub returns nan. */
- if (!float64_is_nan(a)
- && !float64_is_nan(b)) {
+ if (!float64_is_quiet_nan(a)
+ && !float64_is_quiet_nan(b)) {
res = float64_zero;
if (float64_lt_quiet(a, res, &env->fp_status))
res = float64_chs(res);
if (env->macsr & MACSR_V) {
env->macsr |= MACSR_PAV0 << acc;
if (env->macsr & MACSR_OMC) {
- /* The result is saturated to 32 bits, despite overflow occuring
+ /* The result is saturated to 32 bits, despite overflow occurring
at 48 bits. Seems weird, but that's what the hardware docs
say. */
result = (result >> 63) ^ 0x7fffffff;
{
uint64_t val;
val = env->macc[acc];
- if (val == 0)
+ if (val == 0) {
env->macsr |= MACSR_Z;
- else if (val & (1ull << 47));
+ } else if (val & (1ull << 47)) {
env->macsr |= MACSR_N;
+ }
if (env->macsr & (MACSR_PAV0 << acc)) {
env->macsr |= MACSR_V;
}