Upload Tizen:Base source
[framework/base/util-linux-ng.git] / partx / efi.h
1 /*
2   efi.[ch] - Manipulates EFI variables as exported in /proc/efi/vars
3  
4   Copyright (C) 2001 Dell Computer Corporation <Matt_Domsch@dell.com>
5  
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef EFI_H
22 #define EFI_H
23
24 /*
25  * Extensible Firmware Interface
26  * Based on 'Extensible Firmware Interface Specification'
27  *      version 1.02, 12 December, 2000
28  */
29 #include <stdint.h>
30
31 typedef struct {
32         uint8_t  b[16];
33 } efi_guid_t;
34
35 #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
36 ((efi_guid_t) \
37 {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
38   (b) & 0xff, ((b) >> 8) & 0xff, \
39   (c) & 0xff, ((c) >> 8) & 0xff, \
40   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
41
42
43 /******************************************************
44  * GUIDs
45  ******************************************************/
46 #define NULL_GUID \
47 EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
48
49 static inline int
50 efi_guidcmp(efi_guid_t left, efi_guid_t right)
51 {
52         return memcmp(&left, &right, sizeof (efi_guid_t));
53 }
54
55 typedef uint16_t efi_char16_t;          /* UNICODE character */
56
57 #endif /* EFI_H */