]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BdsInternal.h
SecurityPkg: INF/DEC file updates to EDK II packages
[mirror_edk2.git] / ArmPlatformPkg / Bds / BdsInternal.h
index 426d61e3cf28e8cfd96e7460f40687fb34a8ee48..f14e28591a095794b43835dbe9d55eca933bc796 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -18,7 +18,6 @@
 #include <PiDxe.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/BdsLib.h>\r
-#include <Library/BdsUnixLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/UefiLib.h>\r
 \r
 #define ARM_BDS_OPTIONAL_DATA_SIGNATURE   SIGNATURE_32('a', 'b', 'o', 'd')\r
 \r
-#define IS_ARM_BDS_BOOTENTRY(ptr)  (ReadUnaligned32 ((CONST UINT32*)&((ARM_BDS_LOADER_OPTIONAL_DATA*)((ptr)->OptionalData))->Header.Signature) == ARM_BDS_OPTIONAL_DATA_SIGNATURE)\r
+#define IS_ARM_BDS_BOOTENTRY(ptr)  \\r
+  (((ptr)->OptionalData != NULL) && \\r
+   (ReadUnaligned32 ((CONST UINT32*)&((ARM_BDS_LOADER_OPTIONAL_DATA*)((ptr)->OptionalData))->Header.Signature) \\r
+      == ARM_BDS_OPTIONAL_DATA_SIGNATURE))\r
 \r
 #define UPDATE_BOOT_ENTRY L"Update entry: "\r
 #define DELETE_BOOT_ENTRY L"Delete entry: "\r
+#define MOVE_BOOT_ENTRY   L"Move entry: "\r
 \r
 typedef enum {\r
     BDS_LOADER_EFI_APPLICATION = 0,\r
@@ -100,8 +103,12 @@ typedef struct _BDS_LOAD_OPTION_SUPPORT {
   BDS_SUPPORTED_DEVICE_TYPE   Type;\r
   EFI_STATUS    (*ListDevices)(IN OUT LIST_ENTRY* BdsLoadOptionList);\r
   BOOLEAN       (*IsSupported)(IN  EFI_DEVICE_PATH *DevicePath);\r
-  EFI_STATUS    (*CreateDevicePathNode)(IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode, OUT ARM_BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);\r
-  EFI_STATUS    (*UpdateDevicePathNode)(IN EFI_DEVICE_PATH *OldDevicePath, IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath, OUT ARM_BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);\r
+  EFI_STATUS    (*CreateDevicePathNode)(IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes);\r
+  EFI_STATUS    (*UpdateDevicePathNode)(IN EFI_DEVICE_PATH *OldDevicePath, IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath);\r
+\r
+  /// Define if the boot menu should request if the file is a EFI binary or a Linux kernel\r
+  /// Example: PXE boot always deliver a UEFI application.\r
+  BOOLEAN       RequestBootType;\r
 } BDS_LOAD_OPTION_SUPPORT;\r
 \r
 #define LOAD_OPTION_ENTRY_FROM_LINK(a)  BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link)\r
@@ -158,6 +165,12 @@ GetHIInputIP (
   OUT EFI_IP_ADDRESS   *Ip\r
   );\r
 \r
+EFI_STATUS\r
+EditHIInputIP (\r
+  IN  EFI_IP_ADDRESS  *InIpAddr,\r
+  OUT EFI_IP_ADDRESS  *OutIpAddr\r
+  );\r
+\r
 EFI_STATUS\r
 GetHIInputBoolean (\r
   OUT BOOLEAN *Value\r
@@ -217,7 +230,8 @@ BootOptionCreate (
   IN  CHAR16*                   BootDescription,\r
   IN  EFI_DEVICE_PATH_PROTOCOL* DevicePath,\r
   IN  ARM_BDS_LOADER_TYPE       BootType,\r
-  IN  ARM_BDS_LOADER_ARGUMENTS* BootArguments,\r
+  IN  UINT8*                    OptionalData,\r
+  IN  UINTN                     OptionalDataSize,\r
   OUT BDS_LOAD_OPTION**         BdsLoadOption\r
   );\r
 \r
@@ -228,7 +242,8 @@ BootOptionUpdate (
   IN  CHAR16*                   BootDescription,\r
   IN  EFI_DEVICE_PATH_PROTOCOL* DevicePath,\r
   IN  ARM_BDS_LOADER_TYPE       BootType,\r
-  IN  ARM_BDS_LOADER_ARGUMENTS* BootArguments\r
+  IN UINT8*                     OptionalData,\r
+  IN UINTN                      OptionalDataSize\r
   );\r
 \r
 EFI_STATUS\r
@@ -236,9 +251,42 @@ BootOptionDelete (
   IN  BDS_LOAD_OPTION *BootOption\r
   );\r
 \r
+EFI_STATUS\r
+BootDeviceGetType (\r
+  IN  EFI_DEVICE_PATH* DevicePath,\r
+  OUT ARM_BDS_LOADER_TYPE *BootType,\r
+  OUT UINT32 *Attributes\r
+  );\r
+\r
 EFI_STATUS\r
 BootMenuMain (\r
   VOID\r
   );\r
 \r
+BOOLEAN\r
+IsUnicodeString (\r
+  IN VOID* String\r
+  );\r
+\r
+/*\r
+ * Try to detect if the given string is an ASCII or Unicode string\r
+ *\r
+ * There are actually few limitation to this function but it is mainly to give\r
+ * a user friendly output.\r
+ *\r
+ * Some limitations:\r
+ *   - it only supports unicode string that use ASCII character (< 0x100)\r
+ *   - single character ASCII strings are interpreted as Unicode string\r
+ *   - string cannot be longer than 2 x BOOT_DEVICE_OPTION_MAX (600 bytes)\r
+ *\r
+ * @param String    Buffer that might contain a Unicode or Ascii string\r
+ * @param IsUnicode If not NULL this boolean value returns if the string is an\r
+ *                  ASCII or Unicode string.\r
+ */\r
+BOOLEAN\r
+IsPrintableString (\r
+  IN  VOID*    String,\r
+  OUT BOOLEAN *IsUnicode\r
+  );\r
+\r
 #endif /* _BDSINTERNAL_H_ */\r