diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-02-16 10:38:35 -0800 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-02-18 15:22:07 -0800 |
commit | 5389aa19033153c09556d1362a8b8a56abccb8f5 (patch) | |
tree | 5d731effe5bd5d2f162f06aadec7212045eaef3d /softmmu_outside_jit.c | |
parent | 76dbca0489ab98a46f2954bc7b77c3df6f9d8264 (diff) | |
download | external_qemu-5389aa19033153c09556d1362a8b8a56abccb8f5.zip external_qemu-5389aa19033153c09556d1362a8b8a56abccb8f5.tar.gz external_qemu-5389aa19033153c09556d1362a8b8a56abccb8f5.tar.bz2 |
Merge memory checking from sandbox
Change-id: Ibce845d0
Diffstat (limited to 'softmmu_outside_jit.c')
-rw-r--r-- | softmmu_outside_jit.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/softmmu_outside_jit.c b/softmmu_outside_jit.c new file mode 100644 index 0000000..048a2ea --- /dev/null +++ b/softmmu_outside_jit.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2007-2009 The Android Open Source Project +** +** This software is licensed under the terms of the GNU General Public +** License version 2, as published by the Free Software Foundation, and +** may be copied, distributed, and modified under those terms. +** +** This program 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 General Public License for more details. +*/ + +/* + * Contains SOFTMMU macros expansion for ldx_user and stx_user routines used + * outside of JIT. The issue is that regular implementation of these routines + * assumes that pointer to CPU environment is stored in ebp register, which + * is true for calls made inside JIT, but is not necessarily true for calls + * made outside of JIT. The way SOFTMMU macros are expanded in this header + * enforces ldx/stx routines to use CPU environment stored in cpu_single_env + * variable. + */ + +#include "qemu-common.h" +#include "cpu.h" + +#define OUTSIDE_JIT +#define MMUSUFFIX _outside_jit +#define GETPC() NULL +#define env cpu_single_env +#define ACCESS_TYPE 1 +#define CPU_MMU_INDEX (cpu_mmu_index(env)) + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + +#undef CPU_MMU_INDEX +#undef ACCESS_TYPE +#undef env +#undef MMUSUFFIX |