84 IN EFI_GUID *ConsoleGuid,
85 IN OUT EFI_HANDLE *ConsoleHandle,
86 IN OUT VOID **ProtocolInterface
91 EFI_DEVICE_PATH_PROTOCOL *FullDevicePath;
92 EFI_DEVICE_PATH_PROTOCOL *VarConsole;
93 EFI_DEVICE_PATH_PROTOCOL *Instance;
98 ASSERT (ConsoleHandle != NULL);
99 ASSERT (ConsoleGuid != NULL);
100 ASSERT (ProtocolInterface != NULL);
102 if (*ConsoleHandle != NULL) {
103 Status =
gBS->HandleProtocol (
108 if ((Status == EFI_SUCCESS) && (Interface == *ProtocolInterface)) {
125 if (VarConsole == NULL) {
132 FullDevicePath = VarConsole;
138 Instance = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);
139 if (Instance == NULL) {
140 FreePool (FullDevicePath);
147 Status =
gBS->LocateDevicePath (
152 if (!EFI_ERROR (Status)) {
156 Status =
gBS->HandleProtocol (
161 if (!EFI_ERROR (Status)) {
165 *ConsoleHandle = NewHandle;
166 *ProtocolInterface = Interface;
170 }
while (Instance != NULL);
199 IN CHAR16 *ConVarName,
200 IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath,
201 IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath
205 EFI_DEVICE_PATH_PROTOCOL *VarConsole;
206 UINTN DevicePathSize;
207 EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
208 EFI_DEVICE_PATH_PROTOCOL *TempNewDevicePath;
218 if (CustomizedConDevicePath == ExclusiveDevicePath) {
219 return EFI_UNSUPPORTED;
234 NewDevicePath = VarConsole;
240 if ((ExclusiveDevicePath != NULL) && (VarConsole != NULL)) {
247 if (CustomizedConDevicePath != NULL) {
257 TempNewDevicePath = NewDevicePath;
258 NewDevicePath = AppendDevicePathInstance (NewDevicePath, CustomizedConDevicePath);
259 if (TempNewDevicePath != NULL) {
260 FreePool (TempNewDevicePath);
272 Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE;
277 Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
283 DevicePathSize = GetDevicePathSize (NewDevicePath);
284 Status =
gRT->SetVariable (
291 if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {
292 Status = EFI_SUCCESS;
295 ASSERT_EFI_ERROR (Status);
297 if (VarConsole == NewDevicePath) {
298 if (VarConsole != NULL) {
299 FreePool (VarConsole);
302 if (VarConsole != NULL) {
303 FreePool (VarConsole);
306 if (NewDevicePath != NULL) {
307 FreePool (NewDevicePath);
335 IN CHAR16 *ConVarName
339 EFI_DEVICE_PATH_PROTOCOL *StartDevicePath;
341 EFI_DEVICE_PATH_PROTOCOL *Instance;
342 EFI_DEVICE_PATH_PROTOCOL *Next;
343 EFI_DEVICE_PATH_PROTOCOL *CopyOfDevicePath;
347 Status = EFI_SUCCESS;
358 if (StartDevicePath == NULL) {
359 return EFI_UNSUPPORTED;
362 CopyOfDevicePath = StartDevicePath;
367 Instance = GetNextDevicePathInstance (&CopyOfDevicePath, &
Size);
368 if (Instance == NULL) {
369 FreePool (StartDevicePath);
370 return EFI_UNSUPPORTED;
374 while (!IsDevicePathEndType (Next)) {
375 Next = NextDevicePathNode (Next);
378 SetDevicePathEndNode (Next);
385 if ((DevicePathType (Instance) == MESSAGING_DEVICE_PATH) &&
386 ( (DevicePathSubType (Instance) == MSG_USB_CLASS_DP)
387 || (DevicePathSubType (Instance) == MSG_USB_WWID_DP)
391 if (!EFI_ERROR (Status)) {
400 if (EFI_ERROR (Status)) {
411 }
while (CopyOfDevicePath != NULL);
413 FreePool (StartDevicePath);
416 return EFI_NOT_FOUND;
511 BOOLEAN SystemTableUpdated;
522 if (EFI_ERROR (Status)) {
538 SystemTableUpdated = FALSE;
543 SystemTableUpdated = TRUE;
547 SystemTableUpdated = TRUE;
551 SystemTableUpdated = TRUE;
554 if (SystemTableUpdated) {
559 gBS->CalculateCrc32 (