Commit e913fd70 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] EFI GUID partition support update.

More bits from Matt Domsch. Fixes GUID printing, and updates
to what's in the IA64 tree. Other cleanups are mentioned in
the changelog in the patch.
parent 13a9b6c4
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
* *
* Changelog: * Changelog:
* *
* 25 Mar 2002 - Matt Domsch <Matt_Domsch@dell.com>
* move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_unparse()
*
* 12 Feb 2002 - Matt Domsch <Matt_Domsch@dell.com> * 12 Feb 2002 - Matt Domsch <Matt_Domsch@dell.com>
* use list_for_each_safe when deleting vars. * use list_for_each_safe when deleting vars.
* remove ifdef CONFIG_SMP around include <linux/smp.h> * remove ifdef CONFIG_SMP around include <linux/smp.h>
...@@ -70,7 +73,7 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>"); ...@@ -70,7 +73,7 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
MODULE_DESCRIPTION("/proc interface to EFI Variables"); MODULE_DESCRIPTION("/proc interface to EFI Variables");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define EFIVARS_VERSION "0.04 2002-Feb-12" #define EFIVARS_VERSION "0.05 2002-Mar-26"
static int static int
efivar_read(char *page, char **start, off_t off, efivar_read(char *page, char **start, off_t off,
...@@ -141,20 +144,6 @@ proc_calc_metrics(char *page, char **start, off_t off, ...@@ -141,20 +144,6 @@ proc_calc_metrics(char *page, char **start, off_t off,
return len; return len;
} }
static void
uuid_unparse(efi_guid_t *guid, char *out)
{
sprintf(out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
guid->data1, guid->data2, guid->data3,
guid->data4[0], guid->data4[1], guid->data4[2], guid->data4[3],
guid->data4[4], guid->data4[5], guid->data4[6], guid->data4[7]);
}
/* /*
* efivar_create_proc_entry() * efivar_create_proc_entry()
* Requires: * Requires:
...@@ -197,7 +186,7 @@ efivar_create_proc_entry(unsigned long variable_name_size, ...@@ -197,7 +186,7 @@ efivar_create_proc_entry(unsigned long variable_name_size,
private variables from another's. */ private variables from another's. */
*(short_name + strlen(short_name)) = '-'; *(short_name + strlen(short_name)) = '-';
uuid_unparse(vendor_guid, short_name + strlen(short_name)); efi_guid_unparse(vendor_guid, short_name + strlen(short_name));
/* Create the entry in proc */ /* Create the entry in proc */
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
* Purpose: Generic MCA handling layer * Purpose: Generic MCA handling layer
* *
* Updated for latest kernel * Updated for latest kernel
* Copyright (C) 2002 Dell Computer Corporation
* Copyright (C) Matt Domsch (Matt_Domsch@dell.com)
*
* Copyright (C) 2002 Intel * Copyright (C) 2002 Intel
* Copyright (C) Jenna Hall (jenna.s.hall@intel.com) * Copyright (C) Jenna Hall (jenna.s.hall@intel.com)
* *
...@@ -15,6 +18,8 @@ ...@@ -15,6 +18,8 @@
* Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 1999 Silicon Graphics, Inc.
* Copyright (C) Vijay Chander(vijay@engr.sgi.com) * Copyright (C) Vijay Chander(vijay@engr.sgi.com)
* *
* 02/03/25 M. Domsch GUID cleanups
*
* 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU * 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU
* error flag, set SAL default return values, changed * error flag, set SAL default return values, changed
* error record structure to linked list, added init call * error record structure to linked list, added init call
...@@ -348,17 +353,13 @@ static int ...@@ -348,17 +353,13 @@ static int
verify_guid (efi_guid_t *test, efi_guid_t *target) verify_guid (efi_guid_t *test, efi_guid_t *target)
{ {
int rc; int rc;
char out[40];
if ((rc = memcmp((void *)test, (void *)target, sizeof(efi_guid_t)))) { if ((rc = efi_guidcmp(*test, *target))) {
IA64_MCA_DEBUG("ia64_mca_print: invalid guid = " IA64_MCA_DEBUG(KERN_DEBUG
"{ %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " "verify_guid: invalid GUID = %s\n",
"%#02x, %#02x, %#02x, %#02x, } } \n ", efi_guid_unparse(test, out));
test->data1, test->data2, test->data3, test->data4[0],
test->data4[1], test->data4[2], test->data4[3],
test->data4[4], test->data4[5], test->data4[6],
test->data4[7]);
} }
return rc; return rc;
} }
...@@ -856,11 +857,8 @@ ia64_init_handler (struct pt_regs *regs) ...@@ -856,11 +857,8 @@ ia64_init_handler (struct pt_regs *regs)
void void
ia64_log_prt_guid (efi_guid_t *p_guid, prfunc_t prfunc) ia64_log_prt_guid (efi_guid_t *p_guid, prfunc_t prfunc)
{ {
printk("GUID = { %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " char out[40];
"%#02x, %#02x, %#02x, %#02x, } } \n ", p_guid->data1, printk(KERN_DEBUG "GUID = %s\n", efi_guid_unparse(p_guid, out));
p_guid->data2, p_guid->data3, p_guid->data4[0], p_guid->data4[1],
p_guid->data4[2], p_guid->data4[3], p_guid->data4[4],
p_guid->data4[5], p_guid->data4[6], p_guid->data4[7]);
} }
static void static void
...@@ -1754,7 +1752,7 @@ ia64_log_processor_info_print(sal_log_record_header_t *lh, prfunc_t prfunc) ...@@ -1754,7 +1752,7 @@ ia64_log_processor_info_print(sal_log_record_header_t *lh, prfunc_t prfunc)
ia64_log_prt_section_header(slsh, prfunc); ia64_log_prt_section_header(slsh, prfunc);
#endif // MCA_PRT_XTRA_DATA for test only @FVL #endif // MCA_PRT_XTRA_DATA for test only @FVL
if (verify_guid((void *)&slsh->guid, (void *)&(SAL_PROC_DEV_ERR_SECT_GUID))) { if (verify_guid(&slsh->guid, &(SAL_PROC_DEV_ERR_SECT_GUID))) {
IA64_MCA_DEBUG("ia64_mca_log_print: unsupported record section\n"); IA64_MCA_DEBUG("ia64_mca_log_print: unsupported record section\n");
continue; continue;
} }
......
This diff is collapsed.
...@@ -48,22 +48,27 @@ ...@@ -48,22 +48,27 @@
#define GPT_HEADER_REVISION_V1 0x00010000 #define GPT_HEADER_REVISION_V1 0x00010000
#define GPT_PRIMARY_PARTITION_TABLE_LBA 1 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1
#define UNUSED_ENTRY_GUID \
((efi_guid_t) { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }})
#define PARTITION_SYSTEM_GUID \ #define PARTITION_SYSTEM_GUID \
((efi_guid_t) { 0xC12A7328, 0xF81F, 0x11d2, { 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B }}) EFI_GUID( 0xC12A7328, 0xF81F, 0x11d2, \
0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B)
#define LEGACY_MBR_PARTITION_GUID \ #define LEGACY_MBR_PARTITION_GUID \
((efi_guid_t) { 0x024DEE41, 0x33E7, 0x11d3, { 0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F }}) EFI_GUID( 0x024DEE41, 0x33E7, 0x11d3, \
0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F)
#define PARTITION_MSFT_RESERVED_GUID \ #define PARTITION_MSFT_RESERVED_GUID \
((efi_guid_t) { 0xE3C9E316, 0x0B5C, 0x4DB8, { 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE }}) EFI_GUID( 0xE3C9E316, 0x0B5C, 0x4DB8, \
0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE)
#define PARTITION_BASIC_DATA_GUID \ #define PARTITION_BASIC_DATA_GUID \
((efi_guid_t) { 0xEBD0A0A2, 0xB9E5, 0x4433, { 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 }}) EFI_GUID( 0xEBD0A0A2, 0xB9E5, 0x4433, \
0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7)
#define PARTITION_LINUX_RAID_GUID \ #define PARTITION_LINUX_RAID_GUID \
((efi_guid_t) { 0xa19d880f, 0x05fc, 0x4d3b, { 0xa0, 0x06, 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e }}) EFI_GUID( 0xa19d880f, 0x05fc, 0x4d3b, \
0xa0, 0x06, 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e)
#define PARTITION_LINUX_SWAP_GUID \ #define PARTITION_LINUX_SWAP_GUID \
((efi_guid_t) { 0x0657fd6d, 0xa4ab, 0x43c4, { 0x84, 0xe5, 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f }}) EFI_GUID( 0x0657fd6d, 0xa4ab, 0x43c4, \
0x84, 0xe5, 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f)
#define PARTITION_LINUX_LVM_GUID \ #define PARTITION_LINUX_LVM_GUID \
((efi_guid_t) { 0xe6d6d379, 0xf507, 0x44c2, { 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28 }}) EFI_GUID( 0xe6d6d379, 0xf507, 0x44c2, \
0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28)
typedef struct _gpt_header { typedef struct _gpt_header {
u64 signature; u64 signature;
......
...@@ -32,13 +32,18 @@ typedef unsigned long efi_status_t; ...@@ -32,13 +32,18 @@ typedef unsigned long efi_status_t;
typedef u8 efi_bool_t; typedef u8 efi_bool_t;
typedef u16 efi_char16_t; /* UNICODE character */ typedef u16 efi_char16_t; /* UNICODE character */
typedef struct { typedef struct {
u32 data1; u8 b[16];
u16 data2;
u16 data3;
u8 data4[8];
} efi_guid_t; } efi_guid_t;
#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
((efi_guid_t) \
{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
(b) & 0xff, ((b) >> 8) & 0xff, \
(c) & 0xff, ((c) >> 8) & 0xff, \
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
/* /*
* Generic EFI table header * Generic EFI table header
*/ */
...@@ -165,21 +170,23 @@ typedef void efi_reset_system_t (int reset_type, efi_status_t status, ...@@ -165,21 +170,23 @@ typedef void efi_reset_system_t (int reset_type, efi_status_t status,
/* /*
* EFI Configuration Table and GUID definitions * EFI Configuration Table and GUID definitions
*/ */
#define NULL_GUID \
EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 )
#define MPS_TABLE_GUID \ #define MPS_TABLE_GUID \
((efi_guid_t) { 0xeb9d2d2f, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) EFI_GUID( 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
#define ACPI_TABLE_GUID \ #define ACPI_TABLE_GUID \
((efi_guid_t) { 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) EFI_GUID( 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
#define ACPI_20_TABLE_GUID \ #define ACPI_20_TABLE_GUID \
((efi_guid_t) { 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }}) EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 )
#define SMBIOS_TABLE_GUID \ #define SMBIOS_TABLE_GUID \
((efi_guid_t) { 0xeb9d2d31, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
#define SAL_SYSTEM_TABLE_GUID \ #define SAL_SYSTEM_TABLE_GUID \
((efi_guid_t) { 0xeb9d2d32, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
typedef struct { typedef struct {
efi_guid_t guid; efi_guid_t guid;
...@@ -233,6 +240,17 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) ...@@ -233,6 +240,17 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right)
return memcmp(&left, &right, sizeof (efi_guid_t)); return memcmp(&left, &right, sizeof (efi_guid_t));
} }
static inline char *
efi_guid_unparse(efi_guid_t *guid, char *out)
{
sprintf(out, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
guid->b[3], guid->b[2], guid->b[1], guid->b[0],
guid->b[5], guid->b[4], guid->b[7], guid->b[6],
guid->b[8], guid->b[9], guid->b[10], guid->b[11],
guid->b[12], guid->b[13], guid->b[14], guid->b[15]);
return out;
}
extern void efi_init (void); extern void efi_init (void);
extern void efi_map_pal_code (void); extern void efi_map_pal_code (void);
extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
......
...@@ -241,32 +241,32 @@ enum { ...@@ -241,32 +241,32 @@ enum {
/* SAL Error Record Section GUID Definitions */ /* SAL Error Record Section GUID Definitions */
#define SAL_PROC_DEV_ERR_SECT_GUID \ #define SAL_PROC_DEV_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf1, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID ( 0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_MEM_DEV_ERR_SECT_GUID \ #define SAL_PLAT_MEM_DEV_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf2, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf2, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_SEL_DEV_ERR_SECT_GUID \ #define SAL_PLAT_SEL_DEV_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf3, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf3, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_PCI_BUS_ERR_SECT_GUID \ #define SAL_PLAT_PCI_BUS_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf4, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf4, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID \ #define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf5, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf5, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_PCI_COMP_ERR_SECT_GUID \ #define SAL_PLAT_PCI_COMP_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf6, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf6, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_SPECIFIC_ERR_SECT_GUID \ #define SAL_PLAT_SPECIFIC_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf7, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf7, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID \ #define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf8, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf8, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define SAL_PLAT_BUS_ERR_SECT_GUID \ #define SAL_PLAT_BUS_ERR_SECT_GUID \
((efi_guid_t) { 0xe429faf9, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ EFI_GUID( 0xe429faf9, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \
0xc7, 0x3c, 0x88, 0x81 }} ) 0xc7, 0x3c, 0x88, 0x81 )
#define MAX_CACHE_ERRORS 6 #define MAX_CACHE_ERRORS 6
#define MAX_TLB_ERRORS 6 #define MAX_TLB_ERRORS 6
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment