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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
33 #include <sys/types.h>
37 * Memory Device Minor Numbers
39 #define M_MEM 0 /* /dev/mem - physical main memory */
40 #define M_KMEM 1 /* /dev/kmem - virtual kernel memory */
41 #define M_NULL 2 /* /dev/null - EOF & Rathole */
42 #define M_ALLKMEM 3 /* /dev/allkmem - virtual kernel memory & I/O */
43 #define M_ZERO 12 /* /dev/zero - source of private memory */
46 * Private ioctl for libkvm: translate virtual address to physical address.
48 #define MEM_VTOP (('M' << 8) | 0x01)
50 typedef struct mem_vtop
{
56 #if defined(_SYSCALL32)
57 typedef struct mem_vtop32
{
65 * Private ioctls for fmd(1M). These interfaces are Sun Private. Applications
66 * and drivers should not make use of these interfaces: they can change without
67 * notice and programs that consume them will fail to run on future releases.
69 #define MEM_NAME (('M' << 8) | 0x04)
70 #define MEM_INFO (('M' << 8) | 0x05)
72 #define MEM_PAGE_RETIRE (('M' << 8) | 0x02)
73 #define MEM_PAGE_ISRETIRED (('M' << 8) | 0x03)
74 #define MEM_PAGE_UNRETIRE (('M' << 8) | 0x06)
75 #define MEM_PAGE_GETERRORS (('M' << 8) | 0x07)
76 #define MEM_PAGE_RETIRE_MCE (('M' << 8) | 0x08)
77 #define MEM_PAGE_RETIRE_UE (('M' << 8) | 0x09)
78 #define MEM_PAGE_RETIRE_TEST (('M' << 8) | 0x0A)
80 #define MEM_SID (('M' << 8) | 0x0B)
83 * Bits returned from MEM_PAGE_GETERRORS ioctl for use by fmd(1M).
85 #define MEM_PAGE_ERR_NONE 0x0
86 #define MEM_PAGE_ERR_MULTI_CE 0x1
87 #define MEM_PAGE_ERR_UE 0x2
88 #define MEM_PAGE_ERR_FMA_REQ 0x8
90 #define MEM_FMRI_MAX_BUFSIZE 8192 /* maximum allowed packed FMRI size */
92 typedef struct mem_name
{
93 uint64_t m_addr
; /* memory address */
94 uint64_t m_synd
; /* architecture-specific syndrome */
95 uint64_t m_type
[2]; /* architecture-specific type */
96 caddr_t m_name
; /* memory name buffer */
97 size_t m_namelen
; /* memory name buffer length */
98 caddr_t m_sid
; /* memory serial id buffer */
99 size_t m_sidlen
; /* memory serial id buffer length */
102 #if defined(_SYSCALL32)
103 typedef struct mem_name32
{
112 #endif /* _SYSCALL32 */
114 typedef struct mem_info
{
115 uint64_t m_addr
; /* memory address */
116 uint64_t m_synd
; /* architecture-specific syndrome */
117 uint64_t m_mem_size
; /* total memory size */
118 uint64_t m_seg_size
; /* segment size */
119 uint64_t m_bank_size
; /* bank size */
120 int m_segments
; /* # of segments */
121 int m_banks
; /* # of banks in segment */
122 int m_mcid
; /* associated memory controller id */
127 extern pfn_t
impl_obmem_pfnum(pfn_t
);
129 extern int plat_mem_do_mmio(struct uio
*, enum uio_rw
);
137 #endif /* _SYS_MEM_H */