xref: /titanic_50/usr/src/uts/common/sys/memlist.h (revision 634e26ec75c89095090605284938356a3145f2b8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_MEMLIST_H
27 #define	_SYS_MEMLIST_H
28 
29 /*
30  * Common memlist format, exported by boot.
31  */
32 
33 #include <sys/types.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Boot programs of version 4 and greater pass a linked list
41  * of struct memlist to the kernel.
42  */
43 typedef struct memlist {
44 	uint64_t	ml_address;	/* starting address of memory segment */
45 	uint64_t	ml_size;	/* size of same */
46 	struct memlist	*ml_next;	/* link to next list element */
47 	struct memlist	*ml_prev;	/* link to previous list element */
48 } memlist_t;
49 
50 extern int address_in_memlist(struct memlist *, uint64_t, size_t);
51 
52 /*
53  * phys_install is the pointer to the physical installed memory list
54  * which may change when memory is added or deleted. The functions
55  * memlist_read_lock() and memlist_read_unlock() should be used
56  * to protect reading this list.
57  */
58 extern struct memlist *phys_install;
59 
60 #if defined(__x86)
61 /*
62  * bios reserved memory
63  */
64 extern struct memlist *bios_rsvd;
65 #endif
66 
67 extern pgcnt_t num_phys_pages();
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif	/* _SYS_MEMLIST_H */
74