|
@@ -96,7 +96,8 @@ EXPORT_SYMBOL_GPL(e820__mapped_any);
|
|
* Note: this function only works correctly once the E820 table is sorted and
|
|
* Note: this function only works correctly once the E820 table is sorted and
|
|
* not-overlapping (at least for the range specified), which is the case normally.
|
|
* not-overlapping (at least for the range specified), which is the case normally.
|
|
*/
|
|
*/
|
|
-bool __init e820__mapped_all(u64 start, u64 end, enum e820_type type)
|
|
|
|
|
|
+static struct e820_entry *__e820__mapped_all(u64 start, u64 end,
|
|
|
|
+ enum e820_type type)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -122,9 +123,28 @@ bool __init e820__mapped_all(u64 start, u64 end, enum e820_type type)
|
|
* coverage of the desired range exists:
|
|
* coverage of the desired range exists:
|
|
*/
|
|
*/
|
|
if (start >= end)
|
|
if (start >= end)
|
|
- return 1;
|
|
|
|
|
|
+ return entry;
|
|
}
|
|
}
|
|
- return 0;
|
|
|
|
|
|
+
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * This function checks if the entire range <start,end> is mapped with type.
|
|
|
|
+ */
|
|
|
|
+bool __init e820__mapped_all(u64 start, u64 end, enum e820_type type)
|
|
|
|
+{
|
|
|
|
+ return __e820__mapped_all(start, end, type);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * This function returns the type associated with the range <start,end>.
|
|
|
|
+ */
|
|
|
|
+int e820__get_entry_type(u64 start, u64 end)
|
|
|
|
+{
|
|
|
|
+ struct e820_entry *entry = __e820__mapped_all(start, end, 0);
|
|
|
|
+
|
|
|
|
+ return entry ? entry->type : -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|