2004-10-19 20:57:19 +04:00
|
|
|
/*
|
2010-05-27 15:50:40 +04:00
|
|
|
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2007-01-08 15:14:06 +03:00
|
|
|
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-06-01 02:41:25 +04:00
|
|
|
#ifndef KERNEL_BOOT_ADDR_RANGE_H
|
|
|
|
#define KERNEL_BOOT_ADDR_RANGE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct addr_range {
|
2012-06-20 17:11:24 +04:00
|
|
|
uint64 start;
|
|
|
|
uint64 size;
|
2012-06-21 21:02:23 +04:00
|
|
|
} _PACKED addr_range;
|
2004-06-01 02:41:25 +04:00
|
|
|
|
2007-01-08 15:14:06 +03:00
|
|
|
|
2004-10-19 20:57:19 +04:00
|
|
|
#ifdef __cplusplus
|
2007-01-08 15:14:06 +03:00
|
|
|
extern "C" {
|
2004-10-19 20:57:19 +04:00
|
|
|
#endif
|
2007-01-08 15:14:06 +03:00
|
|
|
|
2010-05-27 15:50:40 +04:00
|
|
|
status_t insert_address_range(addr_range* ranges, uint32* _numRanges,
|
2012-06-20 17:11:24 +04:00
|
|
|
uint32 maxRanges, uint64 start, uint64 size);
|
2010-05-27 15:50:40 +04:00
|
|
|
status_t remove_address_range(addr_range* ranges, uint32* _numRanges,
|
2012-06-20 17:11:24 +04:00
|
|
|
uint32 maxRanges, uint64 start, uint64 size);
|
|
|
|
bool get_free_address_range(addr_range* ranges, uint32 numRanges, uint64 base,
|
|
|
|
uint64 size, uint64* _rangeBase);
|
|
|
|
bool is_address_range_covered(addr_range* ranges, uint32 numRanges, uint64 base,
|
|
|
|
uint64 size);
|
2020-05-26 02:17:34 +03:00
|
|
|
uint64 total_address_ranges_size(addr_range* ranges, uint32 numRanges);
|
2010-05-27 21:08:47 +04:00
|
|
|
void sort_address_ranges(addr_range* ranges, uint32 numRanges);
|
2007-01-08 15:14:06 +03:00
|
|
|
|
2012-06-21 22:48:03 +04:00
|
|
|
status_t insert_physical_memory_range(uint64 start, uint64 size);
|
2020-05-26 02:17:34 +03:00
|
|
|
status_t remove_physical_memory_range(uint64 start, uint64 size);
|
|
|
|
uint64 total_physical_memory();
|
|
|
|
|
2012-06-21 22:48:03 +04:00
|
|
|
status_t insert_physical_allocated_range(uint64 start, uint64 size);
|
2012-06-20 17:11:24 +04:00
|
|
|
status_t insert_virtual_allocated_range(uint64 start, uint64 size);
|
2010-06-23 15:10:01 +04:00
|
|
|
void ignore_physical_memory_ranges_beyond_4gb();
|
2007-01-08 15:14:06 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2004-10-19 20:57:19 +04:00
|
|
|
|
2004-06-01 02:41:25 +04:00
|
|
|
#endif /* KERNEL_BOOT_ADDR_RANGE_H */
|