959 |
unsigned long end = 1 << VALBITS; /* 256MB */ |
unsigned long end = 1 << VALBITS; /* 256MB */ |
960 |
void *ptr = NULL; |
void *ptr = NULL; |
961 |
|
|
962 |
#define NTHEAP_PROBE_BASE 1 |
#define NTHEAP_PROBE_BASE 0 |
963 |
#if NTHEAP_PROBE_BASE /* This is never normally defined */ |
#if NTHEAP_PROBE_BASE /* This is never normally defined */ |
964 |
|
/* Macros in gbc.c depend on DBEGIN being divisible by 32 */ |
965 |
/* Try various addresses looking for one the kernel will let us have. */ |
/* Try various addresses looking for one the kernel will let us have. */ |
966 |
while (!ptr && (base < end)) |
while (!ptr && (base < end)) |
967 |
{ |
{ |
971 |
MEM_RESERVE, |
MEM_RESERVE, |
972 |
PAGE_NOACCESS); |
PAGE_NOACCESS); |
973 |
base += 0x00100000; /* 1MB increment */ |
base += 0x00100000; /* 1MB increment */ |
974 |
DBEGIN = ptr; |
DBEGIN = (DBEGIN_TY) ptr; |
975 |
} |
} |
976 |
#else |
#else |
977 |
reserved_heap_size = end - base; |
reserved_heap_size = end - base; |
979 |
get_reserved_heap_size (), |
get_reserved_heap_size (), |
980 |
MEM_RESERVE, |
MEM_RESERVE, |
981 |
PAGE_NOACCESS); |
PAGE_NOACCESS); |
982 |
DBEGIN = ptr; |
DBEGIN = (DBEGIN_TY) ptr; |
983 |
#endif |
#endif |
984 |
|
|
985 |
return ptr; |
return ptr; |