1 /*
2  * op_helper.c:  IA64 emulation cpu micro-operations helpers for qemu.
3  *
4  * Copyright (c) 2007 Intel Corporation
5  * Zhang Xiantao <xiantao.zhang@intel.com>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms and conditions of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18  * Place - Suite 330, Boston, MA 02111-1307 USA.
19  */
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include "cpu.h"
25 #include "exec-all.h"
26 
27 #include "qemu-kvm.h"
28 #include "qemu-common.h"
29 
30 void cpu_ia64_set_model(CPUIA64State *env, uint32_t id);
31 void cpu_ia64_close(CPUIA64State *env);
32 void switch_mode(CPUState *env, int mode);
33 void do_interrupt(CPUIA64State *env);
34 int cpu_ia64_handle_mmu_fault (CPUState *env, target_ulong address,
35                                int access_type, int is_user, int is_softmmu);
cpu_ia64_init(const char * cpu_model)36 CPUState *cpu_ia64_init(const char *cpu_model)
37 {
38     CPUState *env;
39     env = qemu_mallocz(sizeof(CPUState));
40     if (!env)
41         return NULL;
42     cpu_exec_init(env);
43     cpu_reset(env);
44     if (kvm_enabled()) {
45         kvm_qemu_init_env(env);
46         kvm_init_vcpu(env);
47     }
48     return env;
49 }
50 
cpu_reset(CPUIA64State * env)51 void cpu_reset(CPUIA64State *env)
52 {
53 }
54 
set_feature(CPUIA64State * env,int feature)55 static inline void set_feature(CPUIA64State *env, int feature)
56 {
57 }
58 
cpu_ia64_set_model(CPUIA64State * env,uint32_t id)59 void cpu_ia64_set_model(CPUIA64State *env, uint32_t id)
60 {
61 }
62 
cpu_ia64_close(CPUIA64State * env)63 void cpu_ia64_close(CPUIA64State *env)
64 {
65     free(env);
66 }
67 
68 extern int semihosting_enabled;
69 
switch_mode(CPUState * env,int mode)70 void switch_mode(CPUState *env, int mode)
71 {
72 }
73 
74 /* Handle a CPU exception.  */
do_interrupt(CPUIA64State * env)75 void do_interrupt(CPUIA64State *env)
76 {
77     if (kvm_enabled()) {
78         printf("%s: unexpect\n", __FUNCTION__);
79         exit(-1);
80     }
81 }
82 
cpu_ia64_handle_mmu_fault(CPUState * env,target_ulong address,int access_type,int is_user,int is_softmmu)83 int cpu_ia64_handle_mmu_fault (CPUState *env, target_ulong address,
84                                int access_type, int is_user, int is_softmmu)
85 {
86     return 1;
87 }
88 
cpu_get_phys_page_debug(CPUState * env,target_ulong addr)89 target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
90 {
91     return -1;
92 }
93 
cpu_dump_state(CPUState * env,FILE * f,int (* cpu_fprintf)(FILE * f,const char * fmt,...),int flags)94 void cpu_dump_state(CPUState *env, FILE *f,
95                     int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
96                     int flags)
97 {
98     return;
99 }
100 
tlb_fill(target_ulong addr,int is_write,int is_user,void * retaddr)101 void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr)
102 {
103     return;
104 }
105