Skip to content

Commit

Permalink
OcBootManagementLib: Convert naming from External System Boot to Unma…
Browse files Browse the repository at this point in the history
…naged Boot
  • Loading branch information
mikebeaton committed Sep 2, 2024
1 parent fa4112e commit be9ced4
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 64 deletions.
30 changes: 15 additions & 15 deletions Include/Acidanthera/Library/OcBootManagementLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ typedef UINT32 OC_BOOT_ENTRY_TYPE;
#define OC_BOOT_EXTERNAL_OS BIT6
#define OC_BOOT_EXTERNAL_TOOL BIT7
#define OC_BOOT_SYSTEM BIT8
#define OC_BOOT_EXTERNAL_SYSTEM BIT9
#define OC_BOOT_UNMANAGED BIT9

/**
Picker mode.
Expand Down Expand Up @@ -200,21 +200,21 @@ EFI_STATUS
);

/**
Action to perform as part of executing an external boot system boot entry.
Action to perform as part of executing an unmanaged boot entry.
**/
typedef
EFI_STATUS
(*OC_BOOT_EXTERNAL_SYSTEM_ACTION) (
(*OC_BOOT_UNMANAGED_ACTION) (
IN OUT OC_PICKER_CONTEXT *PickerContext,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
);

/**
Gets Device Path for external boot system boot entry.
Get Device Path for unmanaged boot entry.
**/
typedef
EFI_STATUS
(*OC_BOOT_EXTERNAL_SYSTEM_GET_DP) (
(*OC_BOOT_UNMANAGED_GET_FINAL_DP) (
IN OUT OC_PICKER_CONTEXT *PickerContext,
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
);
Expand All @@ -238,13 +238,13 @@ typedef struct OC_BOOT_ENTRY_ {
//
OC_BOOT_SYSTEM_ACTION SystemAction;
//
// Action to perform on execution. Only valid for external boot system entries.
// Action to perform on execution. Only valid for unmanaged boot entries.
//
OC_BOOT_EXTERNAL_SYSTEM_ACTION ExternalSystemAction;
OC_BOOT_UNMANAGED_ACTION UnmanagedBootAction;
//
// Gets Device Path for external boot system boot entry. Only valid for external boot system entries.
// Get final Device Path for boot entry. Only valid for unmanaged boot entries.
//
OC_BOOT_EXTERNAL_SYSTEM_GET_DP ExternalSystemGetDevicePath;
OC_BOOT_UNMANAGED_GET_FINAL_DP UnmanagedBootGetFinalDevicePath;
//
// Id under which to save entry as default.
//
Expand Down Expand Up @@ -642,17 +642,17 @@ typedef struct {
//
CHAR8 *AudioBaseType;
//
// External boot system action. Boot Entry Protocol only. Optional.
// Unmanaged boot action. Boot Entry Protocol unmanaged boot entries only.
//
OC_BOOT_EXTERNAL_SYSTEM_ACTION ExternalSystemAction;
OC_BOOT_UNMANAGED_ACTION UnmanagedBootAction;
//
// Gets Device Path for external boot system boot entry. Boot Entry Protocol only. Optional.
// Get final Device Path for unmanaged boot entry. Boot Entry Protocol unmanaged boot entries only.
//
OC_BOOT_EXTERNAL_SYSTEM_GET_DP ExternalSystemGetDevicePath;
OC_BOOT_UNMANAGED_GET_FINAL_DP UnmanagedBootGetFinalDevicePath;
//
// External boot system Device Path. Boot Entry Protocol only. Optional.
// Unmanaged boot Device Path. Boot Entry Protocol unmanaged boot entries only.
//
EFI_DEVICE_PATH_PROTOCOL *ExternalSystemDevicePath;
EFI_DEVICE_PATH_PROTOCOL *UnmanagedBootDevicePath;
//
// Whether this entry should be labeled as external to the system. Boot Entry Protocol only. Optional.
//
Expand Down
30 changes: 15 additions & 15 deletions Library/OcBootManagementLib/BootEntryManagement.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ InternalAddBootEntryFromCustomEntry (
return EFI_OUT_OF_RESOURCES;
}

if (!CustomEntry->ExternalSystemAction && !CustomEntry->SystemAction) {
if (!CustomEntry->UnmanagedBootAction && !CustomEntry->SystemAction) {
ASSERT (CustomEntry->Path != NULL);
PathName = AsciiStrCopyToUnicode (CustomEntry->Path, 0);
if (PathName == NULL) {
Expand All @@ -715,19 +715,19 @@ InternalAddBootEntryFromCustomEntry (
DEBUG_INFO,
"OCB: Adding custom entry %s (%a|B:%d) -> %a\n",
BootEntry->Name,
CustomEntry->ExternalSystemAction != NULL ? "ext-action" : (CustomEntry->SystemAction != NULL ? "action" : (CustomEntry->Tool ? "tool" : "os")),
CustomEntry->UnmanagedBootAction != NULL ? "unmanaged" : (CustomEntry->SystemAction != NULL ? "action" : (CustomEntry->Tool ? "tool" : "os")),
IsBootEntryProtocol,
CustomEntry->Path
));

if (CustomEntry->ExternalSystemAction) {
BootEntry->Type = OC_BOOT_EXTERNAL_SYSTEM;
BootEntry->ExternalSystemAction = CustomEntry->ExternalSystemAction;
BootEntry->ExternalSystemGetDevicePath = CustomEntry->ExternalSystemGetDevicePath;
BootEntry->AudioBasePath = CustomEntry->AudioBasePath;
BootEntry->AudioBaseType = CustomEntry->AudioBaseType;
BootEntry->IsExternal = CustomEntry->External;
BootEntry->DevicePath = DuplicateDevicePath (CustomEntry->ExternalSystemDevicePath);
if (CustomEntry->UnmanagedBootAction) {
BootEntry->Type = OC_BOOT_UNMANAGED;
BootEntry->UnmanagedBootAction = CustomEntry->UnmanagedBootAction;
BootEntry->UnmanagedBootGetFinalDevicePath = CustomEntry->UnmanagedBootGetFinalDevicePath;
BootEntry->AudioBasePath = CustomEntry->AudioBasePath;
BootEntry->AudioBaseType = CustomEntry->AudioBaseType;
BootEntry->IsExternal = CustomEntry->External;
BootEntry->DevicePath = DuplicateDevicePath (CustomEntry->UnmanagedBootDevicePath);

if (BootEntry->DevicePath == NULL) {
FreeBootEntry (BootEntry);
Expand Down Expand Up @@ -843,7 +843,7 @@ InternalAddBootEntryFromCustomEntry (
BootEntry->ExposeDevicePath = CustomEntry->RealPath;
BootEntry->FullNvramAccess = CustomEntry->FullNvramAccess;

if ((BootEntry->ExternalSystemAction != NULL) || (BootEntry->SystemAction != NULL)) {
if ((BootEntry->UnmanagedBootAction != NULL) || (BootEntry->SystemAction != NULL)) {
ASSERT (CustomEntry->Arguments == NULL);
} else {
ASSERT (CustomEntry->Arguments != NULL);
Expand All @@ -861,7 +861,7 @@ InternalAddBootEntryFromCustomEntry (

BootEntry->IsCustom = TRUE;
BootEntry->IsBootEntryProtocol = IsBootEntryProtocol;
if (IsBootEntryProtocol && (BootEntry->ExternalSystemAction == NULL) && (BootEntry->SystemAction == NULL)) {
if (IsBootEntryProtocol && (BootEntry->UnmanagedBootAction == NULL) && (BootEntry->SystemAction == NULL)) {
PartitionEntry = OcGetGptPartitionEntry (FileSystem->Handle);
if (PartitionEntry == NULL) {
CopyGuid (&BootEntry->UniquePartitionGUID, &gEfiPartTypeUnusedGuid);
Expand Down Expand Up @@ -2511,9 +2511,9 @@ OcLoadBootEntry (
EFI_HANDLE EntryHandle;
INTERNAL_DMG_LOAD_CONTEXT DmgLoadContext;

if ((BootEntry->Type & OC_BOOT_EXTERNAL_SYSTEM) != 0) {
ASSERT (BootEntry->ExternalSystemAction != NULL);
return BootEntry->ExternalSystemAction (Context, BootEntry->DevicePath);
if ((BootEntry->Type & OC_BOOT_UNMANAGED) != 0) {
ASSERT (BootEntry->UnmanagedBootAction != NULL);
return BootEntry->UnmanagedBootAction (Context, BootEntry->DevicePath);
}

if ((BootEntry->Type & OC_BOOT_SYSTEM) != 0) {
Expand Down
40 changes: 20 additions & 20 deletions Library/OcBootManagementLib/DefaultEntryChoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ OcSetDefaultBootEntry (
UINTN BootChosenIndex;
UINTN Index;
UINTN DevicePathSize;
UINTN ExtSystemDevPathSize;
UINTN UnmanagedBootDevPathSize;
UINTN LoadOptionSize;
UINTN LoadOptionIdSize;
UINTN LoadOptionNameSize;
Expand All @@ -805,7 +805,7 @@ OcSetDefaultBootEntry (

CONST OC_CUSTOM_BOOT_DEVICE_PATH *CustomDevPath;
CONST OC_ENTRY_PROTOCOL_DEVICE_PATH *EntryProtocolDevPath;
EFI_DEVICE_PATH_PROTOCOL *ExtSystemDevPath;
EFI_DEVICE_PATH_PROTOCOL *UnmanagedBootDevPath;
VENDOR_DEVICE_PATH *DestCustomDevPath;
FILEPATH_DEVICE_PATH *DestCustomEntryName;
EFI_DEVICE_PATH_PROTOCOL *DestCustomEndNode;
Expand All @@ -825,16 +825,16 @@ OcSetDefaultBootEntry (
}

//
// Get final device path for external boot system entries.
// Get final device path for unmanaged boot entries.
//
ExtSystemDevPath = NULL;
if ((Entry->Type == OC_BOOT_EXTERNAL_SYSTEM) && (Entry->ExternalSystemGetDevicePath != NULL)) {
ExtSystemDevPath = Entry->DevicePath;
Status = Entry->ExternalSystemGetDevicePath (Context, &ExtSystemDevPath);
UnmanagedBootDevPath = NULL;
if ((Entry->Type == OC_BOOT_UNMANAGED) && (Entry->UnmanagedBootGetFinalDevicePath != NULL)) {
UnmanagedBootDevPath = Entry->DevicePath;
Status = Entry->UnmanagedBootGetFinalDevicePath (Context, &UnmanagedBootDevPath);
if (EFI_ERROR (Status)) {
ExtSystemDevPath = NULL;
UnmanagedBootDevPath = NULL;
} else {
ExtSystemDevPathSize = GetDevicePathSize (ExtSystemDevPath);
UnmanagedBootDevPathSize = GetDevicePathSize (UnmanagedBootDevPath);
}
}

Expand Down Expand Up @@ -890,10 +890,10 @@ OcSetDefaultBootEntry (
continue;
}

if (ExtSystemDevPath != NULL) {
if (UnmanagedBootDevPath != NULL) {
DevicePathSize = GetDevicePathSize (BootOptionDevicePath);
if (DevicePathSize >= ExtSystemDevPathSize) {
MatchedEntry = CompareMem (BootOptionDevicePath, ExtSystemDevPath, ExtSystemDevPathSize) == 0;
if (DevicePathSize >= UnmanagedBootDevPathSize) {
MatchedEntry = CompareMem (BootOptionDevicePath, UnmanagedBootDevPath, UnmanagedBootDevPathSize) == 0;
}
} else {
BootOptionRemainingDevicePath = BootOptionDevicePath;
Expand Down Expand Up @@ -973,8 +973,8 @@ OcSetDefaultBootEntry (
}
}

if (ExtSystemDevPath != NULL) {
DevicePathSize = ExtSystemDevPathSize;
if (UnmanagedBootDevPath != NULL) {
DevicePathSize = UnmanagedBootDevPathSize;
} else if (!Entry->IsCustom) {
DevicePathSize = GetDevicePathSize (Entry->DevicePath);
} else {
Expand Down Expand Up @@ -1021,8 +1021,8 @@ OcSetDefaultBootEntry (
CopyMem (LoadOption + 1, LoadOptionName, LoadOptionNameSize);
}

if (ExtSystemDevPath != NULL) {
CopyMem ((UINT8 *)(LoadOption + 1) + LoadOptionNameSize, ExtSystemDevPath, DevicePathSize);
if (UnmanagedBootDevPath != NULL) {
CopyMem ((UINT8 *)(LoadOption + 1) + LoadOptionNameSize, UnmanagedBootDevPath, DevicePathSize);
} else if (!Entry->IsCustom) {
CopyMem ((UINT8 *)(LoadOption + 1) + LoadOptionNameSize, Entry->DevicePath, DevicePathSize);
} else {
Expand Down Expand Up @@ -1084,9 +1084,9 @@ OcSetDefaultBootEntry (

FreePool (LoadOption);

if (ExtSystemDevPath != NULL) {
FreePool (ExtSystemDevPath);
ExtSystemDevPath = NULL;
if (UnmanagedBootDevPath != NULL) {
FreePool (UnmanagedBootDevPath);
UnmanagedBootDevPath = NULL;
}

if (EFI_ERROR (Status)) {
Expand Down Expand Up @@ -1547,7 +1547,7 @@ InternalLoadBootEntry (
//
// System entries are not loaded but called directly.
//
ASSERT ((BootEntry->Type & OC_BOOT_EXTERNAL_SYSTEM) == 0);
ASSERT ((BootEntry->Type & OC_BOOT_UNMANAGED) == 0);
ASSERT ((BootEntry->Type & OC_BOOT_SYSTEM) == 0);
ASSERT (Context != NULL);
ASSERT (DmgLoadContext != NULL);
Expand Down
2 changes: 1 addition & 1 deletion Platform/OpenCanopy/Views/BootPicker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ BootPickerEntriesSet (
}

break;
case OC_BOOT_EXTERNAL_SYSTEM:
case OC_BOOT_UNMANAGED:
if (OcAsciiStriStr (Entry->Flavour, OC_FLAVOUR_WINDOWS) != NULL) {
Status = CopyLabel (&VolumeEntry->Label, &GuiContext->Labels[LABEL_WINDOWS]);
} else {
Expand Down
26 changes: 13 additions & 13 deletions Platform/OpenLegacyBoot/OpenLegacyBoot.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ FreePickerEntry (

STATIC
EFI_STATUS
ExternalSystemActionDoLegacyBoot (
UnmanagedBootActionDoLegacyBoot (
IN OUT OC_PICKER_CONTEXT *PickerContext,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
Expand Down Expand Up @@ -211,7 +211,7 @@ ExternalSystemActionDoLegacyBoot (

STATIC
EFI_STATUS
ExternalSystemGetDevicePath (
UnmanagedBootGetFinalDevicePath (
IN OUT OC_PICKER_CONTEXT *PickerContext,
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
Expand Down Expand Up @@ -416,17 +416,17 @@ OcGetLegacyBootEntries (
PickerEntry->Name = GetLegacyEntryName (LegacyOsType);
}

PickerEntry->Id = AsciiDevicePath;
PickerEntry->Path = NULL;
PickerEntry->Arguments = NULL;
PickerEntry->Flavour = GetLegacyEntryFlavour (LegacyOsType);
PickerEntry->Tool = FALSE;
PickerEntry->TextMode = FALSE;
PickerEntry->RealPath = FALSE;
PickerEntry->External = IsExternal;
PickerEntry->ExternalSystemAction = ExternalSystemActionDoLegacyBoot;
PickerEntry->ExternalSystemGetDevicePath = ExternalSystemGetDevicePath;
PickerEntry->ExternalSystemDevicePath = BlockDevicePath;
PickerEntry->Id = AsciiDevicePath;
PickerEntry->Path = NULL;
PickerEntry->Arguments = NULL;
PickerEntry->Flavour = GetLegacyEntryFlavour (LegacyOsType);
PickerEntry->Tool = FALSE;
PickerEntry->TextMode = FALSE;
PickerEntry->RealPath = FALSE;
PickerEntry->External = IsExternal;
PickerEntry->UnmanagedBootAction = UnmanagedBootActionDoLegacyBoot;
PickerEntry->UnmanagedBootGetFinalDevicePath = UnmanagedBootGetFinalDevicePath;
PickerEntry->UnmanagedBootDevicePath = BlockDevicePath;

if ((PickerEntry->Name == NULL) || (PickerEntry->Flavour == NULL)) {
OcFlexArrayFree (&FlexPickerEntries);
Expand Down

0 comments on commit be9ced4

Please sign in to comment.