Преглед на файлове

w64: Fix data types in softmmu*.h

w64 requires uintptr_t.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil преди 13 години
родител
ревизия
b065927a02
променени са 2 файла, в които са добавени 15 реда и са изтрити 13 реда
  1. 3 3
      softmmu_header.h
  2. 12 10
      softmmu_template.h

+ 3 - 3
softmmu_header.h

@@ -111,7 +111,7 @@ glue(glue(glue(CPU_PREFIX, ld), USUFFIX), MEMSUFFIX)(ENV_PARAM
                                                                      mmu_idx);
                                                                      mmu_idx);
     } else {
     } else {
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
-        res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)hostaddr);
+        res = glue(glue(ld, USUFFIX), _raw)(hostaddr);
     }
     }
     return res;
     return res;
 }
 }
@@ -134,7 +134,7 @@ glue(glue(glue(CPU_PREFIX, lds), SUFFIX), MEMSUFFIX)(ENV_PARAM
                                MMUSUFFIX)(ENV_VAR addr, mmu_idx);
                                MMUSUFFIX)(ENV_VAR addr, mmu_idx);
     } else {
     } else {
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
-        res = glue(glue(lds, SUFFIX), _raw)((uint8_t *)hostaddr);
+        res = glue(glue(lds, SUFFIX), _raw)(hostaddr);
     }
     }
     return res;
     return res;
 }
 }
@@ -161,7 +161,7 @@ glue(glue(glue(CPU_PREFIX, st), SUFFIX), MEMSUFFIX)(ENV_PARAM target_ulong ptr,
                                                                mmu_idx);
                                                                mmu_idx);
     } else {
     } else {
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
         uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend;
-        glue(glue(st, SUFFIX), _raw)((uint8_t *)hostaddr, v);
+        glue(glue(st, SUFFIX), _raw)(hostaddr, v);
     }
     }
 }
 }
 
 

+ 12 - 10
softmmu_template.h

@@ -112,7 +112,6 @@ glue(glue(glue(HELPER_PREFIX, ld), SUFFIX), MMUSUFFIX)(ENV_PARAM
     int index;
     int index;
     target_ulong tlb_addr;
     target_ulong tlb_addr;
     target_phys_addr_t ioaddr;
     target_phys_addr_t ioaddr;
-    unsigned long addend;
     uintptr_t retaddr;
     uintptr_t retaddr;
 
 
     /* test if there is match for unaligned or IO access */
     /* test if there is match for unaligned or IO access */
@@ -139,6 +138,7 @@ glue(glue(glue(HELPER_PREFIX, ld), SUFFIX), MMUSUFFIX)(ENV_PARAM
                                                          mmu_idx, retaddr);
                                                          mmu_idx, retaddr);
         } else {
         } else {
             /* unaligned/aligned access in the same page */
             /* unaligned/aligned access in the same page */
+            uintptr_t addend;
 #ifdef ALIGNED_ONLY
 #ifdef ALIGNED_ONLY
             if ((addr & (DATA_SIZE - 1)) != 0) {
             if ((addr & (DATA_SIZE - 1)) != 0) {
                 retaddr = GETPC();
                 retaddr = GETPC();
@@ -146,7 +146,8 @@ glue(glue(glue(HELPER_PREFIX, ld), SUFFIX), MMUSUFFIX)(ENV_PARAM
             }
             }
 #endif
 #endif
             addend = env->tlb_table[mmu_idx][index].addend;
             addend = env->tlb_table[mmu_idx][index].addend;
-            res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(long)(addr+addend));
+            res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(intptr_t)
+                                                (addr + addend));
         }
         }
     } else {
     } else {
         /* the page is not in the TLB : fill it */
         /* the page is not in the TLB : fill it */
@@ -171,7 +172,6 @@ glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
     DATA_TYPE res, res1, res2;
     DATA_TYPE res, res1, res2;
     int index, shift;
     int index, shift;
     target_phys_addr_t ioaddr;
     target_phys_addr_t ioaddr;
-    unsigned long addend;
     target_ulong tlb_addr, addr1, addr2;
     target_ulong tlb_addr, addr1, addr2;
 
 
     index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
     index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
@@ -202,8 +202,9 @@ glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
             res = (DATA_TYPE)res;
             res = (DATA_TYPE)res;
         } else {
         } else {
             /* unaligned/aligned access in the same page */
             /* unaligned/aligned access in the same page */
-            addend = env->tlb_table[mmu_idx][index].addend;
-            res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(long)(addr+addend));
+            uintptr_t addend = env->tlb_table[mmu_idx][index].addend;
+            res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(intptr_t)
+                                                (addr + addend));
         }
         }
     } else {
     } else {
         /* the page is not in the TLB : fill it */
         /* the page is not in the TLB : fill it */
@@ -258,7 +259,6 @@ void glue(glue(glue(HELPER_PREFIX, st), SUFFIX), MMUSUFFIX)(ENV_PARAM
                                                             int mmu_idx)
                                                             int mmu_idx)
 {
 {
     target_phys_addr_t ioaddr;
     target_phys_addr_t ioaddr;
-    unsigned long addend;
     target_ulong tlb_addr;
     target_ulong tlb_addr;
     uintptr_t retaddr;
     uintptr_t retaddr;
     int index;
     int index;
@@ -284,6 +284,7 @@ void glue(glue(glue(HELPER_PREFIX, st), SUFFIX), MMUSUFFIX)(ENV_PARAM
                                                    mmu_idx, retaddr);
                                                    mmu_idx, retaddr);
         } else {
         } else {
             /* aligned/unaligned access in the same page */
             /* aligned/unaligned access in the same page */
+            uintptr_t addend;
 #ifdef ALIGNED_ONLY
 #ifdef ALIGNED_ONLY
             if ((addr & (DATA_SIZE - 1)) != 0) {
             if ((addr & (DATA_SIZE - 1)) != 0) {
                 retaddr = GETPC();
                 retaddr = GETPC();
@@ -291,7 +292,8 @@ void glue(glue(glue(HELPER_PREFIX, st), SUFFIX), MMUSUFFIX)(ENV_PARAM
             }
             }
 #endif
 #endif
             addend = env->tlb_table[mmu_idx][index].addend;
             addend = env->tlb_table[mmu_idx][index].addend;
-            glue(glue(st, SUFFIX), _raw)((uint8_t *)(long)(addr+addend), val);
+            glue(glue(st, SUFFIX), _raw)((uint8_t *)(intptr_t)
+                                         (addr + addend), val);
         }
         }
     } else {
     } else {
         /* the page is not in the TLB : fill it */
         /* the page is not in the TLB : fill it */
@@ -313,7 +315,6 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(ENV_PARAM
                                                    uintptr_t retaddr)
                                                    uintptr_t retaddr)
 {
 {
     target_phys_addr_t ioaddr;
     target_phys_addr_t ioaddr;
-    unsigned long addend;
     target_ulong tlb_addr;
     target_ulong tlb_addr;
     int index, i;
     int index, i;
 
 
@@ -345,8 +346,9 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(ENV_PARAM
             }
             }
         } else {
         } else {
             /* aligned/unaligned access in the same page */
             /* aligned/unaligned access in the same page */
-            addend = env->tlb_table[mmu_idx][index].addend;
-            glue(glue(st, SUFFIX), _raw)((uint8_t *)(long)(addr+addend), val);
+            uintptr_t addend = env->tlb_table[mmu_idx][index].addend;
+            glue(glue(st, SUFFIX), _raw)((uint8_t *)(intptr_t)
+                                         (addr + addend), val);
         }
         }
     } else {
     } else {
         /* the page is not in the TLB : fill it */
         /* the page is not in the TLB : fill it */