xref: /titanic_41/usr/src/uts/common/sys/memlist.h (revision b7d3956b92a285d8dac2c7f5f7e28d2ef5347ef8)
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 2007 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 #pragma ident	"%Z%%M%	%I%	%E% SMI" /* SunOS-4.0 1.7 */
30 
31 /*
32  * Common memlist format, exported by boot.
33  */
34 
35 #include <sys/types.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /*
42  * Boot programs of version 4 and greater pass a linked list
43  * of struct memlist to the kernel.
44  */
45 struct memlist {
46 	uint64_t	address;	/* starting address of memory segment */
47 	uint64_t	size;		/* size of same */
48 	struct memlist	*next;		/* link to next list element */
49 	struct memlist	*prev;		/* link to previous list element */
50 };
51 
52 extern int address_in_memlist(struct memlist *, uint64_t, size_t);
53 
54 /*
55  * phys_install is the pointer to the physical installed memory list
56  * which may change when memory is added or deleted. The functions
57  * memlist_read_lock() and memlist_read_unlock() should be used
58  * to protect reading this list.
59  */
60 extern struct memlist *phys_install;
61 
62 extern pgcnt_t num_phys_pages();
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif	/* _SYS_MEMLIST_H */
69