diff options
author | Zhang Xiantao <xiantao.zhang@intel.com> | 2007-12-05 11:30:21 +0800 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-12-11 12:14:57 +0200 |
commit | ac97b22e1cb7b1f28c10a01338d95a08b91e04a9 (patch) | |
tree | c7d041850fe67d6ee4cf0cc704e8de9cd0ce281a /target-ia64 | |
parent | Add firmware build logic support for ia64 platform (diff) | |
download | qemu-kvm-ac97b22e1cb7b1f28c10a01338d95a08b91e04a9.tar.gz qemu-kvm-ac97b22e1cb7b1f28c10a01338d95a08b91e04a9.tar.bz2 qemu-kvm-ac97b22e1cb7b1f28c10a01338d95a08b91e04a9.zip |
Add ia64 target
This adds files for a dummy qemu ia64 target. This target is not usable
for emulation; only virtualization.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'target-ia64')
-rw-r--r-- | target-ia64/cpu.h | 81 | ||||
-rw-r--r-- | target-ia64/exec.h | 46 | ||||
-rw-r--r-- | target-ia64/op.c | 22 | ||||
-rw-r--r-- | target-ia64/op_helper.c | 109 | ||||
-rw-r--r-- | target-ia64/translate.c | 39 |
5 files changed, 297 insertions, 0 deletions
diff --git a/target-ia64/cpu.h b/target-ia64/cpu.h new file mode 100644 index 000000000..7349e94b4 --- /dev/null +++ b/target-ia64/cpu.h @@ -0,0 +1,81 @@ +/* + * IA64 virtual CPU header + * + * Copyright (c) 2003 Fabrice Bellard + * + * Copyright (c) 2007 Intel Corporation + * Zhang xiantao <xiantao.zhang@intel.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef CPU_IA64_H +#define CPU_IA64_H +#include "config.h" +#include "ia64intrin.h" + +#include<string.h> +#include<stdio.h> + +#define TARGET_LONG_BITS 64 + + +#define TARGET_PAGE_BITS 14 + +#define ELF_MACHINE EM_IA_64 + +#define CPU_PAL_HALT 1 +#define HF_HALTED_MASK (1 << CPU_PAL_HALT) + +#include "cpu-defs.h" + +#include "softfloat.h" +typedef struct CPUIA64State { + CPU_COMMON; + /* exception/interrupt handling */ + jmp_buf jmp_env; + int exception_index; + + int interrupt_request; + int user_mode_only; + uint32_t hflags; + +#ifdef USE_KVM + uint8_t ready_for_interrupt_injection; +#endif + +} CPUIA64State; + +#define CPUState CPUIA64State +#define cpu_gen_code cpu_ia64_gen_code +#define cpu_init cpu_ia64_init +#define cpu_signal_handler cpu_ia64_signal_handler + +struct CPUIA64State *env; +int cpu_get_pic_interrupt(CPUIA64State *s); +int cpu_exec(CPUState *env1); +void cpu_dump_state(CPUState *env, FILE *f, + int (*cpu_fprintf)(FILE *f, const char *fmt, ...), + int flags); + +CPUState *cpu_ia64_init(void); + +#include "cpu-all.h" + +/* IA64 has seperate I/D cache, with coherence maintained by DMA controller. + * So to emulate right behavior that guest OS is assumed, we need to flush + * I/D cache here. + */ +void kvm_sync_icache(unsigned long address, int len); +#endif diff --git a/target-ia64/exec.h b/target-ia64/exec.h new file mode 100644 index 000000000..155cfa67a --- /dev/null +++ b/target-ia64/exec.h @@ -0,0 +1,46 @@ +/* + * IA64 execution defines + * + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2007 Intel Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +//#include "dyngen-exec.h" + +#include "cpu.h" +#include "exec-all.h" +uint32_t T0; +uint32_t T1; +uint32_t T2; + +static inline void env_to_regs(void) +{ +} + +static inline void regs_to_env(void) +{ +} + +void cpu_lock(void); +void cpu_unlock(void); +void cpu_loop_exit(void); + +static inline int cpu_halted(CPUState *env) { + /* handle exit of HALTED state */ + if (!(env->hflags & HF_HALTED_MASK)) + return 0; + return EXCP_HALTED; +} diff --git a/target-ia64/op.c b/target-ia64/op.c new file mode 100644 index 000000000..f7301c641 --- /dev/null +++ b/target-ia64/op.c @@ -0,0 +1,22 @@ +/* + * IA64 micro operations + * + * Leave it blank for future implementation + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + diff --git a/target-ia64/op_helper.c b/target-ia64/op_helper.c new file mode 100644 index 000000000..1b8226a64 --- /dev/null +++ b/target-ia64/op_helper.c @@ -0,0 +1,109 @@ +/* + * op_helper.c: IA64 emulation cpu micro-operations helpers for qemu. + * + * Copyright (c) 2007 Intel Corporation + * Zhang Xiantao <xiantao.zhang@intel.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307 USA. + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "cpu.h" +#include "exec-all.h" + +extern int kvm_allowed; + +CPUState *cpu_ia64_init(void){ + CPUState *env; + env = qemu_mallocz(sizeof(CPUState)); + if (!env) + return NULL; + cpu_exec_init(env); + cpu_reset(env); +#ifdef USE_KVM + { + if (kvm_allowed) { + kvm_qemu_init_env(env); + env->ready_for_interrupt_injection = 1; + } + } +#endif + return env; +} + +void cpu_reset(CPUIA64State *env) +{ +} + + +static inline void set_feature(CPUIA64State *env, int feature) +{ + +} + +void cpu_ia64_set_model(CPUIA64State *env, uint32_t id) +{ +} + +void cpu_ia64_close(CPUIA64State *env) +{ + free(env); +} + + +extern int semihosting_enabled; + + +void switch_mode(CPUState *env, int mode) +{ +} + +/* Handle a CPU exception. */ +void do_interrupt(CPUIA64State *env) +{ +#ifdef USE_KVM + if (kvm_allowed) { + printf("%s: unexpect\n", __FUNCTION__); + exit(-1); + } +#endif +} + + + +int cpu_ia64_handle_mmu_fault (CPUState *env, target_ulong address, + int access_type, int is_user, int is_softmmu) +{ + return 1; +} + +target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr) +{ + return -1; +} + + +void cpu_dump_state(CPUState *env, FILE *f, + int (*cpu_fprintf)(FILE *f, const char *fmt, ...), + int flags) +{ + return; +} +void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr) +{ + return ; +} + diff --git a/target-ia64/translate.c b/target-ia64/translate.c new file mode 100644 index 000000000..86f48f50c --- /dev/null +++ b/target-ia64/translate.c @@ -0,0 +1,39 @@ +/* + * translation.c : IA64 translation code. + * Just put it as blank now, and implement it later. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <stdarg.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <inttypes.h> + +static uint16_t *gen_opc_ptr; + +#include "cpu.h" +#include "exec-all.h" +#include "disas.h" +#include "gen-op.h" + +int gen_intermediate_code(CPUState *env, TranslationBlock *tb) +{ + return 0; +} +int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb) +{ + return 0; +} |