VirtualBox

Changeset 647 in vbox


Ignore:
Timestamp:
Feb 5, 2007 6:33:16 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18280
Message:

VALID_PTR update: when running 32-bit in compatability mode, there might be close to 4GB of memory available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r331 r647  
    10291029 * @param   ptr
    10301030 */
    1031 #ifdef IN_RING3
    1032 # ifdef __L4__
    1033 #  define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x10000 >= 0x11000 )
    1034 # elif defined(__DARWIN__)
    1035 #  define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x200000 >= 0x201000 )
    1036 # else
    1037 #  define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x10000 >= 0x20000 )
    1038 # endif
    1039 #else
    1040 #  define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x1000 >= 0x2000 )
     1031#if defined(__AMD64__)
     1032# ifdef IN_RING3
     1033#  if defined(__DARWIN__) /* first 4GB is reserved for legacy kernel. */
     1034#   define VALID_PTR(ptr)   (   (uintptr_t)(ptr) >= _4G \
     1035                             && !((uintptr_t)(ptr) & 0xffff800000000000ULL) )
     1036#  else
     1037#   define VALID_PTR(ptr)   (   (uintptr_t)(ptr) + 0x1000U >= 0x2000U \
     1038                             && !((uintptr_t)(ptr) & 0xffff800000000000ULL) )
     1039#  endif               
     1040# else /* !IN_RING3 */
     1041#  define VALID_PTR(ptr)    (   (uintptr_t)(ptr) + 0x1000U >= 0x2000U \
     1042                             && (   ((uintptr_t)(ptr) & 0xffff800000000000ULL) == 0xffff800000000000ULL \
     1043                                 || ((uintptr_t)(ptr) & 0xffff800000000000ULL) == 0) )
     1044# endif /* !IN_RING3 */
     1045#elif defined(__X86__)
     1046# define VALID_PTR(ptr)     ( (uintptr_t)(ptr) + 0x1000U >= 0x2000U )
     1047#else
     1048# error "Architecture identifier missing / not implemented."
    10411049#endif
    10421050
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