xref: /illumos-gate/usr/src/uts/sun4u/serengeti/sys/sgsgn.h (revision 88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2000 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SGSGN_H
28 #define	_SGSGN_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/inttypes.h>
37 #include <sys/sysmacros.h>
38 
39 /*
40  * Type definitions for layout in I/O SRAM of CPU signatures.
41  *
42  * The cpusig array bound is a white lie.  The SC will allocate
43  * enough space for this array so that it can be indexed by any
44  * valid cpu id.  Generally, this means that there will be about
45  * NCPU entries in the array.  However, NCPU is a kernel defined
46  * value that may be larger than the actual maximum; the SC
47  * allocates based strictly on the hardware's capabilities, not on
48  * the kernel's definition of NCPU.
49  */
50 
51 typedef struct {
52 	uint32_t	magic;
53 	uint32_t	version;
54 	uint32_t	domainsig;
55 	uint32_t	pad;
56 	uint32_t	cpusig[1];
57 } sg_sgnblk_t;
58 
59 
60 /*
61  * Access to the signature block in I/O SRAM is done by calls to
62  * iosram_write(), which believes in offsets, not pointers.
63  * Below are the relevant offsets.
64  */
65 #define	SG_SGNBLK_MAGIC_OFFSET				\
66 	    (offsetof(sg_sgnblk_t, magic))
67 #define	SG_SGNBLK_VERSION_OFFSET			\
68 	    (offsetof(sg_sgnblk_t, version))
69 #define	SG_SGNBLK_DOMAINSIG_OFFSET			\
70 	    (offsetof(sg_sgnblk_t, domainsig))
71 #define	SG_SGNBLK_CPUSIG_OFFSET(cpuid)			\
72 	    (offsetof(sg_sgnblk_t, cpusig) + (cpuid)*sizeof (uint32_t))
73 
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif	/* _SGSGN_H */
80