Changeset 36175 in vbox for trunk/src/recompiler/softmmu_header.h
- Timestamp:
- Mar 4, 2011 4:21:09 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70371
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/softmmu_header.h
r36170 r36175 15 15 * 16 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 17 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 19 18 */ 20 19 … … 81 80 #endif 82 81 83 #if (DATA_SIZE <= 4) && (TARGET_LONG_BITS == 32) && defined(__i386__) && \84 (ACCESS_TYPE < NB_MMU_MODES) && defined(ASM_SOFTMMU) && !defined(VBOX)85 86 static inline RES_TYPE glue(glue(ld, USUFFIX), MEMSUFFIX)(target_ulong ptr)87 {88 int res;89 90 asm volatile ("movl %1, %%edx\n"91 "movl %1, %%eax\n"92 "shrl %3, %%edx\n"93 "andl %4, %%eax\n"94 "andl %2, %%edx\n"95 "leal %5(%%edx, %%ebp), %%edx\n"96 "cmpl (%%edx), %%eax\n"97 "movl %1, %%eax\n"98 "je 1f\n"99 "movl %6, %%edx\n"100 "call %7\n"101 "movl %%eax, %0\n"102 "jmp 2f\n"103 "1:\n"104 "addl 12(%%edx), %%eax\n"105 #if DATA_SIZE == 1106 "movzbl (%%eax), %0\n"107 #elif DATA_SIZE == 2108 "movzwl (%%eax), %0\n"109 #elif DATA_SIZE == 4110 "movl (%%eax), %0\n"111 #else112 #error unsupported size113 #endif114 "2:\n"115 : "=r" (res)116 : "r" (ptr),117 "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),118 "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),119 "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),120 "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_read)),121 "i" (CPU_MMU_INDEX),122 "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))123 : "%eax", "%ecx", "%edx", "memory", "cc");124 return res;125 }126 127 #if DATA_SIZE <= 2128 static inline int glue(glue(lds, SUFFIX), MEMSUFFIX)(target_ulong ptr)129 {130 int res;131 132 asm volatile ("movl %1, %%edx\n"133 "movl %1, %%eax\n"134 "shrl %3, %%edx\n"135 "andl %4, %%eax\n"136 "andl %2, %%edx\n"137 "leal %5(%%edx, %%ebp), %%edx\n"138 "cmpl (%%edx), %%eax\n"139 "movl %1, %%eax\n"140 "je 1f\n"141 "movl %6, %%edx\n"142 "call %7\n"143 #if DATA_SIZE == 1144 "movsbl %%al, %0\n"145 #elif DATA_SIZE == 2146 "movswl %%ax, %0\n"147 #else148 #error unsupported size149 #endif150 "jmp 2f\n"151 "1:\n"152 "addl 12(%%edx), %%eax\n"153 #if DATA_SIZE == 1154 "movsbl (%%eax), %0\n"155 #elif DATA_SIZE == 2156 "movswl (%%eax), %0\n"157 #else158 #error unsupported size159 #endif160 "2:\n"161 : "=r" (res)162 : "r" (ptr),163 "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),164 "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),165 "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),166 "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_read)),167 "i" (CPU_MMU_INDEX),168 "m" (*(uint8_t *)&glue(glue(__ld, SUFFIX), MMUSUFFIX))169 : "%eax", "%ecx", "%edx", "memory", "cc");170 return res;171 }172 #endif173 174 static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(target_ulong ptr, RES_TYPE v)175 {176 asm volatile ("movl %0, %%edx\n"177 "movl %0, %%eax\n"178 "shrl %3, %%edx\n"179 "andl %4, %%eax\n"180 "andl %2, %%edx\n"181 "leal %5(%%edx, %%ebp), %%edx\n"182 "cmpl (%%edx), %%eax\n"183 "movl %0, %%eax\n"184 "je 1f\n"185 #if DATA_SIZE == 1186 "movzbl %b1, %%edx\n"187 #elif DATA_SIZE == 2188 "movzwl %w1, %%edx\n"189 #elif DATA_SIZE == 4190 "movl %1, %%edx\n"191 #else192 #error unsupported size193 #endif194 "movl %6, %%ecx\n"195 "call %7\n"196 "jmp 2f\n"197 "1:\n"198 "addl 8(%%edx), %%eax\n"199 #if DATA_SIZE == 1200 "movb %b1, (%%eax)\n"201 #elif DATA_SIZE == 2202 "movw %w1, (%%eax)\n"203 #elif DATA_SIZE == 4204 "movl %1, (%%eax)\n"205 #else206 #error unsupported size207 #endif208 "2:\n"209 :210 : "r" (ptr),211 #if DATA_SIZE == 1212 "q" (v),213 #else214 "r" (v),215 #endif216 "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),217 "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),218 "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),219 "m" (*(uint32_t *)offsetof(CPUState, tlb_table[CPU_MMU_INDEX][0].addr_write)),220 "i" (CPU_MMU_INDEX),221 "m" (*(uint8_t *)&glue(glue(__st, SUFFIX), MMUSUFFIX))222 : "%eax", "%ecx", "%edx", "memory", "cc");223 }224 225 #else226 227 82 /* generic load/store macros */ 228 83 … … 295 150 #endif /* ACCESS_TYPE != (NB_MMU_MODES + 1) */ 296 151 297 #endif /* !asm */298 299 152 #if ACCESS_TYPE != (NB_MMU_MODES + 1) 300 153
Note:
See TracChangeset
for help on using the changeset viewer.