1ce8eb11aSdp78419 2ce8eb11aSdp78419 /* 3ce8eb11aSdp78419 * CDDL HEADER START 4ce8eb11aSdp78419 * 5ce8eb11aSdp78419 * The contents of this file are subject to the terms of the 6ce8eb11aSdp78419 * Common Development and Distribution License (the "License"). 7ce8eb11aSdp78419 * You may not use this file except in compliance with the License. 8ce8eb11aSdp78419 * 9ce8eb11aSdp78419 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10ce8eb11aSdp78419 * or http://www.opensolaris.org/os/licensing. 11ce8eb11aSdp78419 * See the License for the specific language governing permissions 12ce8eb11aSdp78419 * and limitations under the License. 13ce8eb11aSdp78419 * 14ce8eb11aSdp78419 * When distributing Covered Code, include this CDDL HEADER in each 15ce8eb11aSdp78419 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16ce8eb11aSdp78419 * If applicable, add the following below this CDDL HEADER, with the 17ce8eb11aSdp78419 * fields enclosed by brackets "[]" replaced with your own identifying 18ce8eb11aSdp78419 * information: Portions Copyright [yyyy] [name of copyright owner] 19ce8eb11aSdp78419 * 20ce8eb11aSdp78419 * CDDL HEADER END 21ce8eb11aSdp78419 */ 22ce8eb11aSdp78419 23ce8eb11aSdp78419 /* 24ce8eb11aSdp78419 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25ce8eb11aSdp78419 * Use is subject to license terms. 26ce8eb11aSdp78419 */ 27ce8eb11aSdp78419 28ce8eb11aSdp78419 #ifndef _SYS_MPO_H 29ce8eb11aSdp78419 #define _SYS_MPO_H 30ce8eb11aSdp78419 31ce8eb11aSdp78419 #pragma ident "%Z%%M% %I% %E% SMI" 32ce8eb11aSdp78419 33ce8eb11aSdp78419 #ifdef __cplusplus 34ce8eb11aSdp78419 extern "C" { 35ce8eb11aSdp78419 #endif 36ce8eb11aSdp78419 37*bb57d1f5Sjc25722 #include <sys/lgrp.h> 38*bb57d1f5Sjc25722 39ce8eb11aSdp78419 /* 40ce8eb11aSdp78419 * mpo.h - Sun4v MPO common header file 41ce8eb11aSdp78419 * 42ce8eb11aSdp78419 */ 43ce8eb11aSdp78419 44ce8eb11aSdp78419 #define PROP_LG_CPU_ID "id" 45ce8eb11aSdp78419 #define PROP_LG_MASK "address-mask" 46ce8eb11aSdp78419 #define PROP_LG_LATENCY "latency" 47ce8eb11aSdp78419 #define PROP_LG_MATCH "address-match" 48ce8eb11aSdp78419 #define PROP_LG_MEM_LG "memory-latency-group" 49ce8eb11aSdp78419 #define PROP_LG_CPU "cpu" 50ce8eb11aSdp78419 #define PROP_LG_MBLOCK "mblock" 51ce8eb11aSdp78419 #define PROP_LG_BASE "base" 52ce8eb11aSdp78419 #define PROP_LG_SIZE "size" 53ce8eb11aSdp78419 #define PROP_LG_RA_PA_OFFSET "address-congruence-offset" 54ce8eb11aSdp78419 55ce8eb11aSdp78419 /* Macro to set the correspending bit if an mem-lg homeid is a member */ 56ce8eb11aSdp78419 #define HOMESET_ADD(homeset, home)\ 57ce8eb11aSdp78419 homeset |= ((int)1 << (home)) 58ce8eb11aSdp78419 59ce8eb11aSdp78419 /* Macro to check if an mem_lg homeid is a member of the homeset */ 60ce8eb11aSdp78419 #define MEM_LG_ISMEMBER(homeset, home)\ 61ce8eb11aSdp78419 ((homeset) & ((uint64_t)1 << (home))) 62ce8eb11aSdp78419 63ce8eb11aSdp78419 /* Structure to store CPU information from the MD */ 64ce8eb11aSdp78419 65ce8eb11aSdp78419 struct cpu_md { 66ce8eb11aSdp78419 uint_t home; 67ce8eb11aSdp78419 uint64_t latency; 68ce8eb11aSdp78419 }; 69ce8eb11aSdp78419 70ce8eb11aSdp78419 /* Structure to store mem-lg information from the MD */ 71ce8eb11aSdp78419 72ce8eb11aSdp78419 struct lgrp_md { 73ce8eb11aSdp78419 uint64_t id; 74ce8eb11aSdp78419 uint64_t addr_mask; 75ce8eb11aSdp78419 uint64_t addr_match; 76ce8eb11aSdp78419 uint64_t latency; 77ce8eb11aSdp78419 mde_cookie_t node; 78ce8eb11aSdp78419 int ncpu; 79ce8eb11aSdp78419 }; 80ce8eb11aSdp78419 81ce8eb11aSdp78419 /* Structure to store mblock information retrieved from the MD */ 82ce8eb11aSdp78419 83ce8eb11aSdp78419 struct mblock_md { 84ce8eb11aSdp78419 uint64_t base; 85ce8eb11aSdp78419 uint64_t size; 86ce8eb11aSdp78419 uint64_t ra_to_pa; 87ce8eb11aSdp78419 mde_cookie_t node; 88ce8eb11aSdp78419 pfn_t base_pfn; 89ce8eb11aSdp78419 pfn_t end_pfn; 90*bb57d1f5Sjc25722 mnodeset_t mnode_mask; 91ce8eb11aSdp78419 }; 92ce8eb11aSdp78419 93ce8eb11aSdp78419 /* Structure for memnode information for use by plat_pfn_to_mem_node */ 94ce8eb11aSdp78419 95ce8eb11aSdp78419 struct mnode_info { 96ce8eb11aSdp78419 pfn_t base_pfn; 97ce8eb11aSdp78419 pfn_t end_pfn; 98ce8eb11aSdp78419 }; 99ce8eb11aSdp78419 100ce8eb11aSdp78419 /* A stripe defines the portion of a mem_node that falls in one mblock */ 101ce8eb11aSdp78419 typedef struct { 102ce8eb11aSdp78419 pfn_t physbase; /* first page in mnode in the corresponding mblock */ 103ce8eb11aSdp78419 pfn_t physmax; /* last valid page in mnode in mblock */ 104ce8eb11aSdp78419 pfn_t offset; /* stripe starts at physbase - offset */ 105ce8eb11aSdp78419 int exists; /* set to 1 if mblock has memory in this mnode stripe */ 106ce8eb11aSdp78419 } mem_stripe_t; 107ce8eb11aSdp78419 108*bb57d1f5Sjc25722 /* These are used when MPO requires preallocated kvseg32 space */ 109*bb57d1f5Sjc25722 extern caddr_t mpo_heap32_buf; 110*bb57d1f5Sjc25722 extern size_t mpo_heap32_bufsz; 111ce8eb11aSdp78419 112ce8eb11aSdp78419 #ifdef __cplusplus 113ce8eb11aSdp78419 } 114ce8eb11aSdp78419 #endif 115ce8eb11aSdp78419 116ce8eb11aSdp78419 #endif /* _SYS_MPO_H */ 117