summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/efi_partition.h
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2019-04-01 10:05:45 +0000
committerJohn Levon <john.levon@joyent.com>2019-04-08 08:43:36 +0000
commitfa83485c3551a3fd3848f1535acb98b30c6595a2 (patch)
treed1ab84da58bdbfaf128c634c000feebb17422123 /usr/src/uts/common/sys/efi_partition.h
parent9a8207fa35a4a0b13b30000d6ead058c47c0ccc3 (diff)
downloadillumos-joyent-fa83485c3551a3fd3848f1535acb98b30c6595a2.tar.gz
OS-7260 SmartOS should support booting with loader
OS-7271 proto.boot should include loader instead of grub OS-7332 RICHMOND-16 mitigation ensnares stock loaders OS-7584 MDB module for disk labelling would be useful OS-7585 Need workaround to EFI boot on AMI BIOS OS-7595 Triton-specific extensions to Loader Portions contributed by: Rob Johnston <rob.johnston@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/common/sys/efi_partition.h')
-rw-r--r--usr/src/uts/common/sys/efi_partition.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/src/uts/common/sys/efi_partition.h b/usr/src/uts/common/sys/efi_partition.h
index 5fa101cbb7..065f65f802 100644
--- a/usr/src/uts/common/sys/efi_partition.h
+++ b/usr/src/uts/common/sys/efi_partition.h
@@ -22,12 +22,14 @@
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
* Copyright 2014 Toomas Soome <tsoome@me.com>
+ * Copyright (c) 2019, Joyent, Inc.
*/
#ifndef _SYS_EFI_PARTITION_H
#define _SYS_EFI_PARTITION_H
#include <sys/uuid.h>
+#include <sys/stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -46,6 +48,16 @@ extern "C" {
#define EFI_SIGNATURE 0x5452415020494645ULL
+/*
+ * Although the EFI spec is clear that sizeof (efi_gpt_t) is a valid value
+ * (512), at least one EFI system (AMI v4.6.4.1) incorrectly expects this to be
+ * exactly the size of the structure defined in the spec, that is, 92.
+ *
+ * As the reserved section is never used, the modified value works fine
+ * everywhere else.
+ */
+#define EFI_HEADER_SIZE (offsetof(efi_gpt_t, efi_gpt_Reserved2))
+
/* EFI Guid Partition Table Header -- little endian on-disk format */
typedef struct efi_gpt {
uint64_t efi_gpt_Signature;
@@ -222,7 +234,7 @@ typedef struct dk_efi {
diskaddr_t dki_lba; /* starting block */
len_t dki_length; /* length in bytes */
union {
- efi_gpt_t *_dki_data;
+ efi_gpt_t *_dki_data;
uint64_t _dki_data_64;
} dki_un;
#define dki_data dki_un._dki_data