1/*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef KERNEL_BOOT_ADDR_RANGE_H
7#define KERNEL_BOOT_ADDR_RANGE_H
8
9
10#include <SupportDefs.h>
11
12
13typedef struct addr_range {
14	uint64 start;
15	uint64 size;
16} _PACKED addr_range;
17
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23status_t insert_address_range(addr_range* ranges, uint32* _numRanges,
24	uint32 maxRanges, uint64 start, uint64 size);
25status_t remove_address_range(addr_range* ranges, uint32* _numRanges,
26	uint32 maxRanges, uint64 start, uint64 size);
27bool get_free_address_range(addr_range* ranges, uint32 numRanges, uint64 base,
28	uint64 size, uint64* _rangeBase);
29bool is_address_range_covered(addr_range* ranges, uint32 numRanges, uint64 base,
30	uint64 size);
31void sort_address_ranges(addr_range* ranges, uint32 numRanges);
32
33status_t insert_physical_memory_range(uint64 start, uint64 size);
34status_t insert_physical_allocated_range(uint64 start, uint64 size);
35status_t insert_virtual_allocated_range(uint64 start, uint64 size);
36void ignore_physical_memory_ranges_beyond_4gb();
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif	/* KERNEL_BOOT_ADDR_RANGE_H */
43