17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*986fd29aSsetje * Common Development and Distribution License (the "License"). 6*986fd29aSsetje * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*986fd29aSsetje * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_MEMLIST_PLAT_H 277c478bd9Sstevel@tonic-gate #define _SYS_MEMLIST_PLAT_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate /* 327c478bd9Sstevel@tonic-gate * Boot time configuration information objects 337c478bd9Sstevel@tonic-gate */ 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #include <sys/types.h> 367c478bd9Sstevel@tonic-gate #include <sys/memlist.h> 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate #ifdef __cplusplus 397c478bd9Sstevel@tonic-gate extern "C" { 407c478bd9Sstevel@tonic-gate #endif 417c478bd9Sstevel@tonic-gate 42*986fd29aSsetje /* 43*986fd29aSsetje * The prom hands us an array of these 44*986fd29aSsetje * as available and installed props 45*986fd29aSsetje */ 46*986fd29aSsetje typedef struct prom_memlist { 47*986fd29aSsetje u_longlong_t addr; 48*986fd29aSsetje u_longlong_t size; 49*986fd29aSsetje } prom_memlist_t; 50*986fd29aSsetje 517c478bd9Sstevel@tonic-gate extern int check_boot_version(int); 52*986fd29aSsetje extern void copy_memlist(prom_memlist_t *, size_t, struct memlist **); 53*986fd29aSsetje extern void size_physavail(prom_memlist_t *physavail, size_t size, 547c478bd9Sstevel@tonic-gate pgcnt_t *npages, int *memblocks); 55*986fd29aSsetje extern pgcnt_t size_virtalloc(prom_memlist_t *avail, size_t size); 56*986fd29aSsetje extern void installed_top_size_memlist_array(prom_memlist_t *, size_t, pfn_t *, 577c478bd9Sstevel@tonic-gate pgcnt_t *); 587c478bd9Sstevel@tonic-gate extern void installed_top_size(struct memlist *, pfn_t *, pgcnt_t *); 597c478bd9Sstevel@tonic-gate extern void fix_prom_pages(struct memlist *, struct memlist *); 60*986fd29aSsetje extern void init_boot_memlists(void); 61*986fd29aSsetje extern void copy_boot_memlists( 62*986fd29aSsetje prom_memlist_t **physinstalled, size_t *physinstalled_len, 63*986fd29aSsetje prom_memlist_t **physavail, size_t *physavail_len, 64*986fd29aSsetje prom_memlist_t **virtavail, size_t *virtavail_len); 657c478bd9Sstevel@tonic-gate extern void phys_install_has_changed(void); 667c478bd9Sstevel@tonic-gate 67*986fd29aSsetje extern void diff_memlists(struct memlist *, struct memlist *, 68*986fd29aSsetje void (*)(uint64_t, uint64_t)); 69*986fd29aSsetje extern void sync_memlists(struct memlist *, struct memlist *); 70*986fd29aSsetje 717c478bd9Sstevel@tonic-gate #ifdef __cplusplus 727c478bd9Sstevel@tonic-gate } 737c478bd9Sstevel@tonic-gate #endif 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate #endif /* _SYS_MEMLIST_PLAT_H */ 76