瀏覽代碼

[efi] Update to current EDK2 headers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 年之前
父節點
當前提交
f796d5b6b6

+ 1
- 1
src/include/ipxe/efi/AArch64/ProcessorBind.h 查看文件

@@ -34,7 +34,7 @@ FILE_LICENCE ( BSD3 );
34 34
 
35 35
 #if _MSC_EXTENSIONS
36 36
   //
37
-  // use Microsoft* C complier dependent integer width types
37
+  // use Microsoft* C compiler dependent integer width types
38 38
   //
39 39
   typedef unsigned __int64    UINT64;
40 40
   typedef __int64             INT64;

+ 8
- 1
src/include/ipxe/efi/Arm/ProcessorBind.h 查看文件

@@ -30,9 +30,16 @@ FILE_LICENCE ( BSD3 );
30 30
 #pragma pack()
31 31
 #endif
32 32
 
33
+//
34
+// RVCT does not support the __builtin_unreachable() macro
35
+//
36
+#ifdef __ARMCC_VERSION
37
+#define UNREACHABLE()
38
+#endif
39
+
33 40
 #if _MSC_EXTENSIONS
34 41
   //
35
-  // use Microsoft* C complier dependent integer width types
42
+  // use Microsoft* C compiler dependent integer width types
36 43
   //
37 44
   typedef unsigned __int64    UINT64;
38 45
   typedef __int64             INT64;

+ 144
- 7
src/include/ipxe/efi/Base.h 查看文件

@@ -86,6 +86,117 @@ VERIFY_SIZE_OF (CHAR16, 2);
86 86
   #define GLOBAL_REMOVE_IF_UNREFERENCED
87 87
 #endif
88 88
 
89
+//
90
+// Should be used in combination with NORETURN to avoid 'noreturn' returns
91
+// warnings.
92
+//
93
+#ifndef UNREACHABLE
94
+  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
95
+    ///
96
+    /// Signal compilers and analyzers that this call is not reachable.  It is
97
+    /// up to the compiler to remove any code past that point.
98
+    /// Not implemented by GCC 4.4 or earlier.
99
+    ///
100
+    #define UNREACHABLE()  __builtin_unreachable ()
101
+  #elif defined (__has_feature)
102
+    #if __has_builtin (__builtin_unreachable)
103
+      ///
104
+      /// Signal compilers and analyzers that this call is not reachable.  It is
105
+      /// up to the compiler to remove any code past that point.
106
+      ///
107
+      #define UNREACHABLE()  __builtin_unreachable ()
108
+    #endif
109
+  #endif
110
+
111
+  #ifndef UNREACHABLE
112
+    ///
113
+    /// Signal compilers and analyzers that this call is not reachable.  It is
114
+    /// up to the compiler to remove any code past that point.
115
+    ///
116
+    #define UNREACHABLE()
117
+  #endif
118
+#endif
119
+
120
+//
121
+// Signaling compilers and analyzers that a certain function cannot return may
122
+// remove all following code and thus lead to better optimization and less
123
+// false positives.
124
+//
125
+#ifndef NORETURN
126
+  #if defined (__GNUC__) || defined (__clang__)
127
+    ///
128
+    /// Signal compilers and analyzers that the function cannot return.
129
+    /// It is up to the compiler to remove any code past a call to functions
130
+    /// flagged with this attribute.
131
+    ///
132
+    #define NORETURN  __attribute__((noreturn))
133
+  #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
134
+    ///
135
+    /// Signal compilers and analyzers that the function cannot return.
136
+    /// It is up to the compiler to remove any code past a call to functions
137
+    /// flagged with this attribute.
138
+    ///
139
+    #define NORETURN  __declspec(noreturn)
140
+  #else
141
+    ///
142
+    /// Signal compilers and analyzers that the function cannot return.
143
+    /// It is up to the compiler to remove any code past a call to functions
144
+    /// flagged with this attribute.
145
+    ///
146
+    #define NORETURN
147
+  #endif
148
+#endif
149
+
150
+//
151
+// Should be used in combination with ANALYZER_NORETURN to avoid 'noreturn'
152
+// returns warnings.
153
+//
154
+#ifndef ANALYZER_UNREACHABLE
155
+  #ifdef __clang_analyzer__
156
+    #if __has_builtin (__builtin_unreachable)
157
+      ///
158
+      /// Signal the analyzer that this call is not reachable.
159
+      /// This excludes compilers.
160
+      ///
161
+      #define ANALYZER_UNREACHABLE()  __builtin_unreachable ()
162
+    #endif
163
+  #endif
164
+
165
+  #ifndef ANALYZER_UNREACHABLE
166
+    ///
167
+    /// Signal the analyzer that this call is not reachable.
168
+    /// This excludes compilers.
169
+    ///
170
+    #define ANALYZER_UNREACHABLE()
171
+  #endif
172
+#endif
173
+
174
+//
175
+// Static Analyzers may issue errors about potential NULL-dereferences when
176
+// dereferencing a pointer, that has been checked before, outside of a
177
+// NULL-check.  This may lead to false positives, such as when using ASSERT()
178
+// for verification.
179
+//
180
+#ifndef ANALYZER_NORETURN
181
+  #ifdef __has_feature
182
+    #if __has_feature (attribute_analyzer_noreturn)
183
+      ///
184
+      /// Signal analyzers that the function cannot return.
185
+      /// This excludes compilers.
186
+      ///
187
+      #define ANALYZER_NORETURN  __attribute__((analyzer_noreturn))
188
+    #endif
189
+  #endif
190
+
191
+  #ifndef ANALYZER_NORETURN
192
+    ///
193
+    /// Signal the analyzer that the function cannot return.
194
+    /// This excludes compilers.
195
+    ///
196
+    #define ANALYZER_NORETURN
197
+  #endif
198
+#endif
199
+
89 200
 //
90 201
 // For symbol name in assembly code, an extra "_" is sometimes necessary
91 202
 //
@@ -193,7 +304,7 @@ struct _LIST_ENTRY {
193 304
 
194 305
 //
195 306
 //  UEFI specification claims 1 and 0. We are concerned about the
196
-//  complier portability so we did it this way.
307
+//  compiler portability so we did it this way.
197 308
 //
198 309
 
199 310
 ///
@@ -480,7 +591,31 @@ struct _LIST_ENTRY {
480 591
 
481 592
 #define VA_COPY(Dest, Start)          __va_copy (Dest, Start)
482 593
 
483
-#elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS)
594
+#elif defined(__GNUC__)
595
+
596
+#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)
597
+//
598
+// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists.
599
+//
600
+///
601
+/// Both GCC and LLVM 3.8 for X64 support new variable argument intrinsics for Microsoft ABI
602
+///
603
+
604
+///
605
+/// Variable used to traverse the list of arguments. This type can vary by
606
+/// implementation and could be an array or structure.
607
+///
608
+typedef __builtin_ms_va_list VA_LIST;
609
+
610
+#define VA_START(Marker, Parameter)  __builtin_ms_va_start (Marker, Parameter)
611
+
612
+#define VA_ARG(Marker, TYPE)         ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
613
+
614
+#define VA_END(Marker)               __builtin_ms_va_end (Marker)
615
+
616
+#define VA_COPY(Dest, Start)         __builtin_ms_va_copy (Dest, Start)
617
+
618
+#else
484 619
 //
485 620
 // Use GCC built-in macros for variable argument lists.
486 621
 //
@@ -499,6 +634,8 @@ typedef __builtin_va_list VA_LIST;
499 634
 
500 635
 #define VA_COPY(Dest, Start)         __builtin_va_copy (Dest, Start)
501 636
 
637
+#endif
638
+
502 639
 #else
503 640
 ///
504 641
 /// Variable used to traverse the list of arguments. This type can vary by
@@ -1038,7 +1175,7 @@ typedef UINTN RETURN_STATUS;
1038 1175
 #if defined(_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_EBC)
1039 1176
   #pragma intrinsic(_ReturnAddress)
1040 1177
   /**
1041
-    Get the return address of the calling funcation.
1178
+    Get the return address of the calling function.
1042 1179
 
1043 1180
     Based on intrinsic function _ReturnAddress that provides the address of
1044 1181
     the instruction in the calling function that will be executed after
@@ -1046,27 +1183,27 @@ typedef UINTN RETURN_STATUS;
1046 1183
 
1047 1184
     @param L    Return Level.
1048 1185
 
1049
-    @return The return address of the calling funcation or 0 if L != 0.
1186
+    @return The return address of the calling function or 0 if L != 0.
1050 1187
 
1051 1188
   **/
1052 1189
   #define RETURN_ADDRESS(L)     ((L == 0) ? _ReturnAddress() : (VOID *) 0)
1053 1190
 #elif defined(__GNUC__)
1054 1191
   void * __builtin_return_address (unsigned int level);
1055 1192
   /**
1056
-    Get the return address of the calling funcation.
1193
+    Get the return address of the calling function.
1057 1194
 
1058 1195
     Based on built-in Function __builtin_return_address that returns
1059 1196
     the return address of the current function, or of one of its callers.
1060 1197
 
1061 1198
     @param L    Return Level.
1062 1199
 
1063
-    @return The return address of the calling funcation.
1200
+    @return The return address of the calling function.
1064 1201
 
1065 1202
   **/
1066 1203
   #define RETURN_ADDRESS(L)     __builtin_return_address (L)
1067 1204
 #else
1068 1205
   /**
1069
-    Get the return address of the calling funcation.
1206
+    Get the return address of the calling function.
1070 1207
 
1071 1208
     @param L    Return Level.
1072 1209
 

+ 2
- 2
src/include/ipxe/efi/Ia32/ProcessorBind.h 查看文件

@@ -81,7 +81,7 @@ FILE_LICENCE ( BSD3 );
81 81
 #pragma warning ( disable : 4057 )
82 82
 
83 83
 //
84
-// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
84
+// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
85 85
 //
86 86
 #pragma warning ( disable : 4127 )
87 87
 
@@ -121,7 +121,7 @@ FILE_LICENCE ( BSD3 );
121 121
 #if defined(_MSC_EXTENSIONS)
122 122
 
123 123
   //
124
-  // use Microsoft C complier dependent integer width types
124
+  // use Microsoft C compiler dependent integer width types
125 125
   //
126 126
 
127 127
   ///

+ 38
- 18
src/include/ipxe/efi/IndustryStandard/Pci22.h 查看文件

@@ -5,11 +5,10 @@
5 5
     PCI Local Bus Specification, 2.2
6 6
     PCI-to-PCI Bridge Architecture Specification, Revision 1.2
7 7
     PC Card Standard, 8.0
8
+    PCI Power Management Interface Specifiction, Revision 1.2
8 9
 
9
-
10
-
11
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
12
-  Copyright (c) 2014 - 2105, Hewlett-Packard Development Company, L.P.<BR>
10
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
11
+  Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
13 12
   This program and the accompanying materials
14 13
   are licensed and made available under the terms and conditions of the BSD License
15 14
   which accompanies this distribution.  The full text of the license may be found at
@@ -638,6 +637,7 @@ typedef union {
638 637
 #define EFI_PCI_CAPABILITY_ID_SLOTID  0x04
639 638
 #define EFI_PCI_CAPABILITY_ID_MSI     0x05
640 639
 #define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
640
+#define EFI_PCI_CAPABILITY_ID_SHPC    0x0C
641 641
 
642 642
 ///
643 643
 /// Capabilities List Header
@@ -648,18 +648,6 @@ typedef struct {
648 648
   UINT8 NextItemPtr;
649 649
 } EFI_PCI_CAPABILITY_HDR;
650 650
 
651
-///
652
-/// Power Management Register Block Definition
653
-/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
654
-///
655
-typedef struct {
656
-  EFI_PCI_CAPABILITY_HDR  Hdr;
657
-  UINT16                  PMC;
658
-  UINT16                  PMCSR;
659
-  UINT8                   BridgeExtention;
660
-  UINT8                   Data;
661
-} EFI_PCI_CAPABILITY_PMI;
662
-
663 651
 ///
664 652
 /// PMC - Power Management Capabilities
665 653
 /// Section 3.2.3, PCI Power Management Interface Specifiction, Revision 1.2
@@ -668,7 +656,7 @@ typedef union {
668 656
   struct {
669 657
     UINT16 Version : 3;
670 658
     UINT16 PmeClock : 1;
671
-    UINT16 : 1;
659
+    UINT16 Reserved : 1;
672 660
     UINT16 DeviceSpecificInitialization : 1;
673 661
     UINT16 AuxCurrent : 3;
674 662
     UINT16 D1Support : 1;
@@ -687,7 +675,9 @@ typedef union {
687 675
 typedef union {
688 676
   struct {
689 677
     UINT16 PowerState : 2;
690
-    UINT16 : 6;
678
+    UINT16 ReservedForPciExpress : 1;
679
+    UINT16 NoSoftReset : 1;
680
+    UINT16 Reserved : 4;
691 681
     UINT16 PmeEnable : 1;
692 682
     UINT16 DataSelect : 4;
693 683
     UINT16 DataScale : 2;
@@ -696,6 +686,36 @@ typedef union {
696 686
   UINT16 Data;
697 687
 } EFI_PCI_PMCSR;
698 688
 
689
+#define PCI_POWER_STATE_D0     0
690
+#define PCI_POWER_STATE_D1     1
691
+#define PCI_POWER_STATE_D2     2
692
+#define PCI_POWER_STATE_D3_HOT 3
693
+
694
+///
695
+/// PMCSR_BSE - PMCSR PCI-to-PCI Bridge Support Extensions
696
+/// Section 3.2.5, PCI Power Management Interface Specifiction, Revision 1.2
697
+///
698
+typedef union {
699
+  struct {
700
+    UINT8 Reserved : 6;
701
+    UINT8 B2B3 : 1;
702
+    UINT8 BusPowerClockControl : 1;
703
+  } Bits;
704
+  UINT8   Uint8;
705
+} EFI_PCI_PMCSR_BSE;
706
+
707
+///
708
+/// Power Management Register Block Definition
709
+/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
710
+///
711
+typedef struct {
712
+  EFI_PCI_CAPABILITY_HDR  Hdr;
713
+  EFI_PCI_PMC             PMC;
714
+  EFI_PCI_PMCSR           PMCSR;
715
+  EFI_PCI_PMCSR_BSE       BridgeExtention;
716
+  UINT8                   Data;
717
+} EFI_PCI_CAPABILITY_PMI;
718
+
699 719
 ///
700 720
 /// A.G.P Capability
701 721
 /// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0

+ 141
- 2
src/include/ipxe/efi/Library/BaseLib.h 查看文件

@@ -2,7 +2,7 @@
2 2
   Provides string functions, linked list functions, math functions, synchronization
3 3
   functions, file path functions, and CPU architecture-specific functions.
4 4
 
5
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
5
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
6 6
 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
7 7
 This program and the accompanying materials
8 8
 are licensed and made available under the terms and conditions of the BSD License
@@ -189,6 +189,8 @@ typedef struct {
189 189
 /**
190 190
   Returns the length of a Null-terminated Unicode string.
191 191
 
192
+  This function is similar as strlen_s defined in C11.
193
+
192 194
   If String is not aligned on a 16-bit boundary, then ASSERT().
193 195
 
194 196
   @param  String   A pointer to a Null-terminated Unicode string.
@@ -211,10 +213,14 @@ StrnLenS (
211 213
   Copies the string pointed to by Source (including the terminating null char)
212 214
   to the array pointed to by Destination.
213 215
 
216
+  This function is similar as strcpy_s defined in C11.
217
+
214 218
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
215 219
   If Source is not aligned on a 16-bit boundary, then ASSERT().
216 220
   If an error would be returned, then the function will also ASSERT().
217 221
 
222
+  If an error is returned, then the Destination is unmodified.
223
+
218 224
   @param  Destination              A pointer to a Null-terminated Unicode string.
219 225
   @param  DestMax                  The maximum number of Destination Unicode
220 226
                                    char, including terminating null char.
@@ -243,10 +249,14 @@ StrCpyS (
243 249
   Source to the array pointed to by Destination. If no null char is copied from
244 250
   Source, then Destination[Length] is always set to null.
245 251
 
252
+  This function is similar as strncpy_s defined in C11.
253
+
246 254
   If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
247 255
   If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
248 256
   If an error would be returned, then the function will also ASSERT().
249 257
 
258
+  If an error is returned, then the Destination is unmodified.
259
+
250 260
   @param  Destination              A pointer to a Null-terminated Unicode string.
251 261
   @param  DestMax                  The maximum number of Destination Unicode
252 262
                                    char, including terminating null char.
@@ -277,10 +287,14 @@ StrnCpyS (
277 287
   Appends a copy of the string pointed to by Source (including the terminating
278 288
   null char) to the end of the string pointed to by Destination.
279 289
 
290
+  This function is similar as strcat_s defined in C11.
291
+
280 292
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
281 293
   If Source is not aligned on a 16-bit boundary, then ASSERT().
282 294
   If an error would be returned, then the function will also ASSERT().
283 295
 
296
+  If an error is returned, then the Destination is unmodified.
297
+
284 298
   @param  Destination              A pointer to a Null-terminated Unicode string.
285 299
   @param  DestMax                  The maximum number of Destination Unicode
286 300
                                    char, including terminating null char.
@@ -313,10 +327,14 @@ StrCatS (
313 327
   copied from Source, then Destination[StrLen(Destination) + Length] is always
314 328
   set to null.
315 329
 
330
+  This function is similar as strncat_s defined in C11.
331
+
316 332
   If Destination is not aligned on a 16-bit boundary, then ASSERT().
317 333
   If Source is not aligned on a 16-bit boundary, then ASSERT().
318 334
   If an error would be returned, then the function will also ASSERT().
319 335
 
336
+  If an error is returned, then the Destination is unmodified.
337
+
320 338
   @param  Destination              A pointer to a Null-terminated Unicode string.
321 339
   @param  DestMax                  The maximum number of Destination Unicode
322 340
                                    char, including terminating null char.
@@ -348,6 +366,8 @@ StrnCatS (
348 366
 /**
349 367
   Returns the length of a Null-terminated Ascii string.
350 368
 
369
+  This function is similar as strlen_s defined in C11.
370
+
351 371
   @param  String   A pointer to a Null-terminated Ascii string.
352 372
   @param  MaxSize  The maximum number of Destination Ascii
353 373
                    char, including terminating null char.
@@ -368,8 +388,12 @@ AsciiStrnLenS (
368 388
   Copies the string pointed to by Source (including the terminating null char)
369 389
   to the array pointed to by Destination.
370 390
 
391
+  This function is similar as strcpy_s defined in C11.
392
+
371 393
   If an error would be returned, then the function will also ASSERT().
372 394
 
395
+  If an error is returned, then the Destination is unmodified.
396
+
373 397
   @param  Destination              A pointer to a Null-terminated Ascii string.
374 398
   @param  DestMax                  The maximum number of Destination Ascii
375 399
                                    char, including terminating null char.
@@ -398,8 +422,12 @@ AsciiStrCpyS (
398 422
   Source to the array pointed to by Destination. If no null char is copied from
399 423
   Source, then Destination[Length] is always set to null.
400 424
 
425
+  This function is similar as strncpy_s defined in C11.
426
+
401 427
   If an error would be returned, then the function will also ASSERT().
402 428
 
429
+  If an error is returned, then the Destination is unmodified.
430
+
403 431
   @param  Destination              A pointer to a Null-terminated Ascii string.
404 432
   @param  DestMax                  The maximum number of Destination Ascii
405 433
                                    char, including terminating null char.
@@ -430,8 +458,12 @@ AsciiStrnCpyS (
430 458
   Appends a copy of the string pointed to by Source (including the terminating
431 459
   null char) to the end of the string pointed to by Destination.
432 460
 
461
+  This function is similar as strcat_s defined in C11.
462
+
433 463
   If an error would be returned, then the function will also ASSERT().
434 464
 
465
+  If an error is returned, then the Destination is unmodified.
466
+
435 467
   @param  Destination              A pointer to a Null-terminated Ascii string.
436 468
   @param  DestMax                  The maximum number of Destination Ascii
437 469
                                    char, including terminating null char.
@@ -464,8 +496,12 @@ AsciiStrCatS (
464 496
   copied from Source, then Destination[StrLen(Destination) + Length] is always
465 497
   set to null.
466 498
 
499
+  This function is similar as strncat_s defined in C11.
500
+
467 501
   If an error would be returned, then the function will also ASSERT().
468 502
 
503
+  If an error is returned, then the Destination is unmodified.
504
+
469 505
   @param  Destination              A pointer to a Null-terminated Ascii string.
470 506
   @param  DestMax                  The maximum number of Destination Ascii
471 507
                                    char, including terminating null char.
@@ -986,7 +1022,11 @@ StrHexToUint64 (
986 1022
   IN      CONST CHAR16             *String
987 1023
   );
988 1024
 
1025
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1026
+
989 1027
 /**
1028
+  [ATTENTION] This function is deprecated for security reason.
1029
+
990 1030
   Convert a Null-terminated Unicode string to a Null-terminated
991 1031
   ASCII string and returns the ASCII string.
992 1032
 
@@ -1026,6 +1066,56 @@ UnicodeStrToAsciiStr (
1026 1066
   OUT     CHAR8                     *Destination
1027 1067
   );
1028 1068
 
1069
+#endif
1070
+
1071
+/**
1072
+  Convert a Null-terminated Unicode string to a Null-terminated
1073
+  ASCII string.
1074
+
1075
+  This function is similar to AsciiStrCpyS.
1076
+
1077
+  This function converts the content of the Unicode string Source
1078
+  to the ASCII string Destination by copying the lower 8 bits of
1079
+  each Unicode character. The function terminates the ASCII string
1080
+  Destination by appending a Null-terminator character at the end.
1081
+
1082
+  The caller is responsible to make sure Destination points to a buffer with size
1083
+  equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
1084
+
1085
+  If any Unicode characters in Source contain non-zero value in
1086
+  the upper 8 bits, then ASSERT().
1087
+
1088
+  If Source is not aligned on a 16-bit boundary, then ASSERT().
1089
+  If an error would be returned, then the function will also ASSERT().
1090
+
1091
+  If an error is returned, then the Destination is unmodified.
1092
+
1093
+  @param  Source        The pointer to a Null-terminated Unicode string.
1094
+  @param  Destination   The pointer to a Null-terminated ASCII string.
1095
+  @param  DestMax       The maximum number of Destination Ascii
1096
+                        char, including terminating null char.
1097
+
1098
+  @retval RETURN_SUCCESS           String is converted.
1099
+  @retval RETURN_BUFFER_TOO_SMALL  If DestMax is NOT greater than StrLen(Source).
1100
+  @retval RETURN_INVALID_PARAMETER If Destination is NULL.
1101
+                                   If Source is NULL.
1102
+                                   If PcdMaximumAsciiStringLength is not zero,
1103
+                                    and DestMax is greater than
1104
+                                    PcdMaximumAsciiStringLength.
1105
+                                   If PcdMaximumUnicodeStringLength is not zero,
1106
+                                    and DestMax is greater than
1107
+                                    PcdMaximumUnicodeStringLength.
1108
+                                   If DestMax is 0.
1109
+  @retval RETURN_ACCESS_DENIED     If Source and Destination overlap.
1110
+
1111
+**/
1112
+RETURN_STATUS
1113
+EFIAPI
1114
+UnicodeStrToAsciiStrS (
1115
+  IN      CONST CHAR16              *Source,
1116
+  OUT     CHAR8                     *Destination,
1117
+  IN      UINTN                     DestMax
1118
+  );
1029 1119
 
1030 1120
 #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1031 1121
 
@@ -1529,8 +1619,11 @@ AsciiStrHexToUint64 (
1529 1619
   IN      CONST CHAR8                *String
1530 1620
   );
1531 1621
 
1622
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1532 1623
 
1533 1624
 /**
1625
+  [ATTENTION] This function is deprecated for security reason.
1626
+
1534 1627
   Convert one Null-terminated ASCII string to a Null-terminated
1535 1628
   Unicode string and returns the Unicode string.
1536 1629
 
@@ -1564,6 +1657,52 @@ AsciiStrToUnicodeStr (
1564 1657
   OUT     CHAR16                    *Destination
1565 1658
   );
1566 1659
 
1660
+#endif
1661
+
1662
+/**
1663
+  Convert one Null-terminated ASCII string to a Null-terminated
1664
+  Unicode string.
1665
+
1666
+  This function is similar to StrCpyS.
1667
+
1668
+  This function converts the contents of the ASCII string Source to the Unicode
1669
+  string Destination. The function terminates the Unicode string Destination by
1670
+  appending a Null-terminator character at the end.
1671
+
1672
+  The caller is responsible to make sure Destination points to a buffer with size
1673
+  equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
1674
+
1675
+  If Destination is not aligned on a 16-bit boundary, then ASSERT().
1676
+  If an error would be returned, then the function will also ASSERT().
1677
+
1678
+  If an error is returned, then the Destination is unmodified.
1679
+
1680
+  @param  Source        The pointer to a Null-terminated ASCII string.
1681
+  @param  Destination   The pointer to a Null-terminated Unicode string.
1682
+  @param  DestMax       The maximum number of Destination Unicode
1683
+                        char, including terminating null char.
1684
+
1685
+  @retval RETURN_SUCCESS           String is converted.
1686
+  @retval RETURN_BUFFER_TOO_SMALL  If DestMax is NOT greater than StrLen(Source).
1687
+  @retval RETURN_INVALID_PARAMETER If Destination is NULL.
1688
+                                   If Source is NULL.
1689
+                                   If PcdMaximumUnicodeStringLength is not zero,
1690
+                                    and DestMax is greater than
1691
+                                    PcdMaximumUnicodeStringLength.
1692
+                                   If PcdMaximumAsciiStringLength is not zero,
1693
+                                    and DestMax is greater than
1694
+                                    PcdMaximumAsciiStringLength.
1695
+                                   If DestMax is 0.
1696
+  @retval RETURN_ACCESS_DENIED     If Source and Destination overlap.
1697
+
1698
+**/
1699
+RETURN_STATUS
1700
+EFIAPI
1701
+AsciiStrToUnicodeStrS (
1702
+  IN      CONST CHAR8               *Source,
1703
+  OUT     CHAR16                    *Destination,
1704
+  IN      UINTN                     DestMax
1705
+  );
1567 1706
 
1568 1707
 /**
1569 1708
   Converts an 8-bit value to an 8-bit BCD value.
@@ -1635,7 +1774,7 @@ PathRemoveLastItem(
1635 1774
 
1636 1775
   @param[in] Path       The pointer to the string containing the path.
1637 1776
 
1638
-  @return       Returns Path, otherwise returns NULL to indicate that an error has occured.
1777
+  @return       Returns Path, otherwise returns NULL to indicate that an error has occurred.
1639 1778
 **/
1640 1779
 CHAR16*
1641 1780
 EFIAPI

+ 3
- 3
src/include/ipxe/efi/Pi/PiHob.h 查看文件

@@ -1,7 +1,7 @@
1 1
 /** @file
2 2
   HOB related definitions in PI.
3 3
 
4
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
4
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 5
 This program and the accompanying materials are licensed and made available under
6 6
 the terms and conditions of the BSD License that accompanies this distribution.
7 7
 The full text of the license may be found at
@@ -11,7 +11,7 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 11
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 12
 
13 13
   @par Revision Reference:
14
-  PI Version 1.4
14
+  PI Version 1.4a
15 15
 
16 16
 **/
17 17
 
@@ -295,7 +295,7 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
295 295
 #define EFI_RESOURCE_ATTRIBUTE_PERSISTABLE              0x01000000
296 296
 
297 297
 #define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED      0x00040000
298
-#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE    0x00800000
298
+#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE    0x00080000
299 299
 
300 300
 //
301 301
 // Physical memory relative reliability attribute. This

+ 13
- 2
src/include/ipxe/efi/Protocol/DevicePath.h 查看文件

@@ -5,7 +5,7 @@
5 5
   from a software point of view. The path must persist from boot to boot, so
6 6
   it can not contain things like PCI bus numbers that change from boot to boot.
7 7
 
8
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
8
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
9 9
 This program and the accompanying materials are licensed and made available under
10 10
 the terms and conditions of the BSD License that accompanies this distribution.
11 11
 The full text of the license may be found at
@@ -511,7 +511,7 @@ typedef struct {
511 511
   UINT16                          HBAPortNumber;
512 512
   ///
513 513
   /// The Port multiplier port number that facilitates the connection
514
-  /// to the device. Bit 15 should be set if the device is directly
514
+  /// to the device. Must be set to 0xFFFF if the device is directly
515 515
   /// connected to the HBA.
516 516
   ///
517 517
   UINT16                          PortMultiplierPortNumber;
@@ -856,6 +856,15 @@ typedef struct {
856 856
   UINT8                           SlotNumber;
857 857
 } SD_DEVICE_PATH;
858 858
 
859
+///
860
+/// EMMC (Embedded MMC) Device Path SubType.
861
+///
862
+#define MSG_EMMC_DP                 0x1D
863
+typedef struct {
864
+  EFI_DEVICE_PATH_PROTOCOL        Header;
865
+  UINT8                           SlotNumber;
866
+} EMMC_DEVICE_PATH;
867
+
859 868
 ///
860 869
 /// iSCSI Device Path SubType
861 870
 ///
@@ -1241,6 +1250,7 @@ typedef union {
1241 1250
   WIFI_DEVICE_PATH                           WiFi;
1242 1251
   UFS_DEVICE_PATH                            Ufs;
1243 1252
   SD_DEVICE_PATH                             Sd;
1253
+  EMMC_DEVICE_PATH                           Emmc;
1244 1254
   HARDDRIVE_DEVICE_PATH                      HardDrive;
1245 1255
   CDROM_DEVICE_PATH                          CD;
1246 1256
 
@@ -1297,6 +1307,7 @@ typedef union {
1297 1307
   WIFI_DEVICE_PATH                           *WiFi;
1298 1308
   UFS_DEVICE_PATH                            *Ufs;
1299 1309
   SD_DEVICE_PATH                             *Sd;
1310
+  EMMC_DEVICE_PATH                           *Emmc;
1300 1311
   HARDDRIVE_DEVICE_PATH                      *HardDrive;
1301 1312
   CDROM_DEVICE_PATH                          *CD;
1302 1313
 

+ 3
- 1
src/include/ipxe/efi/Protocol/HiiImage.h 查看文件

@@ -1,7 +1,7 @@
1 1
 /** @file
2 2
   The file provides services to access to images in the images database.
3 3
 
4
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 5
   This program and the accompanying materials
6 6
   are licensed and made available under the terms and conditions of the BSD License
7 7
   which accompanies this distribution.  The full text of the license may be found at
@@ -17,6 +17,8 @@
17 17
 
18 18
 FILE_LICENCE ( BSD3 );
19 19
 
20
+#include <ipxe/efi/Protocol/GraphicsOutput.h>
21
+
20 22
 #define EFI_HII_IMAGE_PROTOCOL_GUID \
21 23
   { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }
22 24
 

+ 2
- 2
src/include/ipxe/efi/Protocol/Mtftp4.h 查看文件

@@ -1,5 +1,5 @@
1 1
 /** @file
2
-  EFI Multicast Trivial File Tranfer Protocol Definition
2
+  EFI Multicast Trivial File Transfer Protocol Definition
3 3
 
4 4
 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 5
 This program and the accompanying materials are licensed and made available under
@@ -214,7 +214,7 @@ EFI_STATUS
214 214
   );
215 215
 
216 216
 /**
217
-  Timeout callback funtion.
217
+  Timeout callback function.
218 218
 
219 219
   @param  This           The pointer to the EFI_MTFTP4_PROTOCOL instance.
220 220
   @param  Token          The token that is provided in the

+ 1
- 1
src/include/ipxe/efi/Protocol/SimpleTextOut.h 查看文件

@@ -162,7 +162,7 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
162 162
   Reset the text output device hardware and optionaly run diagnostics
163 163
 
164 164
   @param  This                 The protocol instance pointer.
165
-  @param  ExtendedVerification Driver may perform more exhaustive verfication
165
+  @param  ExtendedVerification Driver may perform more exhaustive verification
166 166
                                operation of the device during reset.
167 167
 
168 168
   @retval EFI_SUCCESS          The text output device was reset.

+ 23
- 1
src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h 查看文件

@@ -3,7 +3,8 @@
3 3
   IFR is primarily consumed by the EFI presentation engine, and produced by EFI
4 4
   internal application and drivers as well as all add-in card option-ROM drivers
5 5
 
6
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
6
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
7
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
7 8
 This program and the accompanying materials are licensed and made available under
8 9
 the terms and conditions of the BSD License that accompanies this distribution.
9 10
 The full text of the license may be found at
@@ -211,6 +212,7 @@ typedef struct _EFI_HII_FONT_PACKAGE_HDR {
211 212
 #define EFI_HII_GIBT_GLYPHS               0x11
212 213
 #define EFI_HII_GIBT_GLYPH_DEFAULT        0x12
213 214
 #define EFI_HII_GIBT_GLYPHS_DEFAULT       0x13
215
+#define EFI_HII_GIBT_GLYPH_VARIABILITY    0x14
214 216
 #define EFI_HII_GIBT_DUPLICATE            0x20
215 217
 #define EFI_HII_GIBT_SKIP2                0x21
216 218
 #define EFI_HII_GIBT_SKIP1                0x22
@@ -283,6 +285,13 @@ typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
283 285
   UINT8                  BitmapData[1];
284 286
 } EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
285 287
 
288
+typedef struct _EFI_HII_GIBT_VARIABILITY_BLOCK {
289
+  EFI_HII_GLYPH_BLOCK    Header;
290
+  EFI_HII_GLYPH_INFO     Cell;
291
+  UINT8                  GlyphPackInBits;
292
+  UINT8                  BitmapData [1];
293
+} EFI_HII_GIBT_VARIABILITY_BLOCK;
294
+
286 295
 typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
287 296
   EFI_HII_GLYPH_BLOCK    Header;
288 297
   UINT8                  SkipCount;
@@ -491,6 +500,7 @@ typedef struct _EFI_HII_IMAGE_BLOCK {
491 500
 #define EFI_HII_IIBT_IMAGE_24BIT       0x16
492 501
 #define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
493 502
 #define EFI_HII_IIBT_IMAGE_JPEG        0x18
503
+#define EFI_HII_IIBT_IMAGE_PNG         0x19
494 504
 #define EFI_HII_IIBT_DUPLICATE         0x20
495 505
 #define EFI_HII_IIBT_SKIP2             0x21
496 506
 #define EFI_HII_IIBT_SKIP1             0x22
@@ -611,6 +621,12 @@ typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
611 621
   UINT8                        Data[1];
612 622
 } EFI_HII_IIBT_JPEG_BLOCK;
613 623
 
624
+typedef struct _EFI_HII_IIBT_PNG_BLOCK {
625
+  EFI_HII_IMAGE_BLOCK          Header;
626
+  UINT32                       Size;
627
+  UINT8                        Data[1];
628
+} EFI_HII_IIBT_PNG_BLOCK;
629
+
614 630
 typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
615 631
   EFI_HII_IMAGE_BLOCK          Header;
616 632
   UINT8                        SkipCount;
@@ -2112,4 +2128,10 @@ typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
2112 2128
 ///
2113 2129
 #define STRING_TOKEN(t) t
2114 2130
 
2131
+///
2132
+/// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
2133
+/// here for the easy access by C files and VFR source files.
2134
+///
2135
+#define IMAGE_TOKEN(t) t
2136
+
2115 2137
 #endif

+ 1
- 1
src/include/ipxe/efi/Uefi/UefiPxe.h 查看文件

@@ -1081,7 +1081,7 @@ typedef struct s_pxe_cpb_start_31 {
1081 1081
 
1082 1082
   ///
1083 1083
   /// protocol driver can provide anything for this Unique_ID, UNDI remembers
1084
-  /// that as just a 64bit value assocaited to the interface specified by
1084
+  /// that as just a 64bit value associated to the interface specified by
1085 1085
   /// the ifnum and gives it back as a parameter to all the call-back routines
1086 1086
   /// when calling for that interface!
1087 1087
   ///

+ 6
- 2
src/include/ipxe/efi/Uefi/UefiSpec.h 查看文件

@@ -1006,11 +1006,15 @@ EFI_STATUS
1006 1006
 
1007 1007
   @param[in]  ResetType         The type of reset to perform.
1008 1008
   @param[in]  ResetStatus       The status code for the reset.
1009
-  @param[in]  DataSize          The size, in bytes, of WatchdogData.
1009
+  @param[in]  DataSize          The size, in bytes, of ResetData.
1010 1010
   @param[in]  ResetData         For a ResetType of EfiResetCold, EfiResetWarm, or
1011 1011
                                 EfiResetShutdown the data buffer starts with a Null-terminated
1012 1012
                                 string, optionally followed by additional binary data.
1013
-
1013
+                                The string is a description that the caller may use to further
1014
+                                indicate the reason for the system reset. ResetData is only
1015
+                                valid if ResetStatus is something other than EFI_SUCCESS
1016
+                                unless the ResetType is EfiResetPlatformSpecific
1017
+                                where a minimum amount of ResetData is always required.
1014 1018
 **/
1015 1019
 typedef
1016 1020
 VOID

+ 15
- 2
src/include/ipxe/efi/X64/ProcessorBind.h 查看文件

@@ -29,6 +29,19 @@ FILE_LICENCE ( BSD3 );
29 29
 #pragma pack()
30 30
 #endif
31 31
 
32
+#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
33
+//
34
+// Mark all symbol declarations and references as hidden, meaning they will
35
+// not be subject to symbol preemption. This allows the compiler to refer to
36
+// symbols directly using relative references rather than via the GOT, which
37
+// contains absolute symbol addresses that are subject to runtime relocation.
38
+//
39
+// The LTO linker will not emit GOT based relocations when all symbol
40
+// references can be resolved locally, and so there is no need to set the
41
+// pragma in that case (and doing so will cause other issues).
42
+//
43
+#pragma GCC visibility push (hidden)
44
+#endif
32 45
 
33 46
 #if defined(__INTEL_COMPILER)
34 47
 //
@@ -82,7 +95,7 @@ FILE_LICENCE ( BSD3 );
82 95
 #pragma warning ( disable : 4057 )
83 96
 
84 97
 //
85
-// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
98
+// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
86 99
 //
87 100
 #pragma warning ( disable : 4127 )
88 101
 
@@ -121,7 +134,7 @@ FILE_LICENCE ( BSD3 );
121 134
 
122 135
 #if defined(_MSC_EXTENSIONS)
123 136
   //
124
-  // use Microsoft C complier dependent integer width types
137
+  // use Microsoft C compiler dependent integer width types
125 138
   //
126 139
 
127 140
   ///

Loading…
取消
儲存