Commit fa69f349 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

... and as I expected, that hack breaks on all sorts of other systems,

so #ifdef __FreeBSD__, which is OK, since the intent is just to get
VTEST code coverage.
parent a50db76f
......@@ -144,7 +144,6 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av)
struct smp_sign sgn;
void *target;
int i, mmap_flags;
uintptr_t up;
ASSERT_MGT();
......@@ -213,6 +212,7 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av)
mmap_flags |= MAP_EXCL;
#endif
} else {
#ifdef __FreeBSD__
/*
* I guess the people who came up with ASLR never learned
* that virtual memory can have benficial uses, because they
......@@ -222,11 +222,13 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av)
* can get away with just hacking something up: 16M below
* the break seems to work on FreeBSD.
*/
uintptr_t up;
up = (uintptr_t)sbrk(0);
up -= 1ULL<<24;
up -= sc->mediasize;
up &= ~(getpagesize() - 1ULL);
target = (void *)up;
#endif
#ifdef MAP_ALIGNED_SUPER
mmap_flags |= MAP_ALIGNED_SUPER;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment