• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2007-2009 The Android Open Source Project
2 **
3 ** This software is licensed under the terms of the GNU General Public
4 ** License version 2, as published by the Free Software Foundation, and
5 ** may be copied, distributed, and modified under those terms.
6 **
7 ** This program is distributed in the hope that it will be useful,
8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 ** GNU General Public License for more details.
11 */
12 
13 /*
14  * Contains SOFTMMU macros expansion for ldx_user and stx_user routines used
15  * outside of JIT. The issue is that regular implementation of these routines
16  * assumes that pointer to CPU environment is stored in ebp register, which
17  * is true for calls made inside JIT, but is not necessarily true for calls
18  * made outside of JIT. The way SOFTMMU macros are expanded in this header
19  * enforces ldx/stx routines to use CPU environment stored in cpu_single_env
20  * variable.
21  */
22 
23 #include "qemu-common.h"
24 #include "cpu.h"
25 #include "exec-all.h"
26 
27 #define OUTSIDE_JIT
28 #define MMUSUFFIX       _outside_jit
29 #define GETPC()         NULL
30 #define env             cpu_single_env
31 #define ACCESS_TYPE     1
32 #define CPU_MMU_INDEX   (cpu_mmu_index(env))
33 
34 #define SHIFT 0
35 #include "softmmu_template.h"
36 
37 #define SHIFT 1
38 #include "softmmu_template.h"
39 
40 #define SHIFT 2
41 #include "softmmu_template.h"
42 
43 #define SHIFT 3
44 #include "softmmu_template.h"
45 
46 #undef CPU_MMU_INDEX
47 #undef ACCESS_TYPE
48 #undef env
49 #undef MMUSUFFIX
50