]> git.proxmox.com Git - qemu.git/blob - target-s390x/helper.c
Allocate physical memory in low virtual address space
[qemu.git] / target-s390x / helper.c
1 /*
2 * S/390 helpers
3 *
4 * Copyright (c) 2009 Ulrich Hecht
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
9 * version 2 of the License, or (at your option) any later version.
10 *
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.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
19 */
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24
25 #include "cpu.h"
26 #include "exec-all.h"
27 #include "gdbstub.h"
28 #include "qemu-common.h"
29
30 CPUS390XState *cpu_s390x_init(const char *cpu_model)
31 {
32 CPUS390XState *env;
33 static int inited = 0;
34
35 env = qemu_mallocz(sizeof(CPUS390XState));
36 cpu_exec_init(env);
37 if (!inited) {
38 inited = 1;
39 }
40
41 env->cpu_model_str = cpu_model;
42 cpu_reset(env);
43 qemu_init_vcpu(env);
44 return env;
45 }
46
47 target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
48 {
49 return addr;
50 }
51
52 void cpu_reset(CPUS390XState *env)
53 {
54 if (qemu_loglevel_mask(CPU_LOG_RESET)) {
55 qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
56 log_cpu_state(env, 0);
57 }
58
59 memset(env, 0, offsetof(CPUS390XState, breakpoints));
60 /* FIXME: reset vector? */
61 tlb_flush(env, 1);
62 }