efi_partition.h revision 8488aeb5df27784d479c16cde06a9e25cd9a1152
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_EFI_PARTITION_H
#define _SYS_EFI_PARTITION_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* GUID Partition Table Header
*/
#define EFI_LABEL_SIZE 512
#define LEN_EFI_PAD (EFI_LABEL_SIZE - \
((5 * sizeof (diskaddr_t)) + \
(7 * sizeof (uint_t)) + \
(8 * sizeof (char)) + \
(1 * (sizeof (struct uuid)))))
#define EFI_SIGNATURE 0x5452415020494645ULL
/* EFI Guid Partition Table Header -- little endian on-disk format */
typedef struct efi_gpt {
struct uuid efi_gpt_DiskGUID;
char efi_gpt_Reserved2[LEN_EFI_PAD];
} efi_gpt_t;
/* EFI Guid Partition Entry Attributes -- little endian format */
typedef struct efi_gpe_Attrs {
Reserved2 :16;
/*
* 6a96237f-1dd2-11b2-99a6-080020736631 V_UNASSIGNED (not used as such)
* 6a82cb45-1dd2-11b2-99a6-080020736631 V_BOOT
* 6a85cf4d-1dd2-11b2-99a6-080020736631 V_ROOT
* 6a87c46f-1dd2-11b2-99a6-080020736631 V_SWAP
* 6a898cc3-1dd2-11b2-99a6-080020736631 V_USR
* 6a8b642b-1dd2-11b2-99a6-080020736631 V_BACKUP
* 6a8d2ac7-1dd2-11b2-99a6-080020736631 V_STAND (not used)
* 6a8ef2e9-1dd2-11b2-99a6-080020736631 V_VAR
* 6a90ba39-1dd2-11b2-99a6-080020736631 V_HOME
* 6a9283a5-1dd2-11b2-99a6-080020736631 V_ALTSCTR
* 6a945a3b-1dd2-11b2-99a6-080020736631 V_CACHE
*/
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B } }
{ 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }
{ 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE } }
{ 0x68, 0xb6, 0xb7, 0x26, 0x99, 0xc7 } }
{ 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e } }
{ 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f } }
{ 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28 } }
{ 0x08, 0x3a, 0xc8, 0x23, 0x09, 0x08 } }
{ 0x00, 0x30, 0x65, 0x43, 0xec, 0xac } }
{ 0x00, 0x30, 0x65, 0x43, 0xec, 0xac } }
/* minimum # of bytes for partition table entires, per EFI spec */
#define EFI_PART_NAME_LEN 36
/* size of the "reserved" partition, in blocks */
/* EFI Guid Partition Entry */
typedef struct efi_gpe {
struct uuid efi_gpe_PartitionTypeGUID;
struct uuid efi_gpe_UniquePartitionGUID;
} efi_gpe_t;
/*
* passed to the useful (we hope) routines (efi_alloc_and_read and
* efi_write) that take this VTOC-like struct. These routines handle
* converting this struct into the EFI struct, generate UUIDs and
* checksums, and perform any necessary byte-swapping to the on-disk
* format.
*/
/* Solaris library abstraction for EFI partitons */
typedef struct dk_part {
} dk_part_t;
/* Solaris library abstraction for an EFI GPT */
#define EFI_VERSION102 0x00010002
#define EFI_VERSION100 0x00010000
#define EFI_VERSION_CURRENT EFI_VERSION100
typedef struct dk_gpt {
/* efi_part_size is unused */
} dk_gpt_t;
/* possible values for "efi_flags" */
/* the private ioctl between libefi and the driver */
typedef struct dk_efi {
union {
} dki_un;
} dk_efi_t;
struct partition64 {
};
/*
* Number of EFI partitions
*/
#define EFI_NUMPAR 9
#ifndef _KERNEL
extern int efi_alloc_and_read(int, struct dk_gpt **);
extern int efi_type(int);
extern void efi_err_check(struct dk_gpt *);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_EFI_PARTITION_H */