Cross Reference: mem_mdesc.h
xref
: /
osnet-11
/
usr
/
src
/
lib
/
fm
/
topo
/
modules
/
sun4v
/
platform-mem
/
common
/
mem_mdesc.h
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
2
N/A
/*
2
N/A
* CDDL HEADER START
2
N/A
*
2
N/A
* The contents of this file are subject to the terms of the
2
N/A
* Common Development and Distribution License (the "License").
2
N/A
* You may not use this file except in compliance with the License.
2
N/A
*
2
N/A
* You can obtain a copy of the license at
usr
/
src
/
OPENSOLARIS.LICENSE
2
N/A
* or
http://www.opensolaris.org/os/licensing
.
2
N/A
* See the License for the specific language governing permissions
2
N/A
* and limitations under the License.
2
N/A
*
2
N/A
* When distributing Covered Code, include this CDDL HEADER in each
2
N/A
* file and include the License file at
usr
/
src
/
OPENSOLARIS.LICENSE
.
2
N/A
* If applicable, add the following below this CDDL HEADER, with the
2
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
2
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
2
N/A
*
2
N/A
* CDDL HEADER END
2
N/A
*/
2
N/A
2
N/A
/*
2
N/A
* Copyright (c) 2010, 2011, Oracle
and
/
or
its affiliates. All rights reserved.
2
N/A
*/
2
N/A
2
N/A
#
ifndef
_MEM_MDESC_H
2
N/A
#
define
_MEM_MDESC_H
2
N/A
2
N/A
#
include
<
fm
/
topo_mod.h
>
2
N/A
#
include
<
sys
/
fm
/
ldom.h
>
2
N/A
2
N/A
#
ifdef
__cplusplus
2
N/A
extern
"C"
{
2
N/A
#
endif
2
N/A
2
N/A
#
define
MEM_DIMM_MAX
8
/* max FB DIMM depth */
2
N/A
2
N/A
#
ifndef
MIN
2
N/A
#
define
MIN
(x, y) ((x) < (y) ? (x) : (y))
2
N/A
#
endif
2
N/A
2
N/A
#
ifndef
MAX
2
N/A
#
define
MAX
(x, y) ((x) > (y) ? (x) : (y))
2
N/A
#
endif
2
N/A
2
N/A
typedef
struct
mem_dimm_map
{
2
N/A
struct
mem_dimm_map
*
dm_next
;
/* The next DIMM map */
2
N/A
char
*
dm_label
;
/* The UNUM for this DIMM */
2
N/A
char
*
dm_serid
;
/* Cached serial number */
2
N/A
char
*
dm_part
;
/* DIMM part number */
2
N/A
uint64_t
dm_drgen
;
/* DR gen count for cached S/N */
2
N/A
}
mem_dimm_map_t
;
2
N/A
2
N/A
typedef
struct
mem_dimm_list
{
2
N/A
struct
mem_dimm_list
*
dl_next
;
2
N/A
mem_dimm_map_t
*
dl_dimm
;
2
N/A
}
mem_dimm_list_t
;
2
N/A
2
N/A
typedef
struct
mem_bank_map
{
2
N/A
struct
mem_bank_map
*
bm_next
;
/* the next bank map overall */
2
N/A
struct
mem_bank_map
*
bm_grp
;
/* next bank map in group */
2
N/A
uint64_t
bm_mask
;
2
N/A
uint64_t
bm_match
;
2
N/A
uint16_t
bm_shift
;
/* dimms-per-reference shift */
2
N/A
mem_dimm_list_t
*
bm_dlist
;
2
N/A
}
mem_bank_map_t
;
2
N/A
2
N/A
typedef
struct
mem_grp
{
2
N/A
struct
mem_grp
*
mg_next
;
2
N/A
size_t
mg_size
;
2
N/A
mem_bank_map_t
*
mg_bank
;
2
N/A
}
mem_grp_t
;
2
N/A
2
N/A
typedef
struct
mem_seg_map
{
2
N/A
struct
mem_seg_map
*
sm_next
;
/* the next segment map */
2
N/A
uint64_t
sm_base
;
/* base address for this segment */
2
N/A
uint64_t
sm_size
;
/* size for this segment */
2
N/A
mem_grp_t
*
sm_grp
;
2
N/A
}
mem_seg_map_t
;
2
N/A
2
N/A
typedef
struct
md_mem_info
{
2
N/A
mem_dimm_map_t
*
mem_dm
;
/* List supported DIMMs */
2
N/A
/* uint64_t mem_memconfig; HV memory-configuration-id# */
2
N/A
mem_seg_map_t
*
mem_seg
;
/* list of defined segments */
2
N/A
mem_bank_map_t
*
mem_bank
;
2
N/A
mem_grp_t
*
mem_group
;
/* groups of banks for a segment */
2
N/A
}
md_mem_info_t
;
2
N/A
2
N/A
extern
int
mem_mdesc_init
(
topo_mod_t
*,
md_mem_info_t
*);
2
N/A
extern
void
mem_mdesc_fini
(
topo_mod_t
*,
md_mem_info_t
*);
2
N/A
extern
mem_dimm_map_t
*
mem_get_dimm_by_sn
(
char
*,
md_mem_info_t
*);
2
N/A
extern
void
*
mem_alloc
(
size_t
);
2
N/A
extern
void
mem_free
(
void
*,
size_t
);
2
N/A
2
N/A
#
ifdef
__cplusplus
2
N/A
}
2
N/A
#
endif
2
N/A
2
N/A
#
endif
/* _MEM_MDESC_H */