|
@@ -2100,25 +2100,6 @@ unsigned long get_random_long(void)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(get_random_long);
|
|
EXPORT_SYMBOL(get_random_long);
|
|
|
|
|
|
-/*
|
|
|
|
- * randomize_range() returns a start address such that
|
|
|
|
- *
|
|
|
|
- * [...... <range> .....]
|
|
|
|
- * start end
|
|
|
|
- *
|
|
|
|
- * a <range> with size "len" starting at the return value is inside in the
|
|
|
|
- * area defined by [start, end], but is otherwise randomized.
|
|
|
|
- */
|
|
|
|
-unsigned long
|
|
|
|
-randomize_range(unsigned long start, unsigned long end, unsigned long len)
|
|
|
|
-{
|
|
|
|
- unsigned long range = end - len - start;
|
|
|
|
-
|
|
|
|
- if (end <= start + len)
|
|
|
|
- return 0;
|
|
|
|
- return PAGE_ALIGN(get_random_int() % range + start);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* randomize_page - Generate a random, page aligned address
|
|
* randomize_page - Generate a random, page aligned address
|
|
* @start: The smallest acceptable address the caller will take.
|
|
* @start: The smallest acceptable address the caller will take.
|