vl.c の中でオプション解析。デフォルトは cirrus_vga_enable になってるみたい。
pci/isa_vga_init() で作ったビデオカードが stdvga 相当になるみたい。
(他はそれぞれ、vga の代わりに cirrus や vmsvga が付いた初期化関数を使う)
これで、softmmu_header.h 内の#define ACCESS_TYPE (NB_MMU_MODES + 1)#define MEMSUFFIX _code#define env cpu_single_env#define DATA_SIZE 1#include "softmmu_header.h"#define DATA_SIZE 2#include "softmmu_header.h"#define DATA_SIZE 4#include "softmmu_header.h"#define DATA_SIZE 8#include "softmmu_header.h"#undef ACCESS_TYPE#undef MEMSUFFIX#undef env#endif
/* generic load/store macros */static inline RES_TYPE glue(glue(ld, USUFFIX), MEMSUFFIX)(target_ulong ptr){int index;RES_TYPE res;target_ulong addr;unsigned long physaddr;int mmu_idx;addr = ptr;index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);mmu_idx = CPU_MMU_INDEX;if (__builtin_expect(env->tlb_table[mmu_idx][index].ADDR_READ !=(addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))), 0)) {res = glue(glue(__ld, SUFFIX), MMUSUFFIX)(addr, mmu_idx);} else {physaddr = addr + env->tlb_table[mmu_idx][index].addend;res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)physaddr);}return res;}
/* generic load/store macros */static inline uint32_t ldl_code(target_ulong ptr){int index;uint32_t res;target_ulong addr;unsigned long physaddr;int mmu_idx;addr = ptr;index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);mmu_idx = CPU_MMU_INDEX;if (__builtin_expect(env->tlb_table[mmu_idx][index].ADDR_READ !=(addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))), 0)) {res = __ldl_cmmu(addr, mmu_idx);} else {physaddr = addr + env->tlb_table[mmu_idx][index].addend;res = ldl_raw((uint8_t *)physaddr);}return res;}
static void disas_arm_insn(CPUState * env, DisasContext *s){unsigned int cond, insn, val, op1, i, shift, rm, rs, rn, rd, sh;insn = ldl_code(s->pc);
#define ldl_code(p) ldl_raw(p)#define ldl_raw(p) ldl_p(laddr((p)))#define laddr(x) (uint8_t *)(long)(x)#define ldl_p(p) ldl_le_p(p) /* !defined(TARGET_WORDS_BIGENDIAN) */static inline int ldl_le_p(void *ptr){return *(uint32_t *)ptr;}
686 /* fail safe : never use cpu_single_env outside cpu_exec() */687 cpu_single_env = NULL;688 return ret;689}
/* 'pc' is the host PC at which the exception was raised. 'address' isthe effective address of the memory exception. 'is_write' is 1 if awrite caused the exception and otherwise 0'. 'old_set' is thesignal set which should be restored */static inline int handle_cpu_signal(unsigned long pc, unsigned long address,int is_write, sigset_t *old_set,void *puc){TranslationBlock *tb;int ret;if (cpu_single_env)env = cpu_single_env; /* XXX: find a correct solution for multithread */
/* mask must never be zero, except for A20 change call */void cpu_interrupt(CPUState *env, int mask){。。。/* FIXME: This is probably not threadsafe. A different thread couldbe in the middle of a read-modify-write operation. */env->interrupt_request |= mask;#if defined(USE_NPTL)/* FIXME: TB unchaining isn't SMP safe. For now just ignore theproblem and hope the cpu will stop of its own accord. For userspaceemulation this often isn't actually as bad as it sounds. Oftensignals are used primarily to interrupt blocking syscalls. */#else。。。}