Home | History | Annotate | Download | only in qemu
      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 
     26 #define OUTSIDE_JIT
     27 #define MMUSUFFIX       _outside_jit
     28 #define GETPC()         NULL
     29 #define env             cpu_single_env
     30 #define ACCESS_TYPE     1
     31 #define CPU_MMU_INDEX   (cpu_mmu_index(env))
     32 
     33 #define SHIFT 0
     34 #include "softmmu_template.h"
     35 
     36 #define SHIFT 1
     37 #include "softmmu_template.h"
     38 
     39 #define SHIFT 2
     40 #include "softmmu_template.h"
     41 
     42 #define SHIFT 3
     43 #include "softmmu_template.h"
     44 
     45 #undef CPU_MMU_INDEX
     46 #undef ACCESS_TYPE
     47 #undef env
     48 #undef MMUSUFFIX
     49