ucode.h revision 0ba6f73dcd1c9160a44b2872ed0e0d81b51d168f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_UCODE_H
#define _SYS_UCODE_H
#ifdef _KERNEL
#endif
#include <sys/processor.h>
#ifndef _KERNEL
#include <limits.h>
#endif
#include <ucode/ucode_errno.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
*/
#define UCODE_DRIVER_NAME "ucode"
#define UCODE_NODE_NAME "ucode"
/*
* Where to install the microcode
*/
#define UCODE_INSTALL_PATH "platform/i86pc/ucode"
#define UCODE_INSTALL_COMMON_PATH ".f"
/*
* ioctl numbers
*/
#define UCODE_GET_VERSION (UCODE_IOC|0)
struct ucode_get_rev_struct {
int ugv_size; /* size of the array */
};
struct ucode_write_struct {
};
#if defined(_SYSCALL32_IMPL)
struct ucode_get_rev_struct32 {
int ugv_size; /* size of the array */
};
struct ucode_write_struct32 {
};
#endif /* _SYSCALL32_IMPL */
/*
* AMD Microcode file information
*/
typedef struct ucode_header_amd {
typedef struct ucode_file_amd {
#ifndef __xpv
#else
#endif
typedef struct ucode_eqtbl_amd {
/*
* Intel Microcode file information
*/
typedef struct ucode_header_intel {
typedef struct ucode_ext_sig_intel {
typedef struct ucode_ext_table_intel {
typedef struct ucode_file_intel {
/*
* common container
*/
typedef union ucode_file {
} ucode_file_t;
/*
* Length of UCODE_INSTALL_COMMON_PATH/short-name
* strlen(UCODE_INSTALL_COMMON_PATH) + 1 + UCODE_SHORT_NAME_LEN
* Use sizeof which will give us the additional byte for the '/' in between
* the common path and the file name.
*/
#define UCODE_COMMON_NAME_LEN \
(sizeof (UCODE_INSTALL_COMMON_PATH) + (UCODE_SHORT_NAME_LEN))
#define UCODE_HEADER_SIZE_INTEL (sizeof (struct ucode_header_intel))
#define UCODE_EXT_SIG_SIZE_INTEL (sizeof (struct ucode_ext_sig_intel))
/*
* For a single microcode file, the minimum size is 1K, maximum size is 16K.
* Such limitations, while somewhat artificial, are not only to provide better
* sanity checks, but also avoid wasting precious memory at startup time as the
* microcode buffer for the first processor has to be statically allocated.
*
* For the concatenation of all the microcode binary files, the maximum size
* is 16M.
*/
#define UCODE_BODY_SIZE_INTEL(size) \
#define UCODE_TOTAL_SIZE_INTEL(size) \
#ifdef _KERNEL
/*
* Microcode specific information per core
*/
typedef struct cpu_ucode_info {
/*
* Data structure used for xcall
*/
typedef struct ucode_update {
/*
* Microcode kernel operations
*/
struct ucode_ops {
void (*read_rev)(cpu_ucode_info_t *);
};
#else
#define UCODE_MAX_VENDORS_NAME_LEN 20
#define UCODE_VENDORS \
static struct { \
char *filestr; \
char *extstr; \
char *vendorstr; \
int supported; \
} ucode_vendors[] = { \
{ "intel", "txt", "GenuineIntel", 1 }, \
{ "amd", "bin", "AuthenticAMD", 1 }, \
}
/*
* Microcode user operations
*/
struct ucode_ops {
};
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_UCODE_H */