VirtualBox

Changeset 42601 in vbox for trunk/src/recompiler/cpu-all.h


Ignore:
Timestamp:
Aug 5, 2012 4:26:25 PM (12 years ago)
Author:
vboxsync
Message:

REM: Initial changes to make it work (seemingly) with MinGW-w64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/cpu-all.h

    r37702 r42601  
    774774 */
    775775#if defined(CONFIG_USE_GUEST_BASE)
    776 extern unsigned long guest_base;
     776extern uintptr_t guest_base;
    777777extern int have_guest_base;
    778 extern unsigned long reserved_va;
     778extern uintptr_t reserved_va;
    779779#define GUEST_BASE guest_base
    780780#define RESERVED_VA reserved_va
     
    785785
    786786/* All direct uses of g2h and h2g need to go away for usermode softmmu.  */
    787 #define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE))
     787#define g2h(x) ((void *)((uintptr_t)(x) + GUEST_BASE))
    788788
    789789#if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
     
    791791#else
    792792#define h2g_valid(x) ({ \
    793     unsigned long __guest = (unsigned long)(x) - GUEST_BASE; \
     793    uintptr_t __guest = (uintptr_t)(x) - GUEST_BASE; \
    794794    __guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS); \
    795795})
     
    797797
    798798#define h2g(x) ({ \
    799     unsigned long __ret = (unsigned long)(x) - GUEST_BASE; \
     799    uintptr_t __ret = (uintptr_t)(x) - GUEST_BASE; \
    800800    /* Check if given address fits target address space */ \
    801801    assert(h2g_valid(x)); \
     
    809809/* NOTE: we use double casts if pointers and target_ulong have
    810810   different sizes */
    811 #define saddr(x) (uint8_t *)(long)(x)
    812 #define laddr(x) (uint8_t *)(long)(x)
     811#define saddr(x) (uint8_t *)(intptr_t)(x)
     812#define laddr(x) (uint8_t *)(intptr_t)(x)
    813813#endif
    814814
     
    877877#define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK)
    878878
    879 /* ??? These should be the larger of unsigned long and target_ulong.  */
    880 extern unsigned long qemu_real_host_page_size;
    881 extern unsigned long qemu_host_page_bits;
    882 extern unsigned long qemu_host_page_size;
    883 extern unsigned long qemu_host_page_mask;
     879/* ??? These should be the larger of uintptr_t and target_ulong.  */
     880extern size_t qemu_real_host_page_size;
     881extern size_t qemu_host_page_bits;
     882extern size_t qemu_host_page_size;
     883extern uintptr_t qemu_host_page_mask;
    884884
    885885#define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask)
     
    903903
    904904typedef int (*walk_memory_regions_fn)(void *, abi_ulong,
    905                                       abi_ulong, unsigned long);
     905                                      abi_ulong, uintptr_t);
    906906int walk_memory_regions(void *, walk_memory_regions_fn);
    907907
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette