blob: 0b984b25a68fe463040e312686dd20a2c66c1bfb [file] [log] [blame]
Anthony PERARD3285cf42010-08-19 12:27:56 +01001/*
2 * Copyright (C) 2010 Citrix Ltd.
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2. See
5 * the COPYING file in the top-level directory.
6 *
7 */
8
9#include "hw/xen_common.h"
10#include "hw/xen_backend.h"
11
Anthony PERARD29d3ccd2010-06-30 12:58:34 +010012/* VCPU Operations, MMIO, IO ring ... */
13
14static void xen_reset_vcpu(void *opaque)
15{
16 CPUState *env = opaque;
17
18 env->halted = 1;
19}
20
21void xen_vcpu_init(void)
22{
23 CPUState *first_cpu;
24
25 if ((first_cpu = qemu_get_cpu(0))) {
26 qemu_register_reset(xen_reset_vcpu, first_cpu);
27 xen_reset_vcpu(first_cpu);
28 }
29}
30
Anthony PERARD3285cf42010-08-19 12:27:56 +010031/* Initialise Xen */
32
33int xen_init(void)
34{
35 xen_xc = xen_xc_interface_open(0, 0, 0);
36 if (xen_xc == XC_HANDLER_INITIAL_VALUE) {
37 xen_be_printf(NULL, 0, "can't open xen interface\n");
38 return -1;
39 }
40
41 return 0;
42}
Anthony PERARD29d3ccd2010-06-30 12:58:34 +010043
44int xen_hvm_init(void)
45{
46 return 0;
47}