4 * Copyright (c) 2009 Ulrich Hecht
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
9 * version 2 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
27 #include "qemu-common.h"
29 #include <linux/kvm.h>
32 CPUS390XState *cpu_s390x_init(const char *cpu_model)
35 static int inited = 0;
37 env = qemu_mallocz(sizeof(CPUS390XState));
43 env->cpu_model_str = cpu_model;
49 void cpu_reset(CPUS390XState *env)
51 if (qemu_loglevel_mask(CPU_LOG_RESET)) {
52 qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
53 log_cpu_state(env, 0);
56 memset(env, 0, offsetof(CPUS390XState, breakpoints));
57 /* FIXME: reset vector? */
61 #ifndef CONFIG_USER_ONLY
63 int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
64 int mmu_idx, int is_softmmu)
69 /* XXX: implement mmu */
72 prot = PAGE_READ | PAGE_WRITE;
74 return tlb_set_page(env, address & TARGET_PAGE_MASK,
75 phys & TARGET_PAGE_MASK, prot,
78 #endif /* CONFIG_USER_ONLY */