audk/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h

175 lines
5.1 KiB
C

/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ConPlatform.h
Abstract:
--*/
#ifndef CON_MANAGE_H_
#define CON_MANAGE_H_
#include <Uefi.h>
#include <Protocol/SimpleTextOut.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ConsoleInDevice.h>
#include <Protocol/DevicePath.h>
#include <Protocol/SimpleTextIn.h>
#include <Guid/HotPlugDevice.h>
#include <Guid/StandardErrorDevice.h>
#include <Guid/ConsoleOutDevice.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
//
// Driver Binding Externs
//
extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;
extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;
#define VarConsoleInpDev L"ConInDev"
#define VarConsoleInp L"ConIn"
#define VarConsoleOutDev L"ConOutDev"
#define VarConsoleOut L"ConOut"
#define VarErrorOutDev L"ErrOutDev"
#define VarErrorOut L"ErrOut"
typedef enum {
CHECK,
APPEND,
DELETE
} CONPLATFORM_VAR_OPERATION;
EFI_STATUS
ConPlatformDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,
IN EFI_GUID *ProtocolGuid
);
EFI_STATUS
EFIAPI
ConPlatformTextInDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
ConPlatformTextOutDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
ConPlatformTextInDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
ConPlatformTextOutDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
ConPlatformTextInDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
EFI_STATUS
EFIAPI
ConPlatformTextOutDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
VOID
ConPlatformUnInstallProtocol (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_GUID *ProtocolGuid
);
VOID *
ConPlatformGetVariable (
IN CHAR16 *Name
);
EFI_STATUS
ConPlatformMatchDevicePaths (
IN EFI_DEVICE_PATH_PROTOCOL * Multi,
IN EFI_DEVICE_PATH_PROTOCOL * Single,
IN EFI_DEVICE_PATH_PROTOCOL **NewDevicePath OPTIONAL,
IN BOOLEAN Delete
);
EFI_STATUS
ConPlatformUpdateDeviceVariable (
IN CHAR16 *VariableName,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONPLATFORM_VAR_OPERATION Operation
);
BOOLEAN
IsHotPlugDevice (
EFI_HANDLE DriverBindingHandle,
EFI_HANDLE ControllerHandle
);
//
// EFI Component Name Functions
//
EFI_STATUS
EFIAPI
ConPlatformComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
EFI_STATUS
EFIAPI
ConPlatformComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
#endif