xref: /onnv-gate/usr/src/uts/sun4v/sys/dr_cpu.h (revision 3414:ff9ba99c65c7)
11991Sheppo /*
21991Sheppo  * CDDL HEADER START
31991Sheppo  *
41991Sheppo  * The contents of this file are subject to the terms of the
51991Sheppo  * Common Development and Distribution License (the "License").
61991Sheppo  * You may not use this file except in compliance with the License.
71991Sheppo  *
81991Sheppo  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91991Sheppo  * or http://www.opensolaris.org/os/licensing.
101991Sheppo  * See the License for the specific language governing permissions
111991Sheppo  * and limitations under the License.
121991Sheppo  *
131991Sheppo  * When distributing Covered Code, include this CDDL HEADER in each
141991Sheppo  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151991Sheppo  * If applicable, add the following below this CDDL HEADER, with the
161991Sheppo  * fields enclosed by brackets "[]" replaced with your own identifying
171991Sheppo  * information: Portions Copyright [yyyy] [name of copyright owner]
181991Sheppo  *
191991Sheppo  * CDDL HEADER END
201991Sheppo  */
211991Sheppo 
221991Sheppo /*
23*3414Srsmaeda  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
241991Sheppo  * Use is subject to license terms.
251991Sheppo  */
261991Sheppo 
271991Sheppo #ifndef _DR_CPU_H
281991Sheppo #define	_DR_CPU_H
291991Sheppo 
301991Sheppo #pragma ident	"%Z%%M%	%I%	%E% SMI"
311991Sheppo 
321991Sheppo /*
331991Sheppo  * CPU DR Control Protocol
341991Sheppo  */
351991Sheppo 
361991Sheppo #ifdef __cplusplus
371991Sheppo extern "C" {
381991Sheppo #endif
391991Sheppo 
401991Sheppo /*
411991Sheppo  * CPU DR Message Header
421991Sheppo  */
431991Sheppo typedef struct {
441991Sheppo 	uint64_t	req_num;	/* request number */
451991Sheppo 	uint32_t	msg_type;	/* message type */
461991Sheppo 	uint32_t	num_records;	/* number of records */
471991Sheppo } dr_cpu_hdr_t;
481991Sheppo 
491991Sheppo /*
501991Sheppo  * CPU command and response messages
511991Sheppo  */
521991Sheppo 
531991Sheppo #define	DR_CPU_DS_ID		"dr-cpu"
541991Sheppo 
551991Sheppo #define	DR_CPU_CONFIGURE	('C')
561991Sheppo #define	DR_CPU_UNCONFIGURE	('U')
571991Sheppo #define	DR_CPU_FORCE_UNCONFIG	('F')
581991Sheppo #define	DR_CPU_STATUS		('S')
591991Sheppo 
601991Sheppo #define	DR_CPU_OK		('o')
611991Sheppo #define	DR_CPU_ERROR		('e')
621991Sheppo 
631991Sheppo /*
641991Sheppo  * Response Message
651991Sheppo  */
661991Sheppo typedef struct {
671991Sheppo 	uint32_t	cpuid;		/* virtual CPU ID */
681991Sheppo 	uint32_t	result;		/* result of the operation */
691991Sheppo 	uint32_t	status;		/* status of the CPU */
701991Sheppo 	uint32_t	string_off;	/* informational string offset */
711991Sheppo } dr_cpu_stat_t;
721991Sheppo 
731991Sheppo /*
741991Sheppo  * Result Codes
751991Sheppo  */
761991Sheppo #define	DR_CPU_RES_OK			0x0	/* operation succeeded */
771991Sheppo #define	DR_CPU_RES_FAILURE		0x1	/* operation failed */
781991Sheppo #define	DR_CPU_RES_BLOCKED		0x2	/* operation was blocked */
791991Sheppo #define	DR_CPU_RES_CPU_NOT_RESPONDING	0x3	/* CPU was not responding */
801991Sheppo #define	DR_CPU_RES_NOT_IN_MD		0x4	/* CPU not defined in MD */
811991Sheppo 
821991Sheppo /*
831991Sheppo  * Status Codes
841991Sheppo  */
851991Sheppo #define	DR_CPU_STAT_NOT_PRESENT		0x0	/* CPU ID not in MD */
861991Sheppo #define	DR_CPU_STAT_UNCONFIGURED	0x1	/* CPU unconfigured */
871991Sheppo #define	DR_CPU_STAT_CONFIGURED		0x2	/* CPU configured */
881991Sheppo 
89*3414Srsmaeda /*
90*3414Srsmaeda  * Macros to access arrays that follow message header
91*3414Srsmaeda  */
92*3414Srsmaeda #define	DR_CPU_CMD_CPUIDS(_hdr)		((uint32_t *)((_hdr) + 1))
93*3414Srsmaeda #define	DR_CPU_RESP_STATS(_hdr)		((dr_cpu_stat_t *)((_hdr) + 1))
94*3414Srsmaeda 
951991Sheppo #ifdef __cplusplus
961991Sheppo }
971991Sheppo #endif
981991Sheppo 
991991Sheppo #endif /* _DR_CPU_H */
100