~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/arm64/0025-target-arm-A64-add-set_pc-cpu-method.patch/target-arm/cpu64.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * QEMU AArch64 CPU
3
 
 *
4
 
 * Copyright (c) 2013 Linaro Ltd
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU General Public License
8
 
 * as published by the Free Software Foundation; either version 2
9
 
 * of the License, or (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, see
18
 
 * <http://www.gnu.org/licenses/gpl-2.0.html>
19
 
 */
20
 
 
21
 
#include "cpu.h"
22
 
#include "qemu-common.h"
23
 
#if !defined(CONFIG_USER_ONLY)
24
 
#include "hw/loader.h"
25
 
#endif
26
 
#include "hw/arm/arm.h"
27
 
#include "sysemu/sysemu.h"
28
 
#include "sysemu/kvm.h"
29
 
 
30
 
static inline void set_feature(CPUARMState *env, int feature)
31
 
{
32
 
    env->features |= 1ULL << feature;
33
 
}
34
 
 
35
 
#ifdef CONFIG_USER_ONLY
36
 
static void aarch64_any_initfn(Object *obj)
37
 
{
38
 
    ARMCPU *cpu = ARM_CPU(obj);
39
 
 
40
 
    set_feature(&cpu->env, ARM_FEATURE_V8);
41
 
    set_feature(&cpu->env, ARM_FEATURE_VFP4);
42
 
    set_feature(&cpu->env, ARM_FEATURE_VFP_FP16);
43
 
    set_feature(&cpu->env, ARM_FEATURE_NEON);
44
 
    set_feature(&cpu->env, ARM_FEATURE_THUMB2EE);
45
 
    set_feature(&cpu->env, ARM_FEATURE_ARM_DIV);
46
 
    set_feature(&cpu->env, ARM_FEATURE_V7MP);
47
 
    set_feature(&cpu->env, ARM_FEATURE_AARCH64);
48
 
}
49
 
#endif
50
 
 
51
 
typedef struct ARMCPUInfo {
52
 
    const char *name;
53
 
    void (*initfn)(Object *obj);
54
 
    void (*class_init)(ObjectClass *oc, void *data);
55
 
} ARMCPUInfo;
56
 
 
57
 
static const ARMCPUInfo aarch64_cpus[] = {
58
 
#ifdef CONFIG_USER_ONLY
59
 
    { .name = "any",         .initfn = aarch64_any_initfn },
60
 
#endif
61
 
};
62
 
 
63
 
static void aarch64_cpu_initfn(Object *obj)
64
 
{
65
 
}
66
 
 
67
 
static void aarch64_cpu_finalizefn(Object *obj)
68
 
{
69
 
}
70
 
 
71
 
static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
72
 
{
73
 
    CPUClass *cc = CPU_CLASS(oc);
74
 
 
75
 
    cc->dump_state = aarch64_cpu_dump_state;
76
 
    cc->gdb_read_register = aarch64_cpu_gdb_read_register;
77
 
    cc->gdb_write_register = aarch64_cpu_gdb_write_register;
78
 
    cc->gdb_num_core_regs = 34;
79
 
    cc->gdb_core_xml_file = "aarch64-core.xml";
80
 
}
81
 
 
82
 
static void aarch64_cpu_register(const ARMCPUInfo *info)
83
 
{
84
 
    TypeInfo type_info = {
85
 
        .parent = TYPE_AARCH64_CPU,
86
 
        .instance_size = sizeof(ARMCPU),
87
 
        .instance_init = info->initfn,
88
 
        .class_size = sizeof(ARMCPUClass),
89
 
        .class_init = info->class_init,
90
 
    };
91
 
 
92
 
    type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
93
 
    type_register(&type_info);
94
 
    g_free((void *)type_info.name);
95
 
}
96
 
 
97
 
static const TypeInfo aarch64_cpu_type_info = {
98
 
    .name = TYPE_AARCH64_CPU,
99
 
    .parent = TYPE_ARM_CPU,
100
 
    .instance_size = sizeof(ARMCPU),
101
 
    .instance_init = aarch64_cpu_initfn,
102
 
    .instance_finalize = aarch64_cpu_finalizefn,
103
 
    .abstract = true,
104
 
    .class_size = sizeof(AArch64CPUClass),
105
 
    .class_init = aarch64_cpu_class_init,
106
 
};
107
 
 
108
 
static void aarch64_cpu_register_types(void)
109
 
{
110
 
    int i;
111
 
 
112
 
    type_register_static(&aarch64_cpu_type_info);
113
 
    for (i = 0; i < ARRAY_SIZE(aarch64_cpus); i++) {
114
 
        aarch64_cpu_register(&aarch64_cpus[i]);
115
 
    }
116
 
}
117
 
 
118
 
type_init(aarch64_cpu_register_types)