vm: remove B_RANDOMIZED_IMAGE_ADDRESS address specification

This address specification is actually not needed since PIC images can be
located anywhere. Only their size is restriced but that is the compiler and
linker concern. Thanks to Alex Smith for pointing that out.
This commit is contained in:
Pawel Dziepak 2013-04-09 22:09:13 +02:00
parent d57105534b
commit bf65fc1dfe
5 changed files with 5 additions and 19 deletions

View File

@ -81,7 +81,6 @@ typedef struct area_info {
/* B_ANY_KERNEL_BLOCK_ADDRESS 5 */
#define B_RANDOMIZED_ANY_ADDRESS 6
#define B_RANDOMIZED_BASE_ADDRESS 7
#define B_RANDOMIZED_IMAGE_ADDRESS 8
/* area protection */
#define B_READ_AREA 1

View File

@ -36,7 +36,6 @@ const addr_t VMUserAddressSpace::kMaxInitialRandomize = 0x20000000000ul;
const addr_t VMUserAddressSpace::kMaxRandomize = 0x800000ul;
const addr_t VMUserAddressSpace::kMaxInitialRandomize = 0x2000000ul;
#endif
const addr_t VMUserAddressSpace::kImageEndAddress = 0x7ffffffful;
/*! Verifies that an area with the given aligned base and size fits into
@ -74,8 +73,7 @@ static inline bool
is_randomized(uint32 addressSpec)
{
return addressSpec == B_RANDOMIZED_ANY_ADDRESS
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS
|| addressSpec == B_RANDOMIZED_IMAGE_ADDRESS;
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS;
}
@ -189,11 +187,6 @@ VMUserAddressSpace::InsertArea(VMArea* _area, size_t size,
searchEnd = fEndAddress;
break;
case B_RANDOMIZED_IMAGE_ADDRESS:
searchBase = (addr_t)addressRestrictions->address;
searchEnd = min_c(fEndAddress, kImageEndAddress);
break;
default:
return B_BAD_VALUE;
}
@ -577,9 +570,7 @@ VMUserAddressSpace::_InsertAreaSlot(addr_t start, addr_t size, addr_t end,
start = ROUNDUP(start, alignment);
if (addressSpec == B_RANDOMIZED_BASE_ADDRESS
|| addressSpec == B_RANDOMIZED_IMAGE_ADDRESS) {
if (addressSpec == B_RANDOMIZED_BASE_ADDRESS) {
originalStart = start;
start = _RandomizeAddress(start, end - size, alignment, true);
}
@ -606,7 +597,6 @@ second_chance:
case B_RANDOMIZED_ANY_ADDRESS:
case B_BASE_ADDRESS:
case B_RANDOMIZED_BASE_ADDRESS:
case B_RANDOMIZED_IMAGE_ADDRESS:
{
// find a hole big enough for a new area
if (last == NULL) {
@ -671,8 +661,7 @@ second_chance:
area->SetBase(alignedBase);
break;
} else if (addressSpec == B_BASE_ADDRESS
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS
|| addressSpec == B_RANDOMIZED_IMAGE_ADDRESS) {
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS) {
// we didn't find a free spot in the requested range, so we'll
// try again without any restrictions

View File

@ -67,7 +67,6 @@ private:
private:
static const addr_t kMaxRandomize;
static const addr_t kMaxInitialRandomize;
static const addr_t kImageEndAddress;
VMUserAreaList fAreas;
mutable VMUserArea* fAreaHint;

View File

@ -1226,7 +1226,6 @@ vm_create_anonymous_area(team_id team, const char *name, addr_t size,
case B_ANY_KERNEL_BLOCK_ADDRESS:
case B_RANDOMIZED_ANY_ADDRESS:
case B_RANDOMIZED_BASE_ADDRESS:
case B_RANDOMIZED_IMAGE_ADDRESS:
break;
default:

View File

@ -173,7 +173,7 @@ get_image_region_load_address(image_t* image, uint32 index, long lastDelta,
if (index == 0) {
// but only the first segment gets a free ride
loadAddress = RLD_PROGRAM_BASE;
addressSpecifier = B_RANDOMIZED_IMAGE_ADDRESS;
addressSpecifier = B_RANDOMIZED_BASE_ADDRESS;
} else {
loadAddress = image->regions[index].vmstart + lastDelta;
addressSpecifier = B_EXACT_ADDRESS;
@ -298,7 +298,7 @@ map_image(int fd, char const* path, image_t* image, bool fixed)
addr_t loadAddress;
size_t reservedSize = 0;
size_t length = 0;
uint32 addressSpecifier = B_RANDOMIZED_IMAGE_ADDRESS;
uint32 addressSpecifier = B_RANDOMIZED_ANY_ADDRESS;
for (uint32 i = 0; i < image->num_regions; i++) {
// for BeOS compatibility: if we load an old BeOS executable, we