2004-10-19 16:57:19 +00:00
|
|
|
/*
|
2010-05-27 11:50:40 +00:00
|
|
|
* Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2007-01-08 12:14:06 +00:00
|
|
|
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-05-31 22:41:25 +00:00
|
|
|
#ifndef KERNEL_BOOT_ADDR_RANGE_H
|
|
|
|
#define KERNEL_BOOT_ADDR_RANGE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct addr_range {
|
|
|
|
addr_t start;
|
2010-05-27 11:50:40 +00:00
|
|
|
size_t size;
|
2004-05-31 22:41:25 +00:00
|
|
|
} addr_range;
|
|
|
|
|
2007-01-08 12:14:06 +00:00
|
|
|
|
2010-05-27 11:50:40 +00:00
|
|
|
typedef struct phys_addr_range {
|
|
|
|
phys_addr_t start;
|
|
|
|
phys_size_t size;
|
|
|
|
} phys_addr_range;
|
|
|
|
|
|
|
|
|
2004-10-19 16:57:19 +00:00
|
|
|
#ifdef __cplusplus
|
2007-01-08 12:14:06 +00:00
|
|
|
extern "C" {
|
2004-10-19 16:57:19 +00:00
|
|
|
#endif
|
2007-01-08 12:14:06 +00:00
|
|
|
|
2010-05-27 11:50:40 +00:00
|
|
|
status_t insert_address_range(addr_range* ranges, uint32* _numRanges,
|
|
|
|
uint32 maxRanges, addr_t start, size_t size);
|
|
|
|
status_t remove_address_range(addr_range* ranges, uint32* _numRanges,
|
|
|
|
uint32 maxRanges, addr_t start, size_t size);
|
|
|
|
bool get_free_address_range(addr_range* ranges, uint32 numRanges, addr_t base,
|
|
|
|
size_t size, addr_t* _rangeBase);
|
|
|
|
bool is_address_range_covered(addr_range* ranges, uint32 numRanges, addr_t base,
|
2010-05-05 21:09:11 +00:00
|
|
|
size_t size);
|
2010-05-27 17:08:47 +00:00
|
|
|
void sort_address_ranges(addr_range* ranges, uint32 numRanges);
|
2007-01-08 12:14:06 +00:00
|
|
|
|
2010-05-27 11:50:40 +00:00
|
|
|
status_t insert_physical_address_range(phys_addr_range* ranges,
|
|
|
|
uint32* _numRanges, uint32 maxRanges, phys_addr_t start, phys_size_t size);
|
|
|
|
status_t remove_physical_address_range(phys_addr_range* ranges,
|
|
|
|
uint32* _numRanges, uint32 maxRanges, phys_addr_t start, phys_size_t size);
|
|
|
|
bool get_free_physical_address_range(phys_addr_range* ranges, uint32 numRanges,
|
|
|
|
phys_addr_t base, phys_size_t size, phys_addr_t* _rangeBase);
|
|
|
|
bool is_physical_address_range_covered(phys_addr_range* ranges,
|
|
|
|
uint32 numRanges, phys_addr_t base, phys_size_t size);
|
2010-05-27 17:08:47 +00:00
|
|
|
void sort_physical_address_ranges(phys_addr_range* ranges, uint32 numRanges);
|
2010-05-27 11:50:40 +00:00
|
|
|
|
|
|
|
status_t insert_physical_memory_range(phys_addr_t start, phys_size_t size);
|
|
|
|
status_t insert_physical_allocated_range(phys_addr_t start, phys_size_t size);
|
|
|
|
status_t insert_virtual_allocated_range(addr_t start, size_t size);
|
2010-06-23 11:10:01 +00:00
|
|
|
void ignore_physical_memory_ranges_beyond_4gb();
|
2007-01-08 12:14:06 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2004-10-19 16:57:19 +00:00
|
|
|
|
2004-05-31 22:41:25 +00:00
|
|
|
#endif /* KERNEL_BOOT_ADDR_RANGE_H */
|