xref: /onnv-gate/usr/src/uts/common/sys/memlist.h (revision 11474:857f9db4ef05)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53446Smrj  * Common Development and Distribution License (the "License").
63446Smrj  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*11474SJonathan.Adams@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
233446Smrj  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_MEMLIST_H
270Sstevel@tonic-gate #define	_SYS_MEMLIST_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * Common memlist format, exported by boot.
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/types.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef __cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * Boot programs of version 4 and greater pass a linked list
410Sstevel@tonic-gate  * of struct memlist to the kernel.
420Sstevel@tonic-gate  */
43*11474SJonathan.Adams@Sun.COM typedef struct memlist {
44*11474SJonathan.Adams@Sun.COM 	uint64_t	ml_address;	/* starting address of memory segment */
45*11474SJonathan.Adams@Sun.COM 	uint64_t	ml_size;	/* size of same */
46*11474SJonathan.Adams@Sun.COM 	struct memlist	*ml_next;	/* link to next list element */
47*11474SJonathan.Adams@Sun.COM 	struct memlist	*ml_prev;	/* link to previous list element */
48*11474SJonathan.Adams@Sun.COM } memlist_t;
490Sstevel@tonic-gate 
500Sstevel@tonic-gate extern int address_in_memlist(struct memlist *, uint64_t, size_t);
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /*
530Sstevel@tonic-gate  * phys_install is the pointer to the physical installed memory list
540Sstevel@tonic-gate  * which may change when memory is added or deleted. The functions
550Sstevel@tonic-gate  * memlist_read_lock() and memlist_read_unlock() should be used
560Sstevel@tonic-gate  * to protect reading this list.
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate extern struct memlist *phys_install;
590Sstevel@tonic-gate 
609940SVikram.Hegde@Sun.COM #if defined(__x86)
619940SVikram.Hegde@Sun.COM /*
629940SVikram.Hegde@Sun.COM  * bios reserved memory
639940SVikram.Hegde@Sun.COM  */
649940SVikram.Hegde@Sun.COM extern struct memlist *bios_rsvd;
659940SVikram.Hegde@Sun.COM #endif
669940SVikram.Hegde@Sun.COM 
675084Sjohnlev extern pgcnt_t num_phys_pages();
685084Sjohnlev 
690Sstevel@tonic-gate #ifdef __cplusplus
700Sstevel@tonic-gate }
710Sstevel@tonic-gate #endif
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #endif	/* _SYS_MEMLIST_H */
74