cpu.c (f9950374300cb4d8d898bbfc694a0639e9aafdc3) cpu.c (6ba97c48a64d059ddfa5400330dfaf5982f5f2c8)
1/*
2 * QEMU MIPS CPU
3 *
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 18 unchanged lines hidden (view full) ---

27#include "kvm_mips.h"
28#include "qemu/module.h"
29#include "sysemu/kvm.h"
30#include "sysemu/qtest.h"
31#include "exec/exec-all.h"
32#include "hw/qdev-properties.h"
33#include "hw/qdev-clock.h"
34#include "semihosting/semihost.h"
1/*
2 * QEMU MIPS CPU
3 *
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 18 unchanged lines hidden (view full) ---

27#include "kvm_mips.h"
28#include "qemu/module.h"
29#include "sysemu/kvm.h"
30#include "sysemu/qtest.h"
31#include "exec/exec-all.h"
32#include "hw/qdev-properties.h"
33#include "hw/qdev-clock.h"
34#include "semihosting/semihost.h"
35#include "qapi/qapi-commands-machine-target.h"
36#include "fpu_helper.h"
37
38const char regnames[32][3] = {
39 "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
40 "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
41 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
42 "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
43};

--- 575 unchanged lines hidden (view full) ---

619 type_register_static(&mips_cpu_type_info);
620 for (i = 0; i < mips_defs_number; i++) {
621 mips_register_cpudef_type(&mips_defs[i]);
622 }
623}
624
625type_init(mips_cpu_register_types)
626
35#include "fpu_helper.h"
36
37const char regnames[32][3] = {
38 "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
39 "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
40 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
41 "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
42};

--- 575 unchanged lines hidden (view full) ---

618 type_register_static(&mips_cpu_type_info);
619 for (i = 0; i < mips_defs_number; i++) {
620 mips_register_cpudef_type(&mips_defs[i]);
621 }
622}
623
624type_init(mips_cpu_register_types)
625
627static void mips_cpu_add_definition(gpointer data, gpointer user_data)
628{
629 ObjectClass *oc = data;
630 CpuDefinitionInfoList **cpu_list = user_data;
631 CpuDefinitionInfo *info;
632 const char *typename;
633
634 typename = object_class_get_name(oc);
635 info = g_malloc0(sizeof(*info));
636 info->name = g_strndup(typename,
637 strlen(typename) - strlen("-" TYPE_MIPS_CPU));
638 info->q_typename = g_strdup(typename);
639
640 QAPI_LIST_PREPEND(*cpu_list, info);
641}
642
643CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
644{
645 CpuDefinitionInfoList *cpu_list = NULL;
646 GSList *list;
647
648 list = object_class_get_list(TYPE_MIPS_CPU, false);
649 g_slist_foreach(list, mips_cpu_add_definition, &cpu_list);
650 g_slist_free(list);
651
652 return cpu_list;
653}
654
655/* Could be used by generic CPU object */
656MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk)
657{
658 DeviceState *cpu;
659
660 cpu = DEVICE(object_new(cpu_type));
661 qdev_connect_clock_in(cpu, "clk-in", cpu_refclk);
662 qdev_realize(cpu, NULL, &error_abort);

--- 20 unchanged lines hidden ---
626/* Could be used by generic CPU object */
627MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk)
628{
629 DeviceState *cpu;
630
631 cpu = DEVICE(object_new(cpu_type));
632 qdev_connect_clock_in(cpu, "clk-in", cpu_refclk);
633 qdev_realize(cpu, NULL, &error_abort);

--- 20 unchanged lines hidden ---