Check in following modules,
DxeIpl ConPlatform ConSplitter GraphicsConsole Terminal DevicePath git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3069 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
950
IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
Normal file
950
IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
Normal file
@ -0,0 +1,950 @@
|
||||
/** @file
|
||||
This file defines the Human Interface Infrastructure protocol which will
|
||||
be used by resources which want to publish IFR/Font/String data and have it
|
||||
collected by the Configuration engine.
|
||||
|
||||
Copyright (c) 2007, 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: FrameworkHii.h
|
||||
|
||||
@par Revision Reference:
|
||||
This protocol is defined in HII spec 0.92.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _FRAMEWORK_HII_H_
|
||||
#define _FRAMEWORK_HII_H_
|
||||
|
||||
#include <PiDxe.h>
|
||||
|
||||
//
|
||||
// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
|
||||
// is defined in MdePkg/Protocol/GraphicsOutput.h
|
||||
//
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
|
||||
#define EFI_HII_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
|
||||
}
|
||||
|
||||
// BugBug:
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// If UGA goes away we need to put this some place. I'm not sure where?
|
||||
//
|
||||
//typedef struct {
|
||||
// UINT8 Blue;
|
||||
// UINT8 Green;
|
||||
// UINT8 Red;
|
||||
// UINT8 Reserved;
|
||||
//} EFI_UGA_PIXEL;
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//
|
||||
|
||||
typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
|
||||
|
||||
//
|
||||
// Global definition
|
||||
//
|
||||
#define NARROW_CHAR 0xFFF0
|
||||
#define WIDE_CHAR 0xFFF1
|
||||
#define NON_BREAKING_CHAR 0xFFF2
|
||||
#define GLYPH_WIDTH 8
|
||||
#define GLYPH_HEIGHT 19
|
||||
|
||||
#define EFI_HII_FONT 1
|
||||
#define EFI_HII_STRING 2
|
||||
#define EFI_HII_IFR 3
|
||||
#define EFI_HII_KEYBOARD 4
|
||||
#define EFI_HII_HANDLES 5
|
||||
#define EFI_HII_VARIABLE 6
|
||||
#define EFI_HII_DEVICE_PATH 7
|
||||
|
||||
|
||||
// References to string tokens must use this macro to enable scanning for
|
||||
// token usages.
|
||||
//
|
||||
#define STRING_TOKEN(t) t
|
||||
|
||||
//
|
||||
// The following types are currently defined:
|
||||
//
|
||||
typedef UINT16 EFI_FORM_ID;
|
||||
typedef UINT16 EFI_FORM_LABEL;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
UINT32 Length;
|
||||
UINT16 Type;
|
||||
} EFI_HII_PACK_HEADER;
|
||||
|
||||
//
|
||||
// A form list consists of a large variety of structure
|
||||
// possibilities so to represent the binary blob of data
|
||||
// associated with a package of forms, we will assume a
|
||||
// pointer to a self-describing data buffer.
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
} EFI_HII_IFR_PACK;
|
||||
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header; // Must be filled in
|
||||
EFI_HANDLE ImageHandle; // Must be filled in
|
||||
EFI_HANDLE DeviceHandle; // Optional
|
||||
EFI_HANDLE ControllerHandle; // Optional
|
||||
EFI_HANDLE CallbackHandle; // Optional
|
||||
EFI_HANDLE COBExportHandle; // Optional
|
||||
} EFI_HII_HANDLE_PACK;
|
||||
|
||||
//
|
||||
// ********************************************************
|
||||
// EFI_VARIABLE_CONTENTS
|
||||
// ********************************************************
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
EFI_GUID VariableGuid;
|
||||
UINT32 VariableNameLength;
|
||||
UINT16 VariableId;
|
||||
//
|
||||
// CHAR16 VariableName[]; //Null-terminated
|
||||
//
|
||||
} EFI_HII_VARIABLE_PACK;
|
||||
|
||||
//
|
||||
// ********************************************************
|
||||
// EFI_DEVICE_PATH_PACK
|
||||
// ********************************************************
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
//
|
||||
// EFI_DEVICE_PATH DevicePath[];
|
||||
//
|
||||
} EFI_HII_DEVICE_PATH_PACK;
|
||||
|
||||
//
|
||||
// ********************************************************
|
||||
// EFI_HII_DATA_TABLE
|
||||
// ********************************************************
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_GUID PackageGuid;
|
||||
UINT32 DataTableSize;
|
||||
UINT32 IfrDataOffset;
|
||||
UINT32 StringDataOffset;
|
||||
UINT32 VariableDataOffset;
|
||||
UINT32 DevicePathOffset;
|
||||
UINT32 NumberOfVariableData;
|
||||
UINT32 NumberOfLanguages;
|
||||
//
|
||||
// EFI_HII_DEVICE_PATH_PACK DevicePath[];
|
||||
// EFI_HII_VARIABLE_PACK VariableData[];
|
||||
// EFI_HII_IFR_PACK IfrData;
|
||||
// EFI_HII_STRING_PACK StringData[];
|
||||
//
|
||||
} EFI_HII_DATA_TABLE;
|
||||
|
||||
//
|
||||
// ********************************************************
|
||||
// EFI_HII_EXPORT_TABLE
|
||||
// ********************************************************
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 NumberOfHiiDataTables;
|
||||
EFI_GUID Revision;
|
||||
//
|
||||
// EFI_HII_DATA_TABLE HiiDataTable[];
|
||||
//
|
||||
} EFI_HII_EXPORT_TABLE;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
|
||||
EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
|
||||
BOOLEAN FormUpdate; // If TRUE, next variable is significant
|
||||
UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.
|
||||
STRING_REF FormTitle; // If not 0, will update Form with this info
|
||||
UINT16 DataCount; // The number of Data entries in this structure
|
||||
UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
|
||||
} EFI_HII_UPDATE_DATA;
|
||||
|
||||
//
|
||||
// String attributes
|
||||
//
|
||||
#define LANG_RIGHT_TO_LEFT 0x00000001
|
||||
|
||||
//
|
||||
// A string package is used to localize strings to a particular
|
||||
// language. The package is associated with a particular driver
|
||||
// or set of drivers. Tools are used to associate tokens with
|
||||
// string references in forms and in programs. These tokens are
|
||||
// language agnostic. When paired with a language pack (directly
|
||||
// or indirectly), the string token resolves into an actual
|
||||
// UNICODE string. The NumStringPointers determines how many
|
||||
// StringPointers (offset values) there are as well as the total
|
||||
// number of Strings that are defined.
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
RELOFST LanguageNameString;
|
||||
RELOFST PrintableLanguageName;
|
||||
UINT32 NumStringPointers;
|
||||
UINT32 Attributes;
|
||||
//
|
||||
// RELOFST StringPointers[];
|
||||
// EFI_STRING Strings[];
|
||||
//
|
||||
} EFI_HII_STRING_PACK;
|
||||
|
||||
//
|
||||
// Glyph Attributes
|
||||
//
|
||||
#define EFI_GLYPH_NON_SPACING 1
|
||||
#define EFI_GLYPH_WIDE 2
|
||||
|
||||
typedef struct {
|
||||
CHAR16 UnicodeWeight;
|
||||
UINT8 Attributes;
|
||||
UINT8 GlyphCol1[GLYPH_HEIGHT];
|
||||
} EFI_NARROW_GLYPH;
|
||||
|
||||
typedef struct {
|
||||
CHAR16 UnicodeWeight;
|
||||
UINT8 Attributes;
|
||||
UINT8 GlyphCol1[GLYPH_HEIGHT];
|
||||
UINT8 GlyphCol2[GLYPH_HEIGHT];
|
||||
UINT8 Pad[3];
|
||||
} EFI_WIDE_GLYPH;
|
||||
|
||||
//
|
||||
// A font list consists of a font header followed by a series
|
||||
// of glyph structures. Note that fonts are not language specific.
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
UINT16 NumberOfNarrowGlyphs;
|
||||
UINT16 NumberOfWideGlyphs;
|
||||
} EFI_HII_FONT_PACK;
|
||||
|
||||
//
|
||||
// The IfrData in the EFI_HII_IFR_PACK structure definition
|
||||
// is variable length, and not really part of the header. To
|
||||
// simplify from code the size of the header, define an
|
||||
// identical structure that does not include the IfrData field.
|
||||
// Then use sizeof() this new structure to determine the
|
||||
// actual size of the header.
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
} EFI_HII_IFR_PACK_HEADER;
|
||||
|
||||
//
|
||||
// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;
|
||||
//
|
||||
typedef enum {
|
||||
EfiKeyLCtrl,
|
||||
EfiKeyA0,
|
||||
EfiKeyLAlt,
|
||||
EfiKeySpaceBar,
|
||||
EfiKeyA2,
|
||||
EfiKeyA3,
|
||||
EfiKeyA4,
|
||||
EfiKeyRCtrl,
|
||||
EfiKeyLeftArrow,
|
||||
EfiKeyDownArrow,
|
||||
EfiKeyRightArrow,
|
||||
EfiKeyZero,
|
||||
EfiKeyPeriod,
|
||||
EfiKeyEnter,
|
||||
EfiKeyLShift,
|
||||
EfiKeyB0,
|
||||
EfiKeyB1,
|
||||
EfiKeyB2,
|
||||
EfiKeyB3,
|
||||
EfiKeyB4,
|
||||
EfiKeyB5,
|
||||
EfiKeyB6,
|
||||
EfiKeyB7,
|
||||
EfiKeyB8,
|
||||
EfiKeyB9,
|
||||
EfiKeyB10,
|
||||
EfiKeyRshift,
|
||||
EfiKeyUpArrow,
|
||||
EfiKeyOne,
|
||||
EfiKeyTwo,
|
||||
EfiKeyThree,
|
||||
EfiKeyCapsLock,
|
||||
EfiKeyC1,
|
||||
EfiKeyC2,
|
||||
EfiKeyC3,
|
||||
EfiKeyC4,
|
||||
EfiKeyC5,
|
||||
EfiKeyC6,
|
||||
EfiKeyC7,
|
||||
EfiKeyC8,
|
||||
EfiKeyC9,
|
||||
EfiKeyC10,
|
||||
EfiKeyC11,
|
||||
EfiKeyC12,
|
||||
EfiKeyFour,
|
||||
EfiKeyFive,
|
||||
EfiKeySix,
|
||||
EfiKeyPlus,
|
||||
EfiKeyTab,
|
||||
EfiKeyD1,
|
||||
EfiKeyD2,
|
||||
EfiKeyD3,
|
||||
EfiKeyD4,
|
||||
EfiKeyD5,
|
||||
EfiKeyD6,
|
||||
EfiKeyD7,
|
||||
EfiKeyD8,
|
||||
EfiKeyD9,
|
||||
EfiKeyD10,
|
||||
EfiKeyD11,
|
||||
EfiKeyD12,
|
||||
EfiKeyD13,
|
||||
EfiKeyDel,
|
||||
EfiKeyEnd,
|
||||
EfiKeyPgDn,
|
||||
EfiKeySeven,
|
||||
EfiKeyEight,
|
||||
EfiKeyNine,
|
||||
EfiKeyE0,
|
||||
EfiKeyE1,
|
||||
EfiKeyE2,
|
||||
EfiKeyE3,
|
||||
EfiKeyE4,
|
||||
EfiKeyE5,
|
||||
EfiKeyE6,
|
||||
EfiKeyE7,
|
||||
EfiKeyE8,
|
||||
EfiKeyE9,
|
||||
EfiKeyE10,
|
||||
EfiKeyE11,
|
||||
EfiKeyE12,
|
||||
EfiKeyBackSpace,
|
||||
EfiKeyIns,
|
||||
EfiKeyHome,
|
||||
EfiKeyPgUp,
|
||||
EfiKeyNLck,
|
||||
EfiKeySlash,
|
||||
EfiKeyAsterisk,
|
||||
EfiKeyMinus,
|
||||
EfiKeyEsc,
|
||||
EfiKeyF1,
|
||||
EfiKeyF2,
|
||||
EfiKeyF3,
|
||||
EfiKeyF4,
|
||||
EfiKeyF5,
|
||||
EfiKeyF6,
|
||||
EfiKeyF7,
|
||||
EfiKeyF8,
|
||||
EfiKeyF9,
|
||||
EfiKeyF10,
|
||||
EfiKeyF11,
|
||||
EfiKeyF12,
|
||||
EfiKeyPrint,
|
||||
EfiKeySLck,
|
||||
EfiKeyPause
|
||||
} EFI_KEY;
|
||||
|
||||
typedef struct {
|
||||
EFI_KEY Key;
|
||||
CHAR16 Unicode;
|
||||
CHAR16 ShiftedUnicode;
|
||||
CHAR16 AltGrUnicode;
|
||||
CHAR16 ShiftedAltGrUnicode;
|
||||
UINT16 Modifier;
|
||||
} EFI_KEY_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// This structure allows a sparse set of keys to be redefined
|
||||
// or a complete redefinition of the keyboard layout. Most
|
||||
// keyboards have a lot of commonality in their layouts, therefore
|
||||
// only defining those keys that need to change from the default
|
||||
// minimizes the passed in information.
|
||||
//
|
||||
// Additionally, when an update occurs, the active keyboard layout
|
||||
// will be switched to the newly updated keyboard layout. This
|
||||
// allows for situations that when a keyboard layout driver is
|
||||
// loaded as part of system initialization, the system will default
|
||||
// the keyboard behavior to the new layout.
|
||||
//
|
||||
// Each call to update the keyboard mapping should contain the
|
||||
// complete set of key descriptors to be updated, since every
|
||||
// call to the HII which contains an EFI_HII_KEYBOARD_PACK will
|
||||
// wipe the previous set of overrides. A call to
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
EFI_KEY_DESCRIPTOR *Descriptor;
|
||||
UINT8 DescriptorCount;
|
||||
} EFI_HII_KEYBOARD_PACK;
|
||||
|
||||
//
|
||||
// The EFI_HII_PACKAGES can contain different types of packages just
|
||||
// after the structure as inline data.
|
||||
//
|
||||
typedef struct {
|
||||
UINTN NumberOfPackages;
|
||||
EFI_GUID *GuidId;
|
||||
//
|
||||
// EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
|
||||
// EFI_HII_IFR_PACK *IfrPack; // Only one pack.
|
||||
// EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
|
||||
// EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
|
||||
// EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
|
||||
//
|
||||
} EFI_HII_PACKAGES;
|
||||
|
||||
typedef struct _EFI_HII_VARIABLE_PACK_LIST {
|
||||
struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
|
||||
EFI_HII_VARIABLE_PACK *VariablePack;
|
||||
} EFI_HII_VARIABLE_PACK_LIST;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
Registers the various packs that are passed in via the Packages parameter.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Packages A pointer to an EFI_HII_PACKAGES package instance.
|
||||
@param Handle A pointer to the EFI_HII_HANDLE instance.
|
||||
|
||||
@retval EFI_SUCCESS Data was extracted from Packages, the database
|
||||
was updated with the data, and Handle returned successfully.
|
||||
@retval EFI_INVALID_PARAMETER The content of Packages was invalid.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_NEW_PACK) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_PACKAGES *Packages,
|
||||
OUT EFI_HII_HANDLE *Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Removes a package from the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle that was registered to the data that is requested
|
||||
for removal.
|
||||
|
||||
@retval EFI_SUCCESS The data associated with the Handle was removed
|
||||
from the HII database.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was not valid.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_REMOVE_PACK) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Determines the handles that are currently active in the database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param HandleBufferLength On input, a pointer to the length of the handle
|
||||
buffer. On output, the length of the handle buffer that is required
|
||||
for the handles found.
|
||||
@param Handle An array of EFI_HII_HANDLE instances returned.
|
||||
|
||||
@retval EFI_SUCCESS Handle was updated successfully.
|
||||
@retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
|
||||
that Handle is too small to support the number of handles.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_FIND_HANDLES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN OUT UINT16 *HandleBufferLength,
|
||||
OUT EFI_HII_HANDLE *Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Exports the contents of the database into a buffer.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle An EFI_HII_HANDLE that corresponds to the desired
|
||||
handle to export. If the value is 0, the entire database will be exported.
|
||||
In either case, the data will be exported in a format described by the
|
||||
structure definition of EFI_HII_EXPORT_TABLE.
|
||||
@param BufferSize
|
||||
On input, a pointer to the length of the buffer. On output, the length
|
||||
of the buffer that is required for the export data.
|
||||
@param Buffer A pointer to a buffer that will contain the results of the export function.
|
||||
|
||||
@retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
|
||||
@retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_EXPORT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT VOID *Buffer
|
||||
);
|
||||
|
||||
/**
|
||||
Remove any new strings that were added after the initial string export
|
||||
for this handle.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the string resides.
|
||||
|
||||
@retval EFI_SUCCESS Remove strings from the handle successfully.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_RESET_STRINGS) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Tests if all of the characters in a string have corresponding font characters.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param StringToTest A pointer to a Unicode string.
|
||||
@param FirstMissing A pointer to an index into the string. On input,
|
||||
the index of the first character in the StringToTest to examine. On exit,
|
||||
the index of the first character encountered for which a glyph is unavailable.
|
||||
If all glyphs in the string are available, the index is the index of the
|
||||
terminator of the string.
|
||||
@param GlyphBufferSize A pointer to a value. On output, if the function
|
||||
returns EFI_SUCCESS, it contains the amount of memory that is required to
|
||||
store the string's glyph equivalent.
|
||||
|
||||
@retval EFI_SUCCESS All glyphs are available. Note that an empty string
|
||||
always returns this value.
|
||||
@retval EFI_NOT_FOUND A glyph was not found for a character.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_TEST_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN CHAR16 *StringToTest,
|
||||
IN OUT UINT32 *FirstMissing,
|
||||
OUT UINT32 *GlyphBufferSize
|
||||
);
|
||||
|
||||
/**
|
||||
Translates a Unicode character into the corresponding font glyph.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Source A pointer to a Unicode string.
|
||||
@param Index On input, the offset into the string from which to fetch
|
||||
the character.On successful completion, the index is updated to the first
|
||||
character past the character(s) making up the just extracted glyph.
|
||||
@param GlyphBuffer Pointer to an array where the glyphs corresponding
|
||||
to the characters in the source may be stored. GlyphBuffer is assumed
|
||||
to be wide enough to accept a wide glyph character.
|
||||
@param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
|
||||
this value is filled with the length of the glyph in pixels. It is unchanged
|
||||
if the call was unsuccessful.
|
||||
@param InternalStatus The cell pointed to by this parameter must be
|
||||
initialized to zero prior to invoking the call the first time for any string.
|
||||
|
||||
@retval EFI_SUCCESS It worked.
|
||||
@retval EFI_NOT_FOUND A glyph for a character was not found.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_GLYPH) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN CHAR16 *Source,
|
||||
IN OUT UINT16 *Index,
|
||||
OUT UINT8 **GlyphBuffer,
|
||||
OUT UINT16 *BitWidth,
|
||||
IN OUT UINT32 *InternalStatus
|
||||
);
|
||||
|
||||
/**
|
||||
Translates a glyph into the format required for input to the Universal
|
||||
Graphics Adapter (UGA) Block Transfer (BLT) routines.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param GlyphBuffer A pointer to the buffer that contains glyph data.
|
||||
@param Foreground The foreground setting requested to be used for the
|
||||
generated BltBuffer data.
|
||||
@param Background The background setting requested to be used for the
|
||||
generated BltBuffer data.
|
||||
@param Count The entry in the BltBuffer upon which to act.
|
||||
@param Width The width in bits of the glyph being converted.
|
||||
@param Height The height in bits of the glyph being converted
|
||||
@param BltBuffer A pointer to the buffer that contains the data that is
|
||||
ready to be used by the UGA BLT routines.
|
||||
|
||||
@retval EFI_SUCCESS It worked.
|
||||
@retval EFI_NOT_FOUND A glyph for a character was not found.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN UINT8 *GlyphBuffer,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
|
||||
IN UINTN Count,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a new string to be added to an already existing string package.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Pointer to a NULL-terminated string containing a single ISO 639-2
|
||||
language identifier, indicating the language in which the string is translated.
|
||||
@param Handle The handle of the language pack to which the string is to be added.
|
||||
@param Reference The identifier of the string to be added. If the reference
|
||||
value is zero, then the string will be assigned a new identifier on that
|
||||
handle for the language specified. Otherwise, the string will be updated
|
||||
with the NewString Value.
|
||||
@param NewString The string to be added.
|
||||
|
||||
@retval EFI_SUCCESS The string was effectively registered.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_NEW_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN CHAR16 *Language,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN OUT STRING_REF *Reference,
|
||||
IN CHAR16 *NewString
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to determine the primary languages that are supported
|
||||
on a given handle.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the strings reside.
|
||||
@param LanguageString A string allocated by GetPrimaryLanguages() that
|
||||
contains a list of all primary languages registered on the handle.
|
||||
|
||||
@retval EFI_SUCCESS LanguageString was correctly returned.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
OUT EFI_STRING *LanguageString
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to determine which secondary languages are supported
|
||||
on a given handle for a given primary language.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the strings reside.
|
||||
@param PrimaryLanguage Pointer to a NULL-terminated string containing a single
|
||||
ISO 639-2 language identifier, indicating the primary language.
|
||||
@param LanguageString A string allocated by GetSecondaryLanguages()
|
||||
containing a list of all secondary languages registered on the handle.
|
||||
|
||||
@retval EFI_SUCCESS LanguageString was correctly returned.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN CHAR16 *PrimaryLanguage,
|
||||
OUT EFI_STRING *LanguageString
|
||||
);
|
||||
|
||||
/**
|
||||
Extracts a string from a package already registered with the EFI HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the string resides.
|
||||
@param Token The string token assigned to the string.
|
||||
@param Raw If TRUE, the string is returned unedited in the internal
|
||||
storage format described above. If false, the string returned is edited
|
||||
by replacing <cr> with <space> and by removing special characters such
|
||||
as the <wide> prefix.
|
||||
@param LanguageString Pointer to a NULL-terminated string containing a
|
||||
single ISO 639-2 language identifier, indicating the language to print.
|
||||
If the LanguageString is empty (starts with a NULL), the default system
|
||||
language will be used to determine the language.
|
||||
@param BufferLength Length of the StringBuffer.
|
||||
@param StringBuffer The buffer designed to receive the characters in the string.
|
||||
|
||||
@retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
|
||||
@retval EFI_INVALID_PARAMETER The handle or string token is unknown.
|
||||
@retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
|
||||
allow the entire string to be stored.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN STRING_REF Token,
|
||||
IN BOOLEAN Raw,
|
||||
IN CHAR16 *LanguageString,
|
||||
IN OUT UINTN *BufferLength,
|
||||
OUT EFI_STRING StringBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to extract a part of a string of not more than a given width.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the string resides.
|
||||
@param Token The string token assigned to the string.
|
||||
@param Index On input, the offset into the string where the line is to start.
|
||||
On output, the index is updated to point to beyond the last character returned
|
||||
in the call.
|
||||
@param LineWidth The maximum width of the line in units of narrow glyphs.
|
||||
@param LanguageString Pointer to a NULL-terminated string containing a
|
||||
single ISO 639-2 language identifier, indicating the language to print.
|
||||
@param BufferLength Pointer to the length of the StringBuffer.
|
||||
@param StringBuffer The buffer designed to receive the characters in the string.
|
||||
|
||||
@retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
|
||||
@retval EFI_NOT_FOUND The font glyph for at least one of the characters in
|
||||
the string is not in the font database.
|
||||
@retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
|
||||
to allow the entire string to be stored.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_LINE) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN STRING_REF Token,
|
||||
IN OUT UINT16 *Index,
|
||||
IN UINT16 LineWidth,
|
||||
IN CHAR16 *LanguageString,
|
||||
IN OUT UINT16 *BufferLength,
|
||||
OUT EFI_STRING StringBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to extract a form or form package that has previously
|
||||
been registered with the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle Handle on which the form resides.
|
||||
@param FormId The ID of the form to return. If the ID is zero,
|
||||
the entire form package is returned.
|
||||
@param BufferLength On input, the length of the Buffer. On output,
|
||||
the length of the returned buffer,
|
||||
@param Buffer The buffer designed to receive the form(s).
|
||||
|
||||
@retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
|
||||
was updated.
|
||||
@retval EFI_INVALID_PARAMETER The handle is unknown.
|
||||
@retval EFI_NOT_FOUND A form on the requested handle cannot be found with
|
||||
the requested FormId.
|
||||
@retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
|
||||
to allow the form to be stored.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_FORMS) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_FORM_ID FormId,
|
||||
IN OUT UINTN *BufferLength,
|
||||
OUT UINT8 *Buffer
|
||||
);
|
||||
|
||||
/**
|
||||
Extracts the defaults that are associated with a given handle in the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The HII handle from which will have default data retrieved.
|
||||
@param DefaultMask The mask used to specify some type of default override when extracting
|
||||
the default image data.
|
||||
@param VariablePackList A indirect pointer to the first entry of a link list with
|
||||
type EFI_HII_VARIABLE_PACK_LIST.
|
||||
|
||||
@retval EFI_SUCCESS The VariablePackList was populated with the appropriate
|
||||
default setting data.
|
||||
@retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
|
||||
@retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
|
||||
contain invalid data.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN UINTN DefaultMask,
|
||||
OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
|
||||
);
|
||||
|
||||
/**
|
||||
Allows the caller to update a form or form package that has previously been
|
||||
registered with the EFI HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle Handle of the package where the form to be updated resides.
|
||||
@param Label The label inside the form package where the update is to take place.
|
||||
@param AddData If TRUE, adding data at a given Label; otherwise,
|
||||
if FALSE, removing data at a given Label.
|
||||
@param Data The buffer containing the new tags to insert after the Label
|
||||
|
||||
@retval EFI_SUCCESS The form was updated with the new tags.
|
||||
@retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
|
||||
contain an integral number of tags.
|
||||
@retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_UPDATE_FORM) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_FORM_LABEL Label,
|
||||
IN BOOLEAN AddData,
|
||||
IN EFI_HII_UPDATE_DATA *Data
|
||||
);
|
||||
|
||||
/**
|
||||
Retrieves the current keyboard layout.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param DescriptorCount A pointer to the number of Descriptor entries being
|
||||
described in the keyboard layout being retrieved.
|
||||
@param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR
|
||||
entries. Each entry will reflect the definition of a specific physical key.
|
||||
|
||||
@retval EFI_SUCCESS The keyboard layout was retrieved successfully.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
OUT UINT16 *DescriptorCount,
|
||||
OUT EFI_KEY_DESCRIPTOR *Descriptor
|
||||
);
|
||||
|
||||
/**
|
||||
@par Protocol Description:
|
||||
The HII Protocol manages the HII database, which is a repository for data
|
||||
having to do with fonts, strings, forms, keyboards, and other future human
|
||||
interface items.
|
||||
|
||||
@param NewPack
|
||||
Extracts the various packs from a package list.
|
||||
|
||||
@param RemovePack
|
||||
Removes a package from the HII database.
|
||||
|
||||
@param FindHandles
|
||||
Determines the handles that are currently active in the database.
|
||||
|
||||
@param ExportDatabase
|
||||
Export the entire contents of the database to a buffer.
|
||||
|
||||
@param TestString
|
||||
Tests if all of the characters in a string have corresponding font characters.
|
||||
|
||||
@param GetGlyph
|
||||
Translates a Unicode character into the corresponding font glyph.
|
||||
|
||||
@param GlyphToBlt
|
||||
Converts a glyph value into a format that is ready for a UGA BLT command.
|
||||
|
||||
@param NewString
|
||||
Allows a new string to be added to an already existing string package.
|
||||
|
||||
@param GetPrimaryLanguages
|
||||
Allows a program to determine the primary languages that are supported
|
||||
on a given handle.
|
||||
|
||||
@param GetSecondaryLanguages
|
||||
Allows a program to determine which secondary languages are supported
|
||||
on a given handle for a given primary language.
|
||||
|
||||
@param GetString
|
||||
Extracts a string from a package that is already registered with the
|
||||
EFI HII database.
|
||||
|
||||
@param ResetString
|
||||
Remove any new strings that were added after the initial string export
|
||||
for this handle.
|
||||
|
||||
@param GetLine
|
||||
Allows a program to extract a part of a string of not more than a given width.
|
||||
|
||||
@param GetForms
|
||||
Allows a program to extract a form or form package that has been previously registered.
|
||||
|
||||
@param GetDefaultImage
|
||||
Allows a program to extract the nonvolatile image that represents the default storage image.
|
||||
|
||||
@param UpdateForm
|
||||
Allows a program to update a previously registered form.
|
||||
|
||||
@param GetKeyboardLayout
|
||||
Allows a program to extract the current keyboard layout.
|
||||
|
||||
**/
|
||||
struct _EFI_HII_PROTOCOL {
|
||||
EFI_HII_NEW_PACK NewPack;
|
||||
EFI_HII_REMOVE_PACK RemovePack;
|
||||
EFI_HII_FIND_HANDLES FindHandles;
|
||||
EFI_HII_EXPORT ExportDatabase;
|
||||
|
||||
EFI_HII_TEST_STRING TestString;
|
||||
EFI_HII_GET_GLYPH GetGlyph;
|
||||
EFI_HII_GLYPH_TO_BLT GlyphToBlt;
|
||||
|
||||
EFI_HII_NEW_STRING NewString;
|
||||
EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
|
||||
EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
|
||||
EFI_HII_GET_STRING GetString;
|
||||
EFI_HII_RESET_STRINGS ResetStrings;
|
||||
EFI_HII_GET_LINE GetLine;
|
||||
EFI_HII_GET_FORMS GetForms;
|
||||
EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
|
||||
EFI_HII_UPDATE_FORM UpdateForm;
|
||||
|
||||
EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiHiiProtocolGuid;
|
||||
|
||||
#endif
|
56
MdeModulePkg/Core/DxeIplPeim/CommonHeader.h
Normal file
56
MdeModulePkg/Core/DxeIplPeim/CommonHeader.h
Normal file
@ -0,0 +1,56 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <PiPei.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#include <Ppi/DxeIpl.h>
|
||||
#include <Ppi/S3Resume.h>
|
||||
#include <Protocol/EdkDecompress.h>
|
||||
#include <Ppi/EndOfPeiPhase.h>
|
||||
#include <Protocol/CustomizedDecompress.h>
|
||||
#include <Protocol/Decompress.h>
|
||||
#include <Ppi/Security.h>
|
||||
#include <Ppi/SectionExtraction.h>
|
||||
#include <Ppi/LoadFile.h>
|
||||
#include <Ppi/RecoveryModule.h>
|
||||
#include <Ppi/MemoryDiscovered.h>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PeimEntryPoint.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include <Library/PeiServicesLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
#include <Library/CacheMaintenanceLib.h>
|
||||
#include <Library/PeCoffLoaderLib.h>
|
||||
#include <Library/UefiDecompressLib.h>
|
||||
#include <Library/CustomDecompressLib.h>
|
||||
#include <Library/PeiServicesTablePointerLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/PeCoffLib.h>
|
||||
|
||||
#endif
|
28
MdeModulePkg/Core/DxeIplPeim/DxeIpl.dxs
Normal file
28
MdeModulePkg/Core/DxeIplPeim/DxeIpl.dxs
Normal file
@ -0,0 +1,28 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DxeIpl.dxs
|
||||
|
||||
Abstract:
|
||||
|
||||
Dependency expression file for DXE Initial Program Loader PEIM.
|
||||
|
||||
--*/
|
||||
|
||||
#include <PeimDepex.h>
|
||||
|
||||
DEPENDENCY_START
|
||||
EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID
|
||||
DEPENDENCY_END
|
||||
|
||||
|
117
MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
Normal file
117
MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
Normal file
@ -0,0 +1,117 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DxeIpl.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __PEI_DXEIPL_H__
|
||||
#define __PEI_DXEIPL_H__
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#define STACK_SIZE 0x20000
|
||||
#define BSP_STORE_SIZE 0x4000
|
||||
|
||||
#define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))
|
||||
|
||||
extern BOOLEAN gInMemory;
|
||||
|
||||
EFI_STATUS
|
||||
PeiFindFile (
|
||||
IN UINT8 Type,
|
||||
IN UINT16 SectionType,
|
||||
OUT EFI_GUID *FileName,
|
||||
OUT VOID **Pe32Data
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PeiLoadFile (
|
||||
IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,
|
||||
IN VOID *Pe32Data,
|
||||
OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
|
||||
OUT UINT64 *ImageSize,
|
||||
OUT EFI_PHYSICAL_ADDRESS *EntryPoint
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
GetImageReadFunction (
|
||||
IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PeiImageRead (
|
||||
IN VOID *FileHandle,
|
||||
IN UINTN FileOffset,
|
||||
IN OUT UINTN *ReadSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeIplLoadFile (
|
||||
IN EFI_PEI_FV_FILE_LOADER_PPI *This,
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
||||
OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
|
||||
OUT UINT64 *ImageSize,
|
||||
OUT EFI_PHYSICAL_ADDRESS *EntryPoint
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
ShadowDxeIpl (
|
||||
IN EFI_FFS_FILE_HEADER *DxeIpl,
|
||||
IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeLoadCore (
|
||||
IN EFI_DXE_IPL_PPI *This,
|
||||
IN EFI_PEI_SERVICES **PeiServices,
|
||||
IN EFI_PEI_HOB_POINTERS HobList
|
||||
);
|
||||
|
||||
VOID
|
||||
HandOffToDxeCore (
|
||||
IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
|
||||
IN EFI_PEI_HOB_POINTERS HobList,
|
||||
IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
PeiProcessFile (
|
||||
IN UINT16 SectionType,
|
||||
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
||||
OUT VOID **Pe32Data,
|
||||
IN EFI_PEI_HOB_POINTERS *OrigHob
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeimInitializeDxeIpl (
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
||||
IN EFI_PEI_SERVICES **PeiServices
|
||||
);
|
||||
|
||||
|
||||
#endif
|
171
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
Normal file
171
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
Normal file
@ -0,0 +1,171 @@
|
||||
#/** @file
|
||||
# Component description file for DxeIpl module
|
||||
#
|
||||
# The responsibility of this module is to load the DXE Core from a Firmware Volume. This implementation i used to load a 32-bit DXE Core.
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = DxeIpl
|
||||
FILE_GUID = 86D70125-BAA3-4296-A62F-602BEBBB9081
|
||||
MODULE_TYPE = PEIM
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = PeimInitializeDxeIpl
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
DxeIpl.h
|
||||
DxeLoad.c
|
||||
CommonHeader.h
|
||||
|
||||
[Sources.Ia32]
|
||||
Ia32/VirtualMemory.h
|
||||
Ia32/VirtualMemory.c
|
||||
Ia32/DxeLoadFunc.c
|
||||
Ia32/ImageRead.c
|
||||
|
||||
[Sources.X64]
|
||||
X64/DxeLoadFunc.c
|
||||
Ia32/ImageRead.c
|
||||
|
||||
[Sources.IPF]
|
||||
Ipf/DxeLoadFunc.c
|
||||
Ipf/ImageRead.c
|
||||
|
||||
[Sources.EBC]
|
||||
X64/DxeLoadFunc.c
|
||||
Ia32/ImageRead.c
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
PeCoffLib
|
||||
PcdLib
|
||||
MemoryAllocationLib
|
||||
BaseMemoryLib
|
||||
PeiServicesTablePointerLib
|
||||
CustomDecompressLib
|
||||
TianoDecompressLib
|
||||
UefiDecompressLib
|
||||
EdkPeCoffLoaderLib
|
||||
CacheMaintenanceLib
|
||||
ReportStatusCodeLib
|
||||
PeiServicesLib
|
||||
HobLib
|
||||
BaseLib
|
||||
PeimEntryPoint
|
||||
DebugLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiCustomizedDecompressProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
||||
gEfiTianoDecompressProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
||||
gEfiDecompressProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# PPI C Name Section - list of PPI and PPI Notify C Names that this module
|
||||
# uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Ppis]
|
||||
gEfiPeiSecurityPpiGuid # PPI SOMETIMES_CONSUMED
|
||||
gEfiPeiSectionExtractionPpiGuid # PPI SOMETIMES_CONSUMED
|
||||
gEfiPeiS3ResumePpiGuid # PPI SOMETIMES_CONSUMED
|
||||
gEfiPeiRecoveryModulePpiGuid # PPI SOMETIMES_CONSUMED
|
||||
gEfiEndOfPeiSignalPpiGuid # PPI SOMETIMES_PRODUCED
|
||||
gEfiPeiFvFileLoaderPpiGuid # PPI SOMETIMES_PRODUCED
|
||||
gEfiDxeIplPpiGuid # PPI SOMETIMES_PRODUCED
|
||||
gEfiPeiPeCoffLoaderGuid
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Pcd FEATURE_FLAG - list of PCDs that this module is coded for.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[PcdsFeatureFlag.common]
|
||||
PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid
|
||||
PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid
|
||||
PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid
|
||||
PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid
|
||||
|
||||
[PcdsFeatureFlag.IA32]
|
||||
PcdDxeIplSwitchToLongMode|gEfiMdeModulePkgTokenSpaceGuid
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Dependency Expression Section - list of Dependency expressions that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Depex]
|
||||
gEfiPeiMemoryDiscoveredPpiGuid
|
||||
|
168
MdeModulePkg/Core/DxeIplPeim/DxeIpl.msa
Normal file
168
MdeModulePkg/Core/DxeIplPeim/DxeIpl.msa
Normal file
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<MsaHeader>
|
||||
<ModuleName>DxeIpl</ModuleName>
|
||||
<ModuleType>PEIM</ModuleType>
|
||||
<GuidValue>86D70125-BAA3-4296-A62F-602BEBBB9081</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for DxeIpl module</Abstract>
|
||||
<Description>The responsibility of this module is to load the DXE Core from a Firmware Volume. This implementation i used to load a 32-bit DXE Core.</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>DxeIpl</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PeimEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>HobLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PeiServicesLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>ReportStatusCodeLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>CacheMaintenanceLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>EdkPeCoffLoaderLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDecompressLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>TianoDecompressLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>CustomDecompressLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PeiServicesTablePointerLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PcdLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PeCoffLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>DxeLoad.c</Filename>
|
||||
<Filename>DxeIpl.h</Filename>
|
||||
<Filename>DxeIpl.dxs</Filename>
|
||||
<Filename SupArchList="IA32 X64 EBC">Ia32/ImageRead.c</Filename>
|
||||
<Filename SupArchList="IA32">Ia32/DxeLoadFunc.c</Filename>
|
||||
<Filename SupArchList="IA32">Ia32/VirtualMemory.c</Filename>
|
||||
<Filename SupArchList="IA32">Ia32/VirtualMemory.h</Filename>
|
||||
<Filename SupArchList="X64 EBC">X64/DxeLoadFunc.c</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/ImageRead.c</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/DxeLoadFunc.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="SOMETIMES_PRODUCED">
|
||||
<ProtocolCName>gEfiDecompressProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_PRODUCED">
|
||||
<ProtocolCName>gEfiTianoDecompressProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_PRODUCED">
|
||||
<ProtocolCName>gEfiCustomizedDecompressProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<PPIs>
|
||||
<Ppi Usage="SOMETIMES_PRODUCED">
|
||||
<PpiCName>gEfiDxeIplPpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_PRODUCED">
|
||||
<PpiCName>gEfiPeiFvFileLoaderPpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_PRODUCED">
|
||||
<PpiCName>gEfiEndOfPeiSignalPpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_CONSUMED">
|
||||
<PpiCName>gEfiPeiRecoveryModulePpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_CONSUMED">
|
||||
<PpiCName>gEfiPeiS3ResumePpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_CONSUMED">
|
||||
<PpiCName>gEfiPeiSectionExtractionPpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
<Ppi Usage="SOMETIMES_CONSUMED">
|
||||
<PpiCName>gEfiPeiSecurityPpiGuid</PpiCName>
|
||||
</Ppi>
|
||||
</PPIs>
|
||||
<Guids>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiPeiPeCoffLoaderGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<ModuleEntryPoint>PeimInitializeDxeIpl</ModuleEntryPoint>
|
||||
</Extern>
|
||||
</Externs>
|
||||
<PcdCoded>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED" SupArchList="IA32">
|
||||
<C_Name>PcdDxeIplSwitchToLongMode</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>TRUE</DefaultValue>
|
||||
<HelpText>If this feature is enabled, then the DXE IPL will load a 64-bit DxeCore.</HelpText>
|
||||
</PcdEntry>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
|
||||
<C_Name>PcdDxeIplBuildShareCodeHobs</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>FALSE</DefaultValue>
|
||||
<HelpText>If this feature is enabled, DXE IPL will build a series of HOBs to share code with DXE Core.</HelpText>
|
||||
</PcdEntry>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
|
||||
<C_Name>PcdDxeIplSupportEfiDecompress</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>TRUE</DefaultValue>
|
||||
<HelpText>If this feature is enabled, then the DXE IPL must support decompressing files compressed with the EFI Compression algorithm</HelpText>
|
||||
</PcdEntry>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
|
||||
<C_Name>PcdDxeIplSupportTianoDecompress</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>TRUE</DefaultValue>
|
||||
<HelpText>If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Tiano Compression algorithm</HelpText>
|
||||
</PcdEntry>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
|
||||
<C_Name>PcdDxeIplSupportCustomDecompress</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>TRUE</DefaultValue>
|
||||
<HelpText>If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Custom Compression algorithm</HelpText>
|
||||
</PcdEntry>
|
||||
</PcdCoded>
|
||||
</ModuleSurfaceArea>
|
980
MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
Normal file
980
MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
Normal file
@ -0,0 +1,980 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DxeLoad.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Last PEIM.
|
||||
Responsibility of this module is to load the DXE Core from a Firmware Volume.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
|
||||
// porting note remove later
|
||||
#include "Common/DecompressLibraryHob.h"
|
||||
#include "FrameworkPei.h"
|
||||
// end of remove later
|
||||
|
||||
BOOLEAN gInMemory = FALSE;
|
||||
|
||||
//
|
||||
// Module Globals used in the DXE to PEI handoff
|
||||
// These must be module globals, so the stack can be switched
|
||||
//
|
||||
static EFI_DXE_IPL_PPI mDxeIplPpi = {
|
||||
DxeLoadCore
|
||||
};
|
||||
|
||||
static EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi = {
|
||||
DxeIplLoadFile
|
||||
};
|
||||
|
||||
static EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
|
||||
{
|
||||
EFI_PEI_PPI_DESCRIPTOR_PPI,
|
||||
&gEfiPeiFvFileLoaderPpiGuid,
|
||||
&mLoadFilePpi
|
||||
},
|
||||
{
|
||||
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||
&gEfiDxeIplPpiGuid,
|
||||
&mDxeIplPpi
|
||||
}
|
||||
};
|
||||
|
||||
static EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {
|
||||
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||
&gEfiEndOfPeiSignalPpiGuid,
|
||||
NULL
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gEfiDecompress = {
|
||||
UefiDecompressGetInfo,
|
||||
UefiDecompress
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gCustomDecompress = {
|
||||
CustomDecompressGetInfo,
|
||||
CustomDecompress
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeimInitializeDxeIpl (
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
||||
IN EFI_PEI_SERVICES **PeiServices
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Initializes the Dxe Ipl PPI
|
||||
|
||||
Arguments:
|
||||
|
||||
FfsHeader - Pointer to FFS file header
|
||||
PeiServices - General purpose services available to every PEIM.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
|
||||
EFI_BOOT_MODE BootMode;
|
||||
|
||||
Status = PeiServicesGetBootMode (&BootMode);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (!gInMemory && (BootMode != BOOT_ON_S3_RESUME)) {
|
||||
//
|
||||
// The DxeIpl has not yet been shadowed
|
||||
//
|
||||
PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
|
||||
|
||||
//
|
||||
// Shadow DxeIpl and then re-run its entry point
|
||||
//
|
||||
Status = ShadowDxeIpl (FfsHeader, PeiEfiPeiPeCoffLoader);
|
||||
} else {
|
||||
//
|
||||
// Install FvFileLoader and DxeIpl PPIs.
|
||||
//
|
||||
Status = PeiServicesInstallPpi (mPpiList);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeLoadCore (
|
||||
IN EFI_DXE_IPL_PPI *This,
|
||||
IN EFI_PEI_SERVICES **PeiServices,
|
||||
IN EFI_PEI_HOB_POINTERS HobList
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Main entry point to last PEIM
|
||||
|
||||
Arguments:
|
||||
This - Entry point for DXE IPL PPI
|
||||
PeiServices - General purpose services available to every PEIM.
|
||||
HobList - Address to the Pei HOB list
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - DEX core was successfully loaded.
|
||||
EFI_OUT_OF_RESOURCES - There are not enough resources to load DXE core.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID DxeCoreFileName;
|
||||
EFI_GUID FirmwareFileName;
|
||||
VOID *Pe32Data;
|
||||
VOID *FvImageData;
|
||||
EFI_PHYSICAL_ADDRESS DxeCoreAddress;
|
||||
UINT64 DxeCoreSize;
|
||||
EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint;
|
||||
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
|
||||
EFI_BOOT_MODE BootMode;
|
||||
EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;
|
||||
EFI_PEI_S3_RESUME_PPI *S3Resume;
|
||||
|
||||
// PERF_START (PeiServices, L"DxeIpl", NULL, 0);
|
||||
|
||||
//
|
||||
// if in S3 Resume, restore configure
|
||||
//
|
||||
Status = PeiServicesGetBootMode (&BootMode);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
if (BootMode == BOOT_ON_S3_RESUME) {
|
||||
Status = PeiServicesLocatePpi (
|
||||
&gEfiPeiS3ResumePpiGuid,
|
||||
0,
|
||||
NULL,
|
||||
(VOID **)&S3Resume
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = S3Resume->S3RestoreConfig (PeiServices);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
} else if (BootMode == BOOT_IN_RECOVERY_MODE) {
|
||||
|
||||
Status = PeiServicesLocatePpi (
|
||||
&gEfiPeiRecoveryModulePpiGuid,
|
||||
0,
|
||||
NULL,
|
||||
(VOID **)&PeiRecovery
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Load Recovery Capsule Failed.(Status = %r)\n", Status));
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
//
|
||||
// Now should have a HOB with the DXE core w/ the old HOB destroyed
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// Install the PEI Protocols that are shared between PEI and DXE
|
||||
//
|
||||
PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
|
||||
ASSERT (PeiEfiPeiPeCoffLoader != NULL);
|
||||
|
||||
|
||||
//
|
||||
// Find the EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE type compressed Firmware Volume file
|
||||
// The file found will be processed by PeiProcessFile: It will first be decompressed to
|
||||
// a normal FV, then a corresponding FV type hob will be built.
|
||||
//
|
||||
Status = PeiFindFile (
|
||||
EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE,
|
||||
EFI_SECTION_FIRMWARE_VOLUME_IMAGE,
|
||||
&FirmwareFileName,
|
||||
&FvImageData
|
||||
);
|
||||
|
||||
//
|
||||
// Find the DXE Core in a Firmware Volume
|
||||
//
|
||||
Status = PeiFindFile (
|
||||
EFI_FV_FILETYPE_DXE_CORE,
|
||||
EFI_SECTION_PE32,
|
||||
&DxeCoreFileName,
|
||||
&Pe32Data
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Load the DXE Core from a Firmware Volume
|
||||
//
|
||||
Status = PeiLoadFile (
|
||||
PeiEfiPeiPeCoffLoader,
|
||||
Pe32Data,
|
||||
&DxeCoreAddress,
|
||||
&DxeCoreSize,
|
||||
&DxeCoreEntryPoint
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Add HOB for the DXE Core
|
||||
//
|
||||
BuildModuleHob (
|
||||
&DxeCoreFileName,
|
||||
DxeCoreAddress,
|
||||
DxeCoreSize,
|
||||
DxeCoreEntryPoint
|
||||
);
|
||||
|
||||
//
|
||||
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
|
||||
//
|
||||
REPORT_STATUS_CODE (
|
||||
EFI_PROGRESS_CODE,
|
||||
EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT
|
||||
);
|
||||
|
||||
if (FeaturePcdGet (PcdDxeIplBuildShareCodeHobs)) {
|
||||
if (FeaturePcdGet (PcdDxeIplSupportEfiDecompress)) {
|
||||
//
|
||||
// Add HOB for the EFI Decompress Protocol
|
||||
//
|
||||
BuildGuidDataHob (
|
||||
&gEfiDecompressProtocolGuid,
|
||||
(VOID *)&gEfiDecompress,
|
||||
sizeof (gEfiDecompress)
|
||||
);
|
||||
}
|
||||
if (FeaturePcdGet (PcdDxeIplSupportCustomDecompress)) {
|
||||
//
|
||||
// Add HOB for the user customized Decompress Protocol
|
||||
//
|
||||
BuildGuidDataHob (
|
||||
&gEfiCustomizedDecompressProtocolGuid,
|
||||
(VOID *)&gCustomDecompress,
|
||||
sizeof (gCustomDecompress)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Add HOB for the PE/COFF Loader Protocol
|
||||
//
|
||||
BuildGuidDataHob (
|
||||
&gEfiPeiPeCoffLoaderGuid,
|
||||
(VOID *)&PeiEfiPeiPeCoffLoader,
|
||||
sizeof (VOID *)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Transfer control to the DXE Core
|
||||
// The handoff state is simply a pointer to the HOB list
|
||||
//
|
||||
|
||||
DEBUG ((EFI_D_INFO, "DXE Core Entry Point 0x%08x\n", (UINTN) DxeCoreEntryPoint));
|
||||
HandOffToDxeCore (DxeCoreEntryPoint, HobList, &mPpiSignal);
|
||||
//
|
||||
// If we get here, then the DXE Core returned. This is an error
|
||||
// Dxe Core should not return.
|
||||
//
|
||||
ASSERT (FALSE);
|
||||
CpuDeadLoop ();
|
||||
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
PeiFindFile (
|
||||
IN UINT8 Type,
|
||||
IN UINT16 SectionType,
|
||||
OUT EFI_GUID *FileName,
|
||||
OUT VOID **Pe32Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Finds a PE/COFF of a specific Type and SectionType in the Firmware Volumes
|
||||
described in the HOB list. Able to search in a compression set in a FFS file.
|
||||
But only one level of compression is supported, that is, not able to search
|
||||
in a compression set that is within another compression set.
|
||||
|
||||
Arguments:
|
||||
|
||||
Type - The Type of file to retrieve
|
||||
|
||||
SectionType - The type of section to retrieve from a file
|
||||
|
||||
FileName - The name of the file found in the Firmware Volume
|
||||
|
||||
Pe32Data - Pointer to the beginning of the PE/COFF file found in the Firmware Volume
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The file was found, and the name is returned in FileName, and a pointer to
|
||||
the PE/COFF image is returned in Pe32Data
|
||||
|
||||
EFI_NOT_FOUND - The file was not found in the Firmware Volumes present in the HOB List
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
|
||||
EFI_FFS_FILE_HEADER *FfsFileHeader;
|
||||
EFI_STATUS Status;
|
||||
EFI_PEI_HOB_POINTERS Hob;
|
||||
|
||||
|
||||
FwVolHeader = NULL;
|
||||
FfsFileHeader = NULL;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
//
|
||||
// For each Firmware Volume, look for a specified type
|
||||
// of file and break out until no one is found
|
||||
//
|
||||
Hob.Raw = GetHobList ();
|
||||
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, Hob.Raw)) != NULL) {
|
||||
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (Hob.FirmwareVolume->BaseAddress);
|
||||
//
|
||||
// Make sure the FV HOB does not get corrupted.
|
||||
//
|
||||
ASSERT (FwVolHeader->Signature == EFI_FVH_SIGNATURE);
|
||||
|
||||
Status = PeiServicesFfsFindNextFile (
|
||||
Type,
|
||||
FwVolHeader,
|
||||
&FfsFileHeader
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = PeiProcessFile (
|
||||
SectionType,
|
||||
FfsFileHeader,
|
||||
Pe32Data,
|
||||
&Hob
|
||||
);
|
||||
CopyMem (FileName, &FfsFileHeader->Name, sizeof (EFI_GUID));
|
||||
//
|
||||
// Find all Fv type ffs to get all FvImage and add them into FvHob
|
||||
//
|
||||
if (!EFI_ERROR (Status) && (Type != EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
Hob.Raw = GET_NEXT_HOB (Hob);
|
||||
}
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
PeiLoadFile (
|
||||
IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,
|
||||
IN VOID *Pe32Data,
|
||||
OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
|
||||
OUT UINT64 *ImageSize,
|
||||
OUT EFI_PHYSICAL_ADDRESS *EntryPoint
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Loads and relocates a PE/COFF image into memory.
|
||||
|
||||
Arguments:
|
||||
|
||||
PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol
|
||||
|
||||
Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
|
||||
|
||||
ImageAddress - The base address of the relocated PE/COFF image
|
||||
|
||||
ImageSize - The size of the relocated PE/COFF image
|
||||
|
||||
EntryPoint - The entry point of the relocated PE/COFF image
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The file was loaded and relocated
|
||||
|
||||
EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
|
||||
ZeroMem (&ImageContext, sizeof (ImageContext));
|
||||
ImageContext.Handle = Pe32Data;
|
||||
Status = GetImageReadFunction (&ImageContext);
|
||||
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = PeiEfiPeiPeCoffLoader->GetImageInfo (PeiEfiPeiPeCoffLoader, &ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Allocate Memory for the image
|
||||
//
|
||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
||||
ASSERT (ImageContext.ImageAddress != 0);
|
||||
|
||||
//
|
||||
// Load the image to our new buffer
|
||||
//
|
||||
Status = PeiEfiPeiPeCoffLoader->LoadImage (PeiEfiPeiPeCoffLoader, &ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Relocate the image in our new buffer
|
||||
//
|
||||
Status = PeiEfiPeiPeCoffLoader->RelocateImage (PeiEfiPeiPeCoffLoader, &ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Flush the instruction cache so the image data is written before we execute it
|
||||
//
|
||||
InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);
|
||||
|
||||
*ImageAddress = ImageContext.ImageAddress;
|
||||
*ImageSize = ImageContext.ImageSize;
|
||||
*EntryPoint = ImageContext.EntryPoint;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ShadowDxeIpl (
|
||||
IN EFI_FFS_FILE_HEADER *DxeIplFileHeader,
|
||||
IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Shadow the DXE IPL to a different memory location. This occurs after permanent
|
||||
memory has been discovered.
|
||||
|
||||
Arguments:
|
||||
|
||||
DxeIplFileHeader - Pointer to the FFS file header of the DXE IPL driver
|
||||
|
||||
PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - DXE IPL was successfully shadowed to a different memory location.
|
||||
|
||||
EFI_ ERROR - The shadow was unsuccessful.
|
||||
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN SectionLength;
|
||||
UINTN OccupiedSectionLength;
|
||||
EFI_PHYSICAL_ADDRESS DxeIplAddress;
|
||||
UINT64 DxeIplSize;
|
||||
EFI_PHYSICAL_ADDRESS DxeIplEntryPoint;
|
||||
EFI_STATUS Status;
|
||||
EFI_COMMON_SECTION_HEADER *Section;
|
||||
|
||||
Section = (EFI_COMMON_SECTION_HEADER *) (DxeIplFileHeader + 1);
|
||||
|
||||
while ((Section->Type != EFI_SECTION_PE32) && (Section->Type != EFI_SECTION_TE)) {
|
||||
SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
|
||||
OccupiedSectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
|
||||
Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
|
||||
}
|
||||
//
|
||||
// Relocate DxeIpl into memory by using loadfile service
|
||||
//
|
||||
Status = PeiLoadFile (
|
||||
PeiEfiPeiPeCoffLoader,
|
||||
(VOID *) (Section + 1),
|
||||
&DxeIplAddress,
|
||||
&DxeIplSize,
|
||||
&DxeIplEntryPoint
|
||||
);
|
||||
|
||||
if (Status == EFI_SUCCESS) {
|
||||
//
|
||||
// Set gInMemory global variable to TRUE to indicate the dxeipl is shadowed.
|
||||
//
|
||||
*(BOOLEAN *) ((UINTN) &gInMemory + (UINTN) DxeIplEntryPoint - (UINTN) _ModuleEntryPoint) = TRUE;
|
||||
Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) ((EFI_PEI_FILE_HANDLE *) DxeIplFileHeader, GetPeiServicesTablePointer());
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DxeIplLoadFile (
|
||||
IN EFI_PEI_FV_FILE_LOADER_PPI *This,
|
||||
IN EFI_FFS_FILE_HEADER *FfsHeader,
|
||||
OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
|
||||
OUT UINT64 *ImageSize,
|
||||
OUT EFI_PHYSICAL_ADDRESS *EntryPoint
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Given a pointer to an FFS file containing a PE32 image, get the
|
||||
information on the PE32 image, and then "load" it so that it
|
||||
can be executed.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - pointer to our file loader protocol
|
||||
|
||||
FfsHeader - pointer to the FFS file header of the FFS file that
|
||||
contains the PE32 image we want to load
|
||||
|
||||
ImageAddress - returned address where the PE32 image is loaded
|
||||
|
||||
ImageSize - returned size of the loaded PE32 image
|
||||
|
||||
EntryPoint - entry point to the loaded PE32 image
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The FFS file was successfully loaded.
|
||||
|
||||
EFI_ERROR - Unable to load the FFS file.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
|
||||
EFI_STATUS Status;
|
||||
VOID *Pe32Data;
|
||||
|
||||
Pe32Data = NULL;
|
||||
PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
|
||||
|
||||
//
|
||||
// Preprocess the FFS file to get a pointer to the PE32 information
|
||||
// in the enclosed PE32 image.
|
||||
//
|
||||
Status = PeiProcessFile (
|
||||
EFI_SECTION_PE32,
|
||||
FfsHeader,
|
||||
&Pe32Data,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Load the PE image from the FFS file
|
||||
//
|
||||
Status = PeiLoadFile (
|
||||
PeiEfiPeiPeCoffLoader,
|
||||
Pe32Data,
|
||||
ImageAddress,
|
||||
ImageSize,
|
||||
EntryPoint
|
||||
);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
PeiProcessFile (
|
||||
IN UINT16 SectionType,
|
||||
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
||||
OUT VOID **Pe32Data,
|
||||
IN EFI_PEI_HOB_POINTERS *OrigHob
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
SectionType - The type of section in the FFS file to process.
|
||||
|
||||
FfsFileHeader - Pointer to the FFS file to process, looking for the
|
||||
specified SectionType
|
||||
|
||||
Pe32Data - returned pointer to the start of the PE32 image found
|
||||
in the FFS file.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - found the PE32 section in the FFS file
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VOID *SectionData;
|
||||
DECOMPRESS_LIBRARY *DecompressLibrary;
|
||||
UINT8 *DstBuffer;
|
||||
UINT8 *ScratchBuffer;
|
||||
UINT32 DstBufferSize;
|
||||
UINT32 ScratchBufferSize;
|
||||
EFI_COMMON_SECTION_HEADER *CmpSection;
|
||||
UINTN CmpSectionLength;
|
||||
UINTN OccupiedCmpSectionLength;
|
||||
VOID *CmpFileData;
|
||||
UINTN CmpFileSize;
|
||||
EFI_COMMON_SECTION_HEADER *Section;
|
||||
UINTN SectionLength;
|
||||
UINTN OccupiedSectionLength;
|
||||
UINT64 FileSize;
|
||||
UINT32 AuthenticationStatus;
|
||||
EFI_PEI_SECTION_EXTRACTION_PPI *SectionExtract;
|
||||
UINT32 BufferSize;
|
||||
UINT8 *Buffer;
|
||||
EFI_PEI_SECURITY_PPI *Security;
|
||||
BOOLEAN StartCrisisRecovery;
|
||||
EFI_GUID TempGuid;
|
||||
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
||||
EFI_COMPRESSION_SECTION *CompressionSection;
|
||||
|
||||
//
|
||||
// Initialize local variables.
|
||||
//
|
||||
DecompressLibrary = NULL;
|
||||
DstBuffer = NULL;
|
||||
DstBufferSize = 0;
|
||||
|
||||
Status = PeiServicesFfsFindSectionData (
|
||||
EFI_SECTION_COMPRESSION,
|
||||
FfsFileHeader,
|
||||
&SectionData
|
||||
);
|
||||
|
||||
//
|
||||
// First process the compression section
|
||||
//
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Yes, there is a compression section, so extract the contents
|
||||
// Decompress the image here
|
||||
//
|
||||
Section = (EFI_COMMON_SECTION_HEADER *) (UINTN) (VOID *) ((UINT8 *) (FfsFileHeader) + (UINTN) sizeof (EFI_FFS_FILE_HEADER));
|
||||
|
||||
do {
|
||||
SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
|
||||
OccupiedSectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
|
||||
|
||||
//
|
||||
// Was the DXE Core file encapsulated in a GUID'd section?
|
||||
//
|
||||
if (Section->Type == EFI_SECTION_GUID_DEFINED) {
|
||||
|
||||
//
|
||||
// This following code constitutes the addition of the security model
|
||||
// to the DXE IPL.
|
||||
//
|
||||
//
|
||||
// Set a default authenticatino state
|
||||
//
|
||||
AuthenticationStatus = 0;
|
||||
|
||||
Status = PeiServicesLocatePpi (
|
||||
&gEfiPeiSectionExtractionPpiGuid,
|
||||
0,
|
||||
NULL,
|
||||
(VOID **)&SectionExtract
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Verify Authentication State
|
||||
//
|
||||
CopyMem (&TempGuid, Section + 1, sizeof (EFI_GUID));
|
||||
|
||||
Status = SectionExtract->PeiGetSection (
|
||||
GetPeiServicesTablePointer(),
|
||||
SectionExtract,
|
||||
(EFI_SECTION_TYPE *) &SectionType,
|
||||
&TempGuid,
|
||||
0,
|
||||
(VOID **) &Buffer,
|
||||
&BufferSize,
|
||||
&AuthenticationStatus
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// If not ask the Security PPI, if exists, for disposition
|
||||
//
|
||||
//
|
||||
Status = PeiServicesLocatePpi (
|
||||
&gEfiPeiSecurityPpiGuid,
|
||||
0,
|
||||
NULL,
|
||||
(VOID **)&Security
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = Security->AuthenticationState (
|
||||
GetPeiServicesTablePointer(),
|
||||
(struct _EFI_PEI_SECURITY_PPI *) Security,
|
||||
AuthenticationStatus,
|
||||
FfsFileHeader,
|
||||
&StartCrisisRecovery
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// If there is a security violation, report to caller and have
|
||||
// the upper-level logic possible engender a crisis recovery
|
||||
//
|
||||
if (StartCrisisRecovery) {
|
||||
return EFI_SECURITY_VIOLATION;
|
||||
}
|
||||
}
|
||||
|
||||
if (Section->Type == EFI_SECTION_PE32) {
|
||||
//
|
||||
// This is what we want
|
||||
//
|
||||
*Pe32Data = (VOID *) (Section + 1);
|
||||
return EFI_SUCCESS;
|
||||
} else if (Section->Type == EFI_SECTION_COMPRESSION) {
|
||||
//
|
||||
// This is a compression set, expand it
|
||||
//
|
||||
CompressionSection = (EFI_COMPRESSION_SECTION *) Section;
|
||||
|
||||
switch (CompressionSection->CompressionType) {
|
||||
case EFI_STANDARD_COMPRESSION:
|
||||
//
|
||||
// Load EFI standard compression.
|
||||
//
|
||||
if (FeaturePcdGet (PcdDxeIplSupportTianoDecompress)) {
|
||||
DecompressLibrary = &gEfiDecompress;
|
||||
} else {
|
||||
ASSERT (FALSE);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
break;
|
||||
|
||||
// porting note the original branch for customized compress is removed, it should be change to use GUID compress
|
||||
|
||||
case EFI_NOT_COMPRESSED:
|
||||
//
|
||||
// Allocate destination buffer
|
||||
//
|
||||
DstBufferSize = CompressionSection->UncompressedLength;
|
||||
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
|
||||
if (DstBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// stream is not actually compressed, just encapsulated. So just copy it.
|
||||
//
|
||||
CopyMem (DstBuffer, CompressionSection + 1, DstBufferSize);
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
// Don't support other unknown compression type.
|
||||
//
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (CompressionSection->CompressionType != EFI_NOT_COMPRESSED) {
|
||||
//
|
||||
// For compressed data, decompress them to dstbuffer.
|
||||
//
|
||||
Status = DecompressLibrary->GetInfo (
|
||||
(UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
||||
(UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION),
|
||||
&DstBufferSize,
|
||||
&ScratchBufferSize
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// GetInfo failed
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Decompress GetInfo Failed - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate scratch buffer
|
||||
//
|
||||
ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));
|
||||
if (ScratchBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate destination buffer
|
||||
//
|
||||
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
|
||||
if (DstBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Call decompress function
|
||||
//
|
||||
Status = DecompressLibrary->Decompress (
|
||||
(CHAR8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
||||
DstBuffer,
|
||||
ScratchBuffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Decompress failed
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Decompress Failed - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Decompress successfully.
|
||||
// Loop the decompressed data searching for expected section.
|
||||
//
|
||||
CmpSection = (EFI_COMMON_SECTION_HEADER *) DstBuffer;
|
||||
CmpFileData = (VOID *) DstBuffer;
|
||||
CmpFileSize = DstBufferSize;
|
||||
do {
|
||||
CmpSectionLength = *(UINT32 *) (CmpSection->Size) & 0x00ffffff;
|
||||
if (CmpSection->Type == SectionType) {
|
||||
//
|
||||
// This is what we want
|
||||
//
|
||||
if (SectionType == EFI_SECTION_PE32) {
|
||||
*Pe32Data = (VOID *) (CmpSection + 1);
|
||||
return EFI_SUCCESS;
|
||||
} else if (SectionType == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) {
|
||||
//
|
||||
// Firmware Volume Image in this Section
|
||||
// Skip the section header to get FvHeader
|
||||
//
|
||||
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (CmpSection + 1);
|
||||
|
||||
if (FvHeader->Signature == EFI_FVH_SIGNATURE) {
|
||||
//
|
||||
// Because FvLength in FvHeader is UINT64 type,
|
||||
// so FvHeader must meed at least 8 bytes alignment.
|
||||
// If current FvImage base address doesn't meet its alignment,
|
||||
// we need to reload this FvImage to another correct memory address.
|
||||
//
|
||||
if (((UINTN) FvHeader % sizeof (UINT64)) != 0) {
|
||||
DstBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES ((UINTN) CmpSectionLength - sizeof (EFI_COMMON_SECTION_HEADER)), sizeof (UINT64));
|
||||
if (DstBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyMem (DstBuffer, FvHeader, (UINTN) CmpSectionLength - sizeof (EFI_COMMON_SECTION_HEADER));
|
||||
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) DstBuffer;
|
||||
}
|
||||
|
||||
//
|
||||
// Build new FvHob for new decompressed Fv image.
|
||||
//
|
||||
BuildFvHob ((EFI_PHYSICAL_ADDRESS) (UINTN) FvHeader, FvHeader->FvLength);
|
||||
|
||||
//
|
||||
// Set the original FvHob to unused.
|
||||
//
|
||||
if (OrigHob != NULL) {
|
||||
OrigHob->Header->HobType = EFI_HOB_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
//
|
||||
// return found FvImage data.
|
||||
//
|
||||
*Pe32Data = (VOID *) FvHeader;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
OccupiedCmpSectionLength = GET_OCCUPIED_SIZE (CmpSectionLength, 4);
|
||||
CmpSection = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) CmpSection + OccupiedCmpSectionLength);
|
||||
} while (CmpSection->Type != 0 && (UINTN) ((UINT8 *) CmpSection - (UINT8 *) CmpFileData) < CmpFileSize);
|
||||
}
|
||||
//
|
||||
// End of the decompression activity
|
||||
//
|
||||
|
||||
Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
|
||||
FileSize = FfsFileHeader->Size[0] & 0xFF;
|
||||
FileSize += (FfsFileHeader->Size[1] << 8) & 0xFF00;
|
||||
FileSize += (FfsFileHeader->Size[2] << 16) & 0xFF0000;
|
||||
FileSize &= 0x00FFFFFF;
|
||||
} while (Section->Type != 0 && (UINTN) ((UINT8 *) Section - (UINT8 *) FfsFileHeader) < FileSize);
|
||||
|
||||
//
|
||||
// search all sections (compression and non compression) in this FFS, don't
|
||||
// find expected section.
|
||||
//
|
||||
return EFI_NOT_FOUND;
|
||||
} else {
|
||||
//
|
||||
// For those FFS that doesn't contain compression section, directly search
|
||||
// PE or TE section in this FFS.
|
||||
//
|
||||
|
||||
Status = PeiServicesFfsFindSectionData (
|
||||
EFI_SECTION_PE32,
|
||||
FfsFileHeader,
|
||||
&SectionData
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
Status = PeiServicesFfsFindSectionData (
|
||||
EFI_SECTION_TE,
|
||||
FfsFileHeader,
|
||||
&SectionData
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*Pe32Data = SectionData;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
136
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
Normal file
136
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
Normal file
@ -0,0 +1,136 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DxeLoadFunc.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Ia32-specifc functionality for DxeLoad.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
#include "VirtualMemory.h"
|
||||
|
||||
//
|
||||
// Global Descriptor Table (GDT)
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT gGdtEntries [] = {
|
||||
/* selector { Global Segment Descriptor } */
|
||||
/* 0x00 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //null descriptor
|
||||
/* 0x08 */ {{0xffff, 0, 0, 0x2, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //linear data segment descriptor
|
||||
/* 0x10 */ {{0xffff, 0, 0, 0xf, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //linear code segment descriptor
|
||||
/* 0x18 */ {{0xffff, 0, 0, 0x3, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system data segment descriptor
|
||||
/* 0x20 */ {{0xffff, 0, 0, 0xa, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system code segment descriptor
|
||||
/* 0x28 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //spare segment descriptor
|
||||
/* 0x30 */ {{0xffff, 0, 0, 0x2, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system data segment descriptor
|
||||
/* 0x38 */ {{0xffff, 0, 0, 0xa, 1, 0, 1, 0xf, 0, 1, 0, 1, 0}}, //system code segment descriptor
|
||||
/* 0x40 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //spare segment descriptor
|
||||
};
|
||||
|
||||
//
|
||||
// IA32 Gdt register
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED CONST IA32_DESCRIPTOR gGdt = {
|
||||
sizeof (gGdtEntries) - 1,
|
||||
(UINTN) gGdtEntries
|
||||
};
|
||||
|
||||
VOID
|
||||
HandOffToDxeCore (
|
||||
IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
|
||||
IN EFI_PEI_HOB_POINTERS HobList,
|
||||
IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS BaseOfStack;
|
||||
EFI_PHYSICAL_ADDRESS TopOfStack;
|
||||
UINTN PageTables;
|
||||
|
||||
Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (STACK_SIZE), &BaseOfStack);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (FeaturePcdGet(PcdDxeIplSwitchToLongMode)) {
|
||||
//
|
||||
// Compute the top of the stack we were allocated, which is used to load X64 dxe core.
|
||||
// Pre-allocate a 32 bytes which confroms to x64 calling convention.
|
||||
//
|
||||
// The first four parameters to a function are passed in rcx, rdx, r8 and r9.
|
||||
// Any further parameters are pushed on the stack. Furthermore, space (4 * 8bytes) for the
|
||||
// register parameters is reserved on the stack, in case the called function
|
||||
// wants to spill them; this is important if the function is variadic.
|
||||
//
|
||||
TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;
|
||||
|
||||
//
|
||||
// X64 Calling Conventions requires that the stack must be aligned to 16 bytes
|
||||
//
|
||||
TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, 16);
|
||||
|
||||
//
|
||||
// Load the GDT of Go64. Since the GDT of 32-bit Tiano locates in the BS_DATA
|
||||
// memory, it may be corrupted when copying FV to high-end memory
|
||||
//
|
||||
AsmWriteGdtr (&gGdt);
|
||||
//
|
||||
// Create page table and save PageMapLevel4 to CR3
|
||||
//
|
||||
PageTables = CreateIdentityMappingPageTables ();
|
||||
|
||||
//
|
||||
// End of PEI phase singal
|
||||
//
|
||||
Status = PeiServicesInstallPpi (EndOfPeiSignal);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
AsmWriteCr3 (PageTables);
|
||||
//
|
||||
// Go to Long Mode. Interrupts will not get turned on until the CPU AP is loaded.
|
||||
// Call x64 drivers passing in single argument, a pointer to the HOBs.
|
||||
//
|
||||
AsmEnablePaging64 (
|
||||
SYS_CODE64_SEL,
|
||||
DxeCoreEntryPoint,
|
||||
(EFI_PHYSICAL_ADDRESS)(UINTN)(HobList.Raw),
|
||||
0,
|
||||
TopOfStack
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// Compute the top of the stack we were allocated. Pre-allocate a UINTN
|
||||
// for safety.
|
||||
//
|
||||
TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT;
|
||||
TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
|
||||
|
||||
//
|
||||
// End of PEI phase singal
|
||||
//
|
||||
Status = PeiServicesInstallPpi (EndOfPeiSignal);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
SwitchStack (
|
||||
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
|
||||
HobList.Raw,
|
||||
NULL,
|
||||
(VOID *) (UINTN) TopOfStack
|
||||
);
|
||||
}
|
||||
}
|
||||
|
117
MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
Normal file
117
MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
Normal file
@ -0,0 +1,117 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ImageRead.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeiImageRead (
|
||||
IN VOID *FileHandle,
|
||||
IN UINTN FileOffset,
|
||||
IN OUT UINTN *ReadSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
|
||||
|
||||
Arguments:
|
||||
|
||||
FileHandle - The handle to the PE/COFF file
|
||||
|
||||
FileOffset - The offset, in bytes, into the file to read
|
||||
|
||||
ReadSize - The number of bytes to read from the file starting at FileOffset
|
||||
|
||||
Buffer - A pointer to the buffer to read the data into.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 *Destination32;
|
||||
UINT8 *Source32;
|
||||
UINTN Length;
|
||||
|
||||
|
||||
Destination32 = Buffer;
|
||||
Source32 = (UINT8 *) ((UINTN) FileHandle + FileOffset);
|
||||
|
||||
//
|
||||
// This function assumes 32-bit alignment to increase performance
|
||||
//
|
||||
// ASSERT (ALIGN_POINTER (Destination32, sizeof (UINT32)) == Destination32);
|
||||
// ASSERT (ALIGN_POINTER (Source32, sizeof (UINT32)) == Source32);
|
||||
|
||||
Length = *ReadSize;
|
||||
while (Length--) {
|
||||
*(Destination32++) = *(Source32++);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
GetImageReadFunction (
|
||||
IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Support routine to return the PE32 Image Reader.
|
||||
If the PeiImageRead() function is less than a page
|
||||
in legnth. If the function is more than a page the DXE IPL will crash!!!!
|
||||
|
||||
Arguments:
|
||||
ImageContext - The context of the image being loaded
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - If Image function location is found
|
||||
|
||||
--*/
|
||||
{
|
||||
VOID *MemoryBuffer;
|
||||
|
||||
if (gInMemory) {
|
||||
ImageContext->ImageRead = PeiImageRead;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// BugBug; This code assumes PeiImageRead() is less than a page in size!
|
||||
// Allocate a page so we can shaddow the read function from FLASH into
|
||||
// memory to increase performance.
|
||||
//
|
||||
|
||||
MemoryBuffer = AllocateCopyPool (0x400, (VOID *)(UINTN) PeiImageRead);
|
||||
ASSERT (MemoryBuffer != NULL);
|
||||
|
||||
ImageContext->ImageRead = (PE_COFF_LOADER_READ_FILE) (UINTN) MemoryBuffer;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
173
MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c
Normal file
173
MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c
Normal file
@ -0,0 +1,173 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
VirtualMemory.c
|
||||
|
||||
Abstract:
|
||||
|
||||
x64 Virtual Memory Management Services in the form of an IA-32 driver.
|
||||
Used to establish a 1:1 Virtual to Physical Mapping that is required to
|
||||
enter Long Mode (x64 64-bit mode).
|
||||
|
||||
While we make a 1:1 mapping (identity mapping) for all physical pages
|
||||
we still need to use the MTRR's to ensure that the cachability attirbutes
|
||||
for all memory regions is correct.
|
||||
|
||||
The basic idea is to use 2MB page table entries where ever possible. If
|
||||
more granularity of cachability is required then 4K page tables are used.
|
||||
|
||||
References:
|
||||
1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel
|
||||
2) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
|
||||
3) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "VirtualMemory.h"
|
||||
|
||||
UINTN
|
||||
CreateIdentityMappingPageTables (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Allocates and fills in the Page Directory and Page Table Entries to
|
||||
establish a 1:1 Virtual to Physical mapping.
|
||||
|
||||
Arguments:
|
||||
|
||||
NumberOfProcessorPhysicalAddressBits - Number of processor address bits to use.
|
||||
Limits the number of page table entries
|
||||
to the physical address space.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 PhysicalAddressBits;
|
||||
EFI_PHYSICAL_ADDRESS PageAddress;
|
||||
UINTN IndexOfPml4Entries;
|
||||
UINTN IndexOfPdpEntries;
|
||||
UINTN IndexOfPageDirectoryEntries;
|
||||
UINTN NumberOfPml4EntriesNeeded;
|
||||
UINTN NumberOfPdpEntriesNeeded;
|
||||
PAGE_MAP_AND_DIRECTORY_POINTER *PageMapLevel4Entry;
|
||||
PAGE_MAP_AND_DIRECTORY_POINTER *PageMap;
|
||||
PAGE_MAP_AND_DIRECTORY_POINTER *PageDirectoryPointerEntry;
|
||||
PAGE_TABLE_ENTRY *PageDirectoryEntry;
|
||||
UINTN TotalPagesNum;
|
||||
UINTN BigPageAddress;
|
||||
VOID *Hob;
|
||||
|
||||
//
|
||||
// Get physical address bits supported from CPU HOB.
|
||||
//
|
||||
PhysicalAddressBits = 36;
|
||||
|
||||
Hob = GetFirstHob (EFI_HOB_TYPE_CPU);
|
||||
if (Hob != NULL) {
|
||||
PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate the table entries needed.
|
||||
//
|
||||
if (PhysicalAddressBits <= 39 ) {
|
||||
NumberOfPml4EntriesNeeded = 1;
|
||||
NumberOfPdpEntriesNeeded = 1 << (PhysicalAddressBits - 30);
|
||||
} else {
|
||||
NumberOfPml4EntriesNeeded = 1 << (PhysicalAddressBits - 39);
|
||||
NumberOfPdpEntriesNeeded = 512;
|
||||
}
|
||||
|
||||
//
|
||||
// Pre-allocate big pages to avoid later allocations.
|
||||
//
|
||||
TotalPagesNum = (NumberOfPdpEntriesNeeded + 1) * NumberOfPml4EntriesNeeded + 1;
|
||||
BigPageAddress = (UINTN) AllocatePages (TotalPagesNum);
|
||||
ASSERT (BigPageAddress != 0);
|
||||
|
||||
//
|
||||
// By architecture only one PageMapLevel4 exists - so lets allocate storage for it.
|
||||
//
|
||||
PageMap = (VOID *) BigPageAddress;
|
||||
BigPageAddress += EFI_PAGE_SIZE;
|
||||
|
||||
PageMapLevel4Entry = PageMap;
|
||||
PageAddress = 0;
|
||||
for (IndexOfPml4Entries = 0; IndexOfPml4Entries < NumberOfPml4EntriesNeeded; IndexOfPml4Entries++, PageMapLevel4Entry++) {
|
||||
//
|
||||
// Each PML4 entry points to a page of Page Directory Pointer entires.
|
||||
// So lets allocate space for them and fill them in in the IndexOfPdpEntries loop.
|
||||
//
|
||||
PageDirectoryPointerEntry = (VOID *) BigPageAddress;
|
||||
BigPageAddress += EFI_PAGE_SIZE;
|
||||
|
||||
//
|
||||
// Make a PML4 Entry
|
||||
//
|
||||
PageMapLevel4Entry->Uint64 = (UINT64)(UINTN)PageDirectoryPointerEntry;
|
||||
PageMapLevel4Entry->Bits.ReadWrite = 1;
|
||||
PageMapLevel4Entry->Bits.Present = 1;
|
||||
|
||||
for (IndexOfPdpEntries = 0; IndexOfPdpEntries < NumberOfPdpEntriesNeeded; IndexOfPdpEntries++, PageDirectoryPointerEntry++) {
|
||||
//
|
||||
// Each Directory Pointer entries points to a page of Page Directory entires.
|
||||
// So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
|
||||
//
|
||||
PageDirectoryEntry = (VOID *) BigPageAddress;
|
||||
BigPageAddress += EFI_PAGE_SIZE;
|
||||
|
||||
//
|
||||
// Fill in a Page Directory Pointer Entries
|
||||
//
|
||||
PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry;
|
||||
PageDirectoryPointerEntry->Bits.ReadWrite = 1;
|
||||
PageDirectoryPointerEntry->Bits.Present = 1;
|
||||
|
||||
for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += 0x200000) {
|
||||
//
|
||||
// Fill in the Page Directory entries
|
||||
//
|
||||
PageDirectoryEntry->Uint64 = (UINT64)PageAddress;
|
||||
PageDirectoryEntry->Bits.ReadWrite = 1;
|
||||
PageDirectoryEntry->Bits.Present = 1;
|
||||
PageDirectoryEntry->Bits.MustBe1 = 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// For the PML4 entries we are not using fill in a null entry.
|
||||
// For now we just copy the first entry.
|
||||
//
|
||||
for (; IndexOfPml4Entries < 512; IndexOfPml4Entries++, PageMapLevel4Entry++) {
|
||||
CopyMem (
|
||||
PageMapLevel4Entry,
|
||||
PageMap,
|
||||
sizeof (PAGE_MAP_AND_DIRECTORY_POINTER)
|
||||
);
|
||||
}
|
||||
|
||||
return (UINTN)PageMap; // FIXME
|
||||
}
|
||||
|
112
MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h
Normal file
112
MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h
Normal file
@ -0,0 +1,112 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
VirtualMemory.h
|
||||
|
||||
Abstract:
|
||||
|
||||
x64 Long Mode Virtual Memory Management Definitions
|
||||
|
||||
References:
|
||||
1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel
|
||||
2) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
|
||||
3) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
|
||||
4) AMD64 Architecture Programmer's Manual Volume 2: System Programming
|
||||
--*/
|
||||
#ifndef _VIRTUAL_MEMORY_H_
|
||||
#define _VIRTUAL_MEMORY_H_
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#define SYS_CODE64_SEL 0x38
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT32 LimitLow : 16;
|
||||
UINT32 BaseLow : 16;
|
||||
UINT32 BaseMid : 8;
|
||||
UINT32 Type : 4;
|
||||
UINT32 System : 1;
|
||||
UINT32 Dpl : 2;
|
||||
UINT32 Present : 1;
|
||||
UINT32 LimitHigh : 4;
|
||||
UINT32 Software : 1;
|
||||
UINT32 Reserved : 1;
|
||||
UINT32 DefaultSize : 1;
|
||||
UINT32 Granularity : 1;
|
||||
UINT32 BaseHigh : 8;
|
||||
} Bits;
|
||||
UINT64 Uint64;
|
||||
} IA32_GDT;
|
||||
|
||||
//
|
||||
// Page-Map Level-4 Offset (PML4) and
|
||||
// Page-Directory-Pointer Offset (PDPE) entries 4K & 2MB
|
||||
//
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
|
||||
UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
|
||||
UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
|
||||
UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
|
||||
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
|
||||
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
|
||||
UINT64 Reserved:1; // Reserved
|
||||
UINT64 MustBeZero:2; // Must Be Zero
|
||||
UINT64 Available:3; // Available for use by system software
|
||||
UINT64 PageTableBaseAddress:40; // Page Table Base Address
|
||||
UINT64 AvabilableHigh:11; // Available for use by system software
|
||||
UINT64 Nx:1; // No Execute bit
|
||||
} Bits;
|
||||
UINT64 Uint64;
|
||||
} PAGE_MAP_AND_DIRECTORY_POINTER;
|
||||
|
||||
//
|
||||
// Page Table Entry 2MB
|
||||
//
|
||||
typedef union {
|
||||
struct {
|
||||
UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
|
||||
UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
|
||||
UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
|
||||
UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
|
||||
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
|
||||
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
|
||||
UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page
|
||||
UINT64 MustBe1:1; // Must be 1
|
||||
UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
|
||||
UINT64 Available:3; // Available for use by system software
|
||||
UINT64 PAT:1; //
|
||||
UINT64 MustBeZero:8; // Must be zero;
|
||||
UINT64 PageTableBaseAddress:31; // Page Table Base Address
|
||||
UINT64 AvabilableHigh:11; // Available for use by system software
|
||||
UINT64 Nx:1; // 0 = Execute Code, 1 = No Code Execution
|
||||
} Bits;
|
||||
UINT64 Uint64;
|
||||
} PAGE_TABLE_ENTRY;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
UINTN
|
||||
CreateIdentityMappingPageTables (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
#endif
|
77
MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
Normal file
77
MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
Normal file
@ -0,0 +1,77 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, 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:
|
||||
|
||||
IpfDxeLoad.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Ipf-specifc functionality for DxeLoad.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
|
||||
VOID
|
||||
HandOffToDxeCore (
|
||||
IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
|
||||
IN EFI_PEI_HOB_POINTERS HobList,
|
||||
IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal
|
||||
)
|
||||
{
|
||||
VOID *BaseOfStack;
|
||||
VOID *TopOfStack;
|
||||
VOID *BspStore;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Allocate 128KB for the Stack
|
||||
//
|
||||
BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));
|
||||
ASSERT (BaseOfStack != NULL);
|
||||
|
||||
//
|
||||
// Allocate 16KB for the BspStore
|
||||
//
|
||||
BspStore = AllocatePages (EFI_SIZE_TO_PAGES (BSP_STORE_SIZE));
|
||||
ASSERT (BspStore != NULL);
|
||||
//
|
||||
// Build BspStoreHob
|
||||
//
|
||||
BuildBspStoreHob ((EFI_PHYSICAL_ADDRESS) (UINTN) BspStore, BSP_STORE_SIZE, EfiBootServicesData);
|
||||
|
||||
//
|
||||
// Compute the top of the stack we were allocated. Pre-allocate a UINTN
|
||||
// for safety.
|
||||
//
|
||||
TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);
|
||||
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
|
||||
|
||||
//
|
||||
// End of PEI phase singal
|
||||
//
|
||||
Status = PeiServicesInstallPpi (EndOfPeiSignal);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
SwitchStack (
|
||||
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
|
||||
HobList.Raw,
|
||||
NULL,
|
||||
TopOfStack,
|
||||
BspStore
|
||||
);
|
||||
}
|
77
MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
Normal file
77
MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
Normal file
@ -0,0 +1,77 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ImageRead.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
|
||||
EFI_STATUS
|
||||
PeiImageRead (
|
||||
IN VOID *FileHandle,
|
||||
IN UINTN FileOffset,
|
||||
IN OUT UINTN *ReadSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
|
||||
|
||||
Arguments:
|
||||
|
||||
FileHandle - The handle to the PE/COFF file
|
||||
|
||||
FileOffset - The offset, in bytes, into the file to read
|
||||
|
||||
ReadSize - The number of bytes to read from the file starting at FileOffset
|
||||
|
||||
Buffer - A pointer to the buffer to read the data into.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
|
||||
|
||||
--*/
|
||||
{
|
||||
CHAR8 *Destination8;
|
||||
CHAR8 *Source8;
|
||||
volatile UINTN Length;
|
||||
|
||||
Destination8 = Buffer;
|
||||
Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
|
||||
Length = *ReadSize;
|
||||
while (Length--) {
|
||||
*(Destination8++) = *(Source8++);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
GetImageReadFunction (
|
||||
IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
ImageContext->ImageRead = PeiImageRead;
|
||||
return EFI_SUCCESS;
|
||||
}
|
65
MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
Normal file
65
MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
Normal file
@ -0,0 +1,65 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DxeLoadFunc.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Ia32-specifc functionality for DxeLoad.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DxeIpl.h"
|
||||
|
||||
VOID
|
||||
HandOffToDxeCore (
|
||||
IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
|
||||
IN EFI_PEI_HOB_POINTERS HobList,
|
||||
IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal
|
||||
)
|
||||
{
|
||||
VOID *BaseOfStack;
|
||||
VOID *TopOfStack;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Allocate 128KB for the Stack
|
||||
//
|
||||
BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));
|
||||
ASSERT (BaseOfStack != NULL);
|
||||
|
||||
//
|
||||
// Compute the top of the stack we were allocated. Pre-allocate a UINTN
|
||||
// for safety.
|
||||
//
|
||||
TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);
|
||||
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
|
||||
|
||||
//
|
||||
// End of PEI phase singal
|
||||
//
|
||||
Status = PeiServicesInstallPpi (EndOfPeiSignal);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
SwitchStack (
|
||||
(SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,
|
||||
HobList.Raw,
|
||||
NULL,
|
||||
TopOfStack
|
||||
);
|
||||
}
|
47
MdeModulePkg/Include/Common/DecompressLibraryHob.h
Normal file
47
MdeModulePkg/Include/Common/DecompressLibraryHob.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DecompressLibraryHob.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Declaration of HOB that is used to pass decompressor library functions from PEI to DXE
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __DECOMPRESS_LIBRARY_HOB_H__
|
||||
#define __DECOMPRESS_LIBRARY_HOB_H__
|
||||
|
||||
typedef
|
||||
RETURN_STATUS
|
||||
(EFIAPI *DECOMPRESS_LIBRARY_GET_INFO) (
|
||||
IN CONST VOID *Source,
|
||||
IN UINT32 SourceSize,
|
||||
OUT UINT32 *DestinationSize,
|
||||
OUT UINT32 *ScratchSize
|
||||
);
|
||||
|
||||
typedef
|
||||
RETURN_STATUS
|
||||
(EFIAPI *DECOMPRESS_LIBRARY_DECOMPRESS) (
|
||||
IN CONST VOID *Source,
|
||||
IN OUT VOID *Destination,
|
||||
IN OUT VOID *Scratch
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
DECOMPRESS_LIBRARY_GET_INFO GetInfo;
|
||||
DECOMPRESS_LIBRARY_DECOMPRESS Decompress;
|
||||
} DECOMPRESS_LIBRARY;
|
||||
|
||||
#endif
|
@ -67,6 +67,9 @@
|
||||
##gEfiPeiPeCoffLoaderGuid will be removed in future
|
||||
gEfiPeiPeCoffLoaderGuid = { 0xd8117cff, 0x94a6, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
|
||||
gEfiPeiCorePrivateGuid = { 0xd641a0f5, 0xcb7c, 0x4846, { 0xa3, 0x80, 0x1d, 0x01, 0xb4, 0xd9, 0xe3, 0xb9 }}
|
||||
gEfiEndOfPeiSignalPpiGuid = { 0x605EA650, 0xC65C, 0x42e1, { 0xBA, 0x80, 0x91, 0xA5, 0x2A, 0xB6, 0x18, 0xC6 }}
|
||||
gEfiPeiFvFileLoaderPpiGuid = { 0x7e1f0d85, 0x04ff, 0x4bb2, { 0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 }}
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
@ -162,6 +165,6 @@
|
||||
|
||||
|
||||
[PcdsFeatureFlag.IA32]
|
||||
PcdDxeIplSwitchToLongMode|0x0001003b|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE
|
||||
PcdDxeIplSwitchToLongMode|0x0001003b|gEfiMdeModulePkgTokenSpaceGuid|BOOLEAN|TRUE
|
||||
|
||||
|
||||
|
@ -54,6 +54,11 @@
|
||||
PrintLib|${WORKSPACE}/MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
||||
TimerLib|${WORKSPACE}/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||
UefiDecompressLib|${WORKSPACE}/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
|
||||
EdkPeCoffLoaderLib|${WORKSPACE}/MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf
|
||||
ReportStatusCodeLib|${WORKSPACE}/IntelFrameworkPkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
|
||||
CustomDecompressLib|${WORKSPACE}/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
||||
HiiLib|${WORKSPACE}/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf
|
||||
|
||||
|
||||
[LibraryClasses.IA32]
|
||||
IoLib|${WORKSPACE}/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
|
||||
@ -119,6 +124,7 @@
|
||||
FvbServiceLib|${WORKSPACE}/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
|
||||
ReportStatusCodeLib|${WORKSPACE}/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
||||
ScsiLib|$(WORKSPACE)/MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
|
||||
FrameworkHiiLib|$(WORKSPACE)/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
||||
HobLib|${WORKSPACE}/MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
@ -302,9 +308,19 @@
|
||||
PcdPeiPcdDatabaseCallbackOnSetEnabled|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdPeiPcdDatabaseExEnabled|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdNtEmulatorEnable|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDevicePathSupportDevicePathFromText|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDevicePathSupportDevicePathToText|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
|
||||
# PcdStatusCodeUseOEM|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE
|
||||
|
||||
[PcdsFeatureFlag.IA32]
|
||||
PcdDxeIplSwitchToLongMode|gEfiMdeModulePkgTokenSpaceGuid|TRUE
|
||||
|
||||
[PcdsFixedAtBuild.common]
|
||||
PcdMaximumUnicodeStringLength|gEfiMdePkgTokenSpaceGuid|1000000
|
||||
PcdMaximumAsciiStringLength|gEfiMdePkgTokenSpaceGuid|1000000
|
||||
@ -379,6 +395,13 @@
|
||||
$(WORKSPACE)/MdeModulePkg/Universal/PCD/Pei/Pcd.inf
|
||||
$(WORKSPACE)/MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||
$(WORKSPACE)/MdeModulePkg/Core/Pei/PeiMain.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/DevicePathDxe/DevicePath.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.inf
|
||||
${WORKSPACE}/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
|
||||
|
||||
|
||||
[Components.X64]
|
||||
${WORKSPACE}/MdeModulePkg/Application/HelloWorld/HelloWorld.inf
|
||||
|
54
MdeModulePkg/Universal/Console/ConPlatformDxe/CommonHeader.h
Normal file
54
MdeModulePkg/Universal/Console/ConPlatformDxe/CommonHeader.h
Normal file
@ -0,0 +1,54 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <Uefi.h>
|
||||
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#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>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#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;
|
||||
|
||||
#endif
|
146
MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c
Normal file
146
MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c
Normal file
@ -0,0 +1,146 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
|
||||
|
||||
#include "ConPlatform.h"
|
||||
#include "ComponentName.h"
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = {
|
||||
ConPlatformComponentNameGetDriverName,
|
||||
ConPlatformComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
STATIC EFI_UNICODE_STRING_TABLE mConPlatformDriverNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
L"Platform Console Management Driver"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConPlatformComponentName.SupportedLanguages,
|
||||
mConPlatformDriverNameTable,
|
||||
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
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef CON_MANAGE_COMPONENT_NAME_H_
|
||||
#define CON_MANAGE_COMPONENT_NAME_H_
|
||||
|
||||
|
||||
//
|
||||
// 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
|
950
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
Normal file
950
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
Normal file
@ -0,0 +1,950 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
#include "ConPlatform.h"
|
||||
|
||||
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#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>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#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;
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding = {
|
||||
ConPlatformTextInDriverBindingSupported,
|
||||
ConPlatformTextInDriverBindingStart,
|
||||
ConPlatformTextInDriverBindingStop,
|
||||
0xa,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding = {
|
||||
ConPlatformTextOutDriverBindingSupported,
|
||||
ConPlatformTextOutDriverBindingStart,
|
||||
ConPlatformTextOutDriverBindingStop,
|
||||
0xa,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
The user Entry Point for module ConPlatform. The user code starts with this function.
|
||||
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||
@retval other Some error occurs when executing this entry point.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeConPlatform(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install driver model protocol(s).
|
||||
//
|
||||
Status = EfiLibInstallAllDriverProtocols (
|
||||
ImageHandle,
|
||||
SystemTable,
|
||||
&gConPlatformTextInDriverBinding,
|
||||
ImageHandle,
|
||||
&gConPlatformComponentName,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = EfiLibInstallAllDriverProtocols (
|
||||
ImageHandle,
|
||||
SystemTable,
|
||||
&gConPlatformTextOutDriverBinding,
|
||||
NULL,
|
||||
&gConPlatformComponentName,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextInDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Supported
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Supported() function)
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
return ConPlatformDriverBindingSupported (
|
||||
This,
|
||||
ControllerHandle,
|
||||
RemainingDevicePath,
|
||||
&gEfiSimpleTextInProtocolGuid
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextOutDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Supported
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Supported() function)
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
return ConPlatformDriverBindingSupported (
|
||||
This,
|
||||
ControllerHandle,
|
||||
RemainingDevicePath,
|
||||
&gEfiSimpleTextOutProtocolGuid
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ConPlatformDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,
|
||||
IN EFI_GUID *ProtocolGuid
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Supported
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Supported() function)
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VOID *Interface;
|
||||
|
||||
//
|
||||
// Test to see if this is a physical device by checking to see if
|
||||
// it has a Device Path Protocol
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Test to see if this device supports the Simple Text Output Protocol
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
ProtocolGuid,
|
||||
(VOID **) &Interface,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextInDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Start() function)
|
||||
|
||||
Returns:
|
||||
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;
|
||||
|
||||
//
|
||||
// Get the Device Path Protocol so the environment variables can be updated
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Open the Simple Input Protocol BY_DRIVER
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextInProtocolGuid,
|
||||
(VOID **) &TextIn,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Check the device handle, if it is a hot plug device,
|
||||
// do not put the device path into ConInDev, and install
|
||||
// gEfiConsoleInDeviceGuid to the device handle directly.
|
||||
// The policy is, make hot plug device plug in and play immediately.
|
||||
//
|
||||
if (IsHotPlugDevice (This->DriverBindingHandle, ControllerHandle)) {
|
||||
gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiConsoleInDeviceGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// Append the device path to the ConInDev environment variable
|
||||
//
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleInpDev,
|
||||
DevicePath,
|
||||
APPEND
|
||||
);
|
||||
|
||||
//
|
||||
// If the device path is an instance in the ConIn environment variable,
|
||||
// then install EfiConsoleInDeviceGuid onto ControllerHandle
|
||||
//
|
||||
Status = ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleInp,
|
||||
DevicePath,
|
||||
CHECK
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiConsoleInDeviceGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextInProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextOutDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Start() function)
|
||||
|
||||
Returns:
|
||||
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
|
||||
BOOLEAN NeedClose;
|
||||
|
||||
NeedClose = TRUE;
|
||||
|
||||
//
|
||||
// Get the Device Path Protocol so the environment variables can be updated
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Open the Simple Text Output Protocol BY_DRIVER
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID **) &TextOut,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Check the device handle, if it is a hot plug device,
|
||||
// do not put the device path into ConOutDev and StdErrDev,
|
||||
// and install gEfiConsoleOutDeviceGuid to the device handle directly.
|
||||
// The policy is, make hot plug device plug in and play immediately.
|
||||
//
|
||||
if (IsHotPlugDevice (This->DriverBindingHandle, ControllerHandle)) {
|
||||
gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiConsoleOutDeviceGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// Append the device path to the ConOutDev environment variable
|
||||
//
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleOutDev,
|
||||
DevicePath,
|
||||
APPEND
|
||||
);
|
||||
//
|
||||
// Append the device path to the StdErrDev environment variable
|
||||
//
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarErrorOutDev,
|
||||
DevicePath,
|
||||
APPEND
|
||||
);
|
||||
|
||||
//
|
||||
// If the device path is an instance in the ConOut environment variable,
|
||||
// then install EfiConsoleOutDeviceGuid onto ControllerHandle
|
||||
//
|
||||
Status = ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleOut,
|
||||
DevicePath,
|
||||
CHECK
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
NeedClose = FALSE;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiConsoleOutDeviceGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
//
|
||||
// If the device path is an instance in the StdErr environment variable,
|
||||
// then install EfiStandardErrorDeviceGuid onto ControllerHandle
|
||||
//
|
||||
Status = ConPlatformUpdateDeviceVariable (
|
||||
VarErrorOut,
|
||||
DevicePath,
|
||||
CHECK
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
NeedClose = FALSE;
|
||||
gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiStandardErrorDeviceGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (NeedClose) {
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextInDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Stop() function)
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
//
|
||||
// hot plug device is not included into the console associated variables,
|
||||
// so no need to check variable for those hot plug devices.
|
||||
//
|
||||
if (!IsHotPlugDevice (This->DriverBindingHandle, ControllerHandle)) {
|
||||
//
|
||||
// Get the Device Path Protocol so the environment variables can be updated
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Remove DevicePath from ConInDev
|
||||
//
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleInpDev,
|
||||
DevicePath,
|
||||
DELETE
|
||||
);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Uninstall the Console Device GUIDs from Controller Handle
|
||||
//
|
||||
ConPlatformUnInstallProtocol (
|
||||
This,
|
||||
ControllerHandle,
|
||||
&gEfiConsoleInDeviceGuid
|
||||
);
|
||||
|
||||
//
|
||||
// Close the Simple Input Protocol
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextInProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConPlatformTextOutDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
(Standard DriverBinding Protocol Stop() function)
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
//
|
||||
// hot plug device is not included into the console associated variables,
|
||||
// so no need to check variable for those hot plug devices.
|
||||
//
|
||||
if (!IsHotPlugDevice (This->DriverBindingHandle, ControllerHandle)) {
|
||||
//
|
||||
// Get the Device Path Protocol so the environment variables can be updated
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Remove DevicePath from ConOutDev, and StdErrDev
|
||||
//
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarConsoleOutDev,
|
||||
DevicePath,
|
||||
DELETE
|
||||
);
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
VarErrorOutDev,
|
||||
DevicePath,
|
||||
DELETE
|
||||
);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Uninstall the Console Device GUIDs from Controller Handle
|
||||
//
|
||||
ConPlatformUnInstallProtocol (
|
||||
This,
|
||||
ControllerHandle,
|
||||
&gEfiConsoleOutDeviceGuid
|
||||
);
|
||||
|
||||
ConPlatformUnInstallProtocol (
|
||||
This,
|
||||
ControllerHandle,
|
||||
&gEfiStandardErrorDeviceGuid
|
||||
);
|
||||
|
||||
//
|
||||
// Close the Simple Text Output Protocol
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ConPlatformUnInstallProtocol (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Handle,
|
||||
IN EFI_GUID *ProtocolGuid
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Handle,
|
||||
ProtocolGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
Handle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gBS->UninstallMultipleProtocolInterfaces (
|
||||
Handle,
|
||||
ProtocolGuid,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
VOID *
|
||||
ConPlatformGetVariable (
|
||||
IN CHAR16 *Name
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Read the EFI variable (Name) and return a dynamically allocated
|
||||
buffer, and the size of the buffer. On failure return NULL.
|
||||
|
||||
Arguments:
|
||||
Name - String part of EFI variable name
|
||||
|
||||
Returns:
|
||||
Dynamically allocated memory that contains a copy of the EFI variable.
|
||||
Caller is repsoncible freeing the buffer.
|
||||
|
||||
NULL - Variable was not read
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VOID *Buffer;
|
||||
UINTN BufferSize;
|
||||
|
||||
BufferSize = 0;
|
||||
Buffer = NULL;
|
||||
|
||||
//
|
||||
// Test to see if the variable exists. If it doesn't reuturn NULL
|
||||
//
|
||||
Status = gRT->GetVariable (
|
||||
Name,
|
||||
&gEfiGlobalVariableGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Buffer
|
||||
);
|
||||
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
//
|
||||
// Allocate the buffer to return
|
||||
//
|
||||
Buffer = AllocatePool (BufferSize);
|
||||
if (Buffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
//
|
||||
// Read variable into the allocated buffer.
|
||||
//
|
||||
Status = gRT->GetVariable (
|
||||
Name,
|
||||
&gEfiGlobalVariableGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Buffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (Buffer);
|
||||
Buffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
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
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Function compares a device path data structure to that of all the nodes of a
|
||||
second device path instance.
|
||||
|
||||
Arguments:
|
||||
Multi - A pointer to a multi-instance device path data structure.
|
||||
|
||||
Single - A pointer to a single-instance device path data structure.
|
||||
|
||||
NewDevicePath - If Delete is TRUE, this parameter must not be null, and it
|
||||
points to the remaining device path data structure.
|
||||
(remaining device path = Multi - Single.)
|
||||
|
||||
Delete - If TRUE, means removing Single from Multi.
|
||||
If FALSE, the routine just check whether Single matches
|
||||
with any instance in Multi.
|
||||
|
||||
Returns:
|
||||
|
||||
The function returns EFI_SUCCESS if the Single is contained within Multi.
|
||||
Otherwise, EFI_NOT_FOUND is returned.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *TempDevicePath1;
|
||||
EFI_DEVICE_PATH_PROTOCOL *TempDevicePath2;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
|
||||
UINTN Size;
|
||||
|
||||
//
|
||||
// The passed in DevicePath should not be NULL
|
||||
//
|
||||
if ((!Multi) || (!Single)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
//
|
||||
// if performing Delete operation, the NewDevicePath must not be NULL.
|
||||
//
|
||||
TempDevicePath1 = NULL;
|
||||
|
||||
DevicePath = Multi;
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
|
||||
//
|
||||
// search for the match of 'Single' in 'Multi'
|
||||
//
|
||||
while (DevicePathInst) {
|
||||
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
||||
if (!Delete) {
|
||||
FreePool (DevicePathInst);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
} else {
|
||||
if (Delete) {
|
||||
TempDevicePath2 = AppendDevicePathInstance (
|
||||
TempDevicePath1,
|
||||
DevicePathInst
|
||||
);
|
||||
if (TempDevicePath1 != NULL) {
|
||||
FreePool (TempDevicePath1);
|
||||
}
|
||||
TempDevicePath1 = TempDevicePath2;
|
||||
}
|
||||
}
|
||||
|
||||
FreePool (DevicePathInst);
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
}
|
||||
|
||||
if (Delete) {
|
||||
*NewDevicePath = TempDevicePath1;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ConPlatformUpdateDeviceVariable (
|
||||
IN CHAR16 *VariableName,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONPLATFORM_VAR_OPERATION Operation
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *VariableDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *NewVariableDevicePath;
|
||||
|
||||
VariableDevicePath = NULL;
|
||||
NewVariableDevicePath = NULL;
|
||||
|
||||
//
|
||||
// Get Variable according to variable name.
|
||||
// The memory for Variable is allocated within ConPlatformGetVarible(),
|
||||
// it is the caller's responsibility to free the memory before return.
|
||||
//
|
||||
VariableDevicePath = ConPlatformGetVariable (VariableName);
|
||||
|
||||
if (Operation != DELETE) {
|
||||
|
||||
Status = ConPlatformMatchDevicePaths (
|
||||
VariableDevicePath,
|
||||
DevicePath,
|
||||
NULL,
|
||||
FALSE
|
||||
);
|
||||
|
||||
if ((Operation == CHECK) || (!EFI_ERROR (Status))) {
|
||||
//
|
||||
// The device path is already in the variable
|
||||
//
|
||||
if (VariableDevicePath != NULL) {
|
||||
FreePool (VariableDevicePath);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// The device path is not in variable. Append DevicePath to the
|
||||
// environment variable that is a multi-instance device path.
|
||||
//
|
||||
Status = EFI_SUCCESS;
|
||||
NewVariableDevicePath = AppendDevicePathInstance (
|
||||
VariableDevicePath,
|
||||
DevicePath
|
||||
);
|
||||
if (NewVariableDevicePath == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
} else {
|
||||
//
|
||||
// Remove DevicePath from the environment variable that
|
||||
// is a multi-instance device path.
|
||||
//
|
||||
Status = ConPlatformMatchDevicePaths (
|
||||
VariableDevicePath,
|
||||
DevicePath,
|
||||
&NewVariableDevicePath,
|
||||
TRUE
|
||||
);
|
||||
}
|
||||
|
||||
if (VariableDevicePath != NULL) {
|
||||
FreePool (VariableDevicePath);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = gRT->SetVariable (
|
||||
VariableName,
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
GetDevicePathSize (NewVariableDevicePath),
|
||||
NewVariableDevicePath
|
||||
);
|
||||
|
||||
FreePool (NewVariableDevicePath);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
IsHotPlugDevice (
|
||||
EFI_HANDLE DriverBindingHandle,
|
||||
EFI_HANDLE ControllerHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// HotPlugDeviceGuid indicates ControllerHandle stands for a hot plug device.
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiHotPlugDeviceGuid,
|
||||
NULL,
|
||||
DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
132
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h
Normal file
132
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h
Normal file
@ -0,0 +1,132 @@
|
||||
/*++
|
||||
|
||||
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 common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#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
|
||||
);
|
||||
|
||||
#endif
|
112
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.inf
Normal file
112
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.inf
Normal file
@ -0,0 +1,112 @@
|
||||
#/** @file
|
||||
# Console Platfrom Driver
|
||||
#
|
||||
# Console Platfrom DXE Driver, install Console protocols
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = ConPlatform
|
||||
FILE_GUID = 51ccf399-4fdf-4e55-a45b-e123f84d456a
|
||||
MODULE_TYPE = UEFI_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = InitializeConPlatform
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gConPlatformTextInDriverBinding
|
||||
# COMPONENT_NAME = gConPlatformComponentName
|
||||
# DRIVER_BINDING = gConPlatformTextOutDriverBinding
|
||||
# COMPONENT_NAME = gConPlatformComponentName
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
ComponentName.c
|
||||
ComponentName.h
|
||||
ConPlatform.h
|
||||
ConPlatform.c
|
||||
CommonHeader.h
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
MemoryAllocationLib
|
||||
DevicePathLib
|
||||
UefiRuntimeServicesTableLib
|
||||
UefiBootServicesTableLib
|
||||
BaseMemoryLib
|
||||
UefiLib
|
||||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Guids]
|
||||
gEfiGlobalVariableGuid # SOMETIMES_CONSUMED L"ErrOut"
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiHotPlugDeviceGuid # PROTOCOL TO_START
|
||||
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
|
||||
gEfiSimpleTextInProtocolGuid # PROTOCOL TO_START
|
||||
gEfiSimpleTextOutProtocolGuid # PROTOCOL TO_START
|
||||
gEfiStandardErrorDeviceGuid # PROTOCOL BY_START
|
||||
gEfiConsoleOutDeviceGuid # PROTOCOL BY_START
|
||||
gEfiConsoleInDeviceGuid # PROTOCOL BY_START
|
||||
|
135
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.msa
Normal file
135
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.msa
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<MsaHeader>
|
||||
<ModuleName>ConPlatform</ModuleName>
|
||||
<ModuleType>UEFI_DRIVER</ModuleType>
|
||||
<GuidValue>51ccf399-4fdf-4e55-a45b-e123f84d456a</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Console Platfrom Driver</Abstract>
|
||||
<Description>Console Platfrom DXE Driver, install Console protocols</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>ConPlatform</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverModelLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiRuntimeServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>DevicePathLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>ConPlatform.c</Filename>
|
||||
<Filename>ConPlatform.h</Filename>
|
||||
<Filename>ComponentName.h</Filename>
|
||||
<Filename>ComponentName.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiConsoleInDeviceGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiConsoleOutDeviceGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiStandardErrorDeviceGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiSimpleTextInProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiHotPlugDeviceGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<Variables>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x0049 0x006E 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConInDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x0049 0x006E</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConIn" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x004F 0x0075 0x0074 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConOutDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x004F 0x0075 0x0074</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConOut" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0045 0x0072 0x0072 0x004F 0x0075 0x0074 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ErrOutDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0045 0x0072 0x0072 0x004F 0x0075 0x0074</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ErrOut" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
</Variables>
|
||||
<Guids>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiGlobalVariableGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<DriverBinding>gConPlatformTextInDriverBinding</DriverBinding>
|
||||
<ComponentName>gConPlatformComponentName</ComponentName>
|
||||
</Extern>
|
||||
<Extern>
|
||||
<DriverBinding>gConPlatformTextOutDriverBinding</DriverBinding>
|
||||
<ComponentName>gConPlatformComponentName</ComponentName>
|
||||
</Extern>
|
||||
</Externs>
|
||||
</ModuleSurfaceArea>
|
61
MdeModulePkg/Universal/Console/ConSplitterDxe/CommonHeader.h
Normal file
61
MdeModulePkg/Universal/Console/ConSplitterDxe/CommonHeader.h
Normal file
@ -0,0 +1,61 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <PiDxe.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#include <Guid/PrimaryStandardErrorDevice.h>
|
||||
#include <Guid/PrimaryConsoleOutDevice.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
#include <Guid/PrimaryConsoleInDevice.h>
|
||||
#include <Protocol/SimplePointer.h>
|
||||
#include <Protocol/SimpleTextOut.h>
|
||||
#include <Guid/ConsoleInDevice.h>
|
||||
#include <Protocol/SimpleTextIn.h>
|
||||
#include <Protocol/ConsoleControl.h>
|
||||
#include <Guid/StandardErrorDevice.h>
|
||||
#include <Guid/ConsoleOutDevice.h>
|
||||
#include <Protocol/UgaDraw.h>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
//
|
||||
// Driver Binding Externs
|
||||
//
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gConSplitterConInDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gConSplitterConInComponentName;
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gConSplitterSimplePointerDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gConSplitterSimplePointerComponentName;
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gConSplitterConOutDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gConSplitterConOutComponentName;
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gConSplitterStdErrDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gConSplitterStdErrComponentName;
|
||||
|
||||
|
||||
#endif
|
485
MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c
Normal file
485
MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c
Normal file
@ -0,0 +1,485 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "ConSplitter.h"
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
EFI_COMPONENT_NAME_PROTOCOL gConSplitterConInComponentName = {
|
||||
ConSplitterComponentNameGetDriverName,
|
||||
ConSplitterConInComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
EFI_COMPONENT_NAME_PROTOCOL gConSplitterSimplePointerComponentName = {
|
||||
ConSplitterComponentNameGetDriverName,
|
||||
ConSplitterSimplePointerComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
EFI_COMPONENT_NAME_PROTOCOL gConSplitterConOutComponentName = {
|
||||
ConSplitterComponentNameGetDriverName,
|
||||
ConSplitterConOutComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
EFI_COMPONENT_NAME_PROTOCOL gConSplitterStdErrComponentName = {
|
||||
ConSplitterComponentNameGetDriverName,
|
||||
ConSplitterStdErrComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mConSplitterDriverNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Console Splitter Driver"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mConSplitterConInControllerNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Primary Console Input Device"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mConSplitterSimplePointerControllerNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Primary Simple Pointer Device"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mConSplitterConOutControllerNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Primary Console Output Device"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mConSplitterStdErrControllerNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Primary Standard Error Device"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConSplitterConInComponentName.SupportedLanguages,
|
||||
mConSplitterDriverNameTable,
|
||||
DriverName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConInComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;
|
||||
//
|
||||
// here ChildHandle is not an Optional parameter.
|
||||
//
|
||||
if (ChildHandle == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextInProtocolGuid,
|
||||
(VOID **) &TextIn,
|
||||
NULL,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConSplitterConInComponentName.SupportedLanguages,
|
||||
mConSplitterConInControllerNameTable,
|
||||
ControllerName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;
|
||||
//
|
||||
// here ChildHandle is not an Optional parameter.
|
||||
//
|
||||
if (ChildHandle == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimplePointerProtocolGuid,
|
||||
(VOID **) &SimplePointer,
|
||||
NULL,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConSplitterSimplePointerComponentName.SupportedLanguages,
|
||||
mConSplitterSimplePointerControllerNameTable,
|
||||
ControllerName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConOutComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
|
||||
//
|
||||
// here ChildHandle is not an Optional parameter.
|
||||
//
|
||||
if (ChildHandle == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID **) &TextOut,
|
||||
NULL,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConSplitterConOutComponentName.SupportedLanguages,
|
||||
mConSplitterConOutControllerNameTable,
|
||||
ControllerName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterStdErrComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ErrOut;
|
||||
//
|
||||
// here ChildHandle is not an Optional parameter.
|
||||
//
|
||||
if (ChildHandle == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID **) &ErrOut,
|
||||
NULL,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gConSplitterStdErrComponentName.SupportedLanguages,
|
||||
mConSplitterStdErrControllerNameTable,
|
||||
ControllerName
|
||||
);
|
||||
}
|
3467
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
Normal file
3467
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
Normal file
File diff suppressed because it is too large
Load Diff
667
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
Normal file
667
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
Normal file
@ -0,0 +1,667 @@
|
||||
/**@file
|
||||
Private data structures for the Console Splitter driver
|
||||
|
||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _CON_SPLITTER_H_
|
||||
#define _CON_SPLITTER_H_
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
//
|
||||
// Private Data Structures
|
||||
//
|
||||
#define CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT 32
|
||||
#define CONSOLE_SPLITTER_MODES_ALLOC_UNIT 32
|
||||
#define MAX_STD_IN_PASSWORD 80
|
||||
|
||||
typedef struct {
|
||||
UINTN Columns;
|
||||
UINTN Rows;
|
||||
} TEXT_OUT_SPLITTER_QUERY_DATA;
|
||||
|
||||
//
|
||||
// Private data for the EFI_SIMPLE_TEXT_INPUT_PROTOCOL splitter
|
||||
//
|
||||
#define TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('T', 'i', 'S', 'p')
|
||||
|
||||
typedef struct {
|
||||
UINT64 Signature;
|
||||
EFI_HANDLE VirtualHandle;
|
||||
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL TextIn;
|
||||
UINTN CurrentNumberOfConsoles;
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL **TextInList;
|
||||
UINTN TextInListCount;
|
||||
|
||||
EFI_SIMPLE_POINTER_PROTOCOL SimplePointer;
|
||||
EFI_SIMPLE_POINTER_MODE SimplePointerMode;
|
||||
UINTN CurrentNumberOfPointers;
|
||||
EFI_SIMPLE_POINTER_PROTOCOL **PointerList;
|
||||
UINTN PointerListCount;
|
||||
|
||||
BOOLEAN PasswordEnabled;
|
||||
CHAR16 Password[MAX_STD_IN_PASSWORD];
|
||||
UINTN PwdIndex;
|
||||
CHAR16 PwdAttempt[MAX_STD_IN_PASSWORD];
|
||||
EFI_EVENT LockEvent;
|
||||
|
||||
BOOLEAN KeyEventSignalState;
|
||||
BOOLEAN InputEventSignalState;
|
||||
} TEXT_IN_SPLITTER_PRIVATE_DATA;
|
||||
|
||||
#define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_IN_SPLITTER_PRIVATE_DATA, \
|
||||
TextIn, \
|
||||
TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
#define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_SIMPLE_POINTER_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_IN_SPLITTER_PRIVATE_DATA, \
|
||||
SimplePointer, \
|
||||
TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
//
|
||||
// Private data for the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL splitter
|
||||
//
|
||||
#define TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('T', 'o', 'S', 'p')
|
||||
|
||||
typedef struct {
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
|
||||
BOOLEAN TextOutEnabled;
|
||||
} TEXT_OUT_AND_GOP_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT32 HorizontalResolution;
|
||||
UINT32 VerticalResolution;
|
||||
} TEXT_OUT_GOP_MODE;
|
||||
|
||||
typedef struct {
|
||||
UINT64 Signature;
|
||||
EFI_HANDLE VirtualHandle;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode;
|
||||
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GraphicsOutputBlt;
|
||||
TEXT_OUT_GOP_MODE *GraphicsOutputModeBuffer;
|
||||
UINTN CurrentNumberOfGraphicsOutput;
|
||||
BOOLEAN HardwareNeedsStarting;
|
||||
|
||||
EFI_CONSOLE_CONTROL_PROTOCOL ConsoleControl;
|
||||
|
||||
UINTN CurrentNumberOfConsoles;
|
||||
TEXT_OUT_AND_GOP_DATA *TextOutList;
|
||||
UINTN TextOutListCount;
|
||||
TEXT_OUT_SPLITTER_QUERY_DATA *TextOutQueryData;
|
||||
UINTN TextOutQueryDataCount;
|
||||
INT32 *TextOutModeMap;
|
||||
|
||||
EFI_CONSOLE_CONTROL_SCREEN_MODE ConsoleOutputMode;
|
||||
|
||||
UINTN DevNullColumns;
|
||||
UINTN DevNullRows;
|
||||
CHAR16 *DevNullScreen;
|
||||
INT32 *DevNullAttributes;
|
||||
|
||||
} TEXT_OUT_SPLITTER_PRIVATE_DATA;
|
||||
|
||||
#define TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA, \
|
||||
TextOut, \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
#define GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA, \
|
||||
GraphicsOutput, \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
#define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA, \
|
||||
UgaDraw, \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
#define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
|
||||
CR ((a), \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA, \
|
||||
ConsoleControl, \
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
|
||||
)
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterDriverEntry (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterTextInConstructor (
|
||||
TEXT_IN_SPLITTER_PRIVATE_DATA *Private
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterTextOutConstructor (
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// Driver Binding Functions
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConInDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConOutDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterStdErrDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConInDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConOutDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterStdErrDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConInDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConOutDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterStdErrDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConInComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterConOutComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterStdErrComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
//
|
||||
// TextIn Constructor/Destructor functions
|
||||
//
|
||||
EFI_STATUS
|
||||
ConSplitterTextInAddDevice (
|
||||
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterTextInDeleteDevice (
|
||||
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// SimplePointer Constuctor/Destructor functions
|
||||
//
|
||||
EFI_STATUS
|
||||
ConSplitterSimplePointerAddDevice (
|
||||
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterSimplePointerDeleteDevice (
|
||||
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// TextOut Constuctor/Destructor functions
|
||||
//
|
||||
EFI_STATUS
|
||||
ConSplitterTextOutAddDevice (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut,
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||
IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterTextOutDeleteDevice (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// TextIn I/O Functions
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextInReset (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextInReadKeyStroke (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ConSplitterTextInWaitForKey (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
ConSpliterConssoleControlStdInLocked (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ConSpliterConsoleControlLockStdInEvent (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterConsoleControlLockStdIn (
|
||||
IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
||||
IN CHAR16 *Password
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextInPrivateReadKeyStroke (
|
||||
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerReset (
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerGetState (
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
|
||||
IN OUT EFI_SIMPLE_POINTER_STATE *State
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ConSplitterSimplePointerWaitForInput (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// TextOut I/O Functions
|
||||
//
|
||||
VOID
|
||||
ConSplitterSynchronizeModeData (
|
||||
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutReset (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutOutputString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutTestString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutQueryMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber,
|
||||
OUT UINTN *Columns,
|
||||
OUT UINTN *Rows
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutSetMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutSetAttribute (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Attribute
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutClearScreen (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutSetCursorPosition (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Column,
|
||||
IN UINTN Row
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSplitterTextOutEnableCursor (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN Visible
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConSplitterGrowBuffer (
|
||||
IN UINTN SizeOfCount,
|
||||
IN UINTN *Count,
|
||||
IN OUT VOID **Buffer
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterConsoleControlGetMode (
|
||||
IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
||||
OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
|
||||
OUT BOOLEAN *GopExists,
|
||||
OUT BOOLEAN *StdInLocked
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterConsoleControlSetMode (
|
||||
IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
|
||||
IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterGraphicsOutputQueryMode (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||
IN UINT32 ModeNumber,
|
||||
OUT UINTN *SizeOfInfo,
|
||||
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterGraphicsOutputSetMode (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
|
||||
IN UINT32 ModeNumber
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConSpliterGraphicsOutputBlt (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
|
||||
IN UINTN SourceX,
|
||||
IN UINTN SourceY,
|
||||
IN UINTN DestinationX,
|
||||
IN UINTN DestinationY,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN UINTN Delta OPTIONAL
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullGopSync (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||
IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
DevNullTextOutOutputString (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullTextOutSetMode (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN UINTN ModeNumber
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullTextOutClearScreen (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullTextOutSetCursorPosition (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN UINTN Column,
|
||||
IN UINTN Row
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullTextOutEnableCursor (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||
IN BOOLEAN Visible
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
DevNullSyncGopStdOut (
|
||||
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private
|
||||
)
|
||||
;
|
||||
|
||||
#endif
|
120
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.inf
Normal file
120
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.inf
Normal file
@ -0,0 +1,120 @@
|
||||
#/** @file
|
||||
# Component description file for ConSplitter module.
|
||||
#
|
||||
# Any Handle that attatched EFI_CONSOLE_IDENTIFIER_PROTOCOL can be bound by this driver.
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = ConSplitter
|
||||
FILE_GUID = 408edcec-cf6d-477c-a5a8-b4844e3de281
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = InitializeConSplitter
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gConSplitterConInDriverBinding
|
||||
# COMPONENT_NAME = gConSplitterConInComponentName
|
||||
# DRIVER_BINDING = gConSplitterSimplePointerDriverBinding
|
||||
# COMPONENT_NAME = gConSplitterSimplePointerComponentName
|
||||
# DRIVER_BINDING = gConSplitterConOutDriverBinding
|
||||
# COMPONENT_NAME = gConSplitterConOutComponentName
|
||||
# DRIVER_BINDING = gConSplitterStdErrDriverBinding
|
||||
# COMPONENT_NAME = gConSplitterStdErrComponentName
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
ConSplitterGraphics.c
|
||||
ComponentName.c
|
||||
ConSplitter.h
|
||||
ConSplitter.c
|
||||
CommonHeader.h
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
BaseMemoryLib
|
||||
BaseLib
|
||||
UefiLib
|
||||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Guids]
|
||||
gEfiConsoleInDeviceGuid # ALWAYS_CONSUMED
|
||||
gEfiStandardErrorDeviceGuid # ALWAYS_CONSUMED
|
||||
gEfiConsoleOutDeviceGuid # ALWAYS_CONSUMED
|
||||
gEfiPrimaryConsoleOutDeviceGuid # ALWAYS_PRODUCED
|
||||
gEfiPrimaryConsoleInDeviceGuid # ALWAYS_PRODUCED
|
||||
gEfiPrimaryStandardErrorDeviceGuid # ALWAYS_PRODUCED
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiConsoleControlProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiSimplePointerProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiSimpleTextInProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiSimpleTextOutProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiGraphicsOutputProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiUgaDrawProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
|
126
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.msa
Normal file
126
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.msa
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
|
||||
<MsaHeader>
|
||||
<ModuleName>ConSplitter</ModuleName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<GuidValue>408edcec-cf6d-477c-a5a8-b4844e3de281</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for ConSplitter module.</Abstract>
|
||||
<Description>Any Handle that attatched EFI_CONSOLE_IDENTIFIER_PROTOCOL can be bound by this driver.</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>ConSplitter</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverModelLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>ConSplitter.c</Filename>
|
||||
<Filename>ConSplitter.h</Filename>
|
||||
<Filename>ComponentName.c</Filename>
|
||||
<Filename>ConSplitterGraphics.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiUgaDrawProtocolGuid</ProtocolCName>
|
||||
<HelpText>UGA Draw protocol is only installed in EFI mode.</HelpText>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiGraphicsOutputProtocolGuid</ProtocolCName>
|
||||
<HelpText>Graphics Output Protocol is only installed in UEFI mode.</HelpText>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiSimpleTextInProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiSimplePointerProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiConsoleControlProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<Guids>
|
||||
<GuidCNames Usage="ALWAYS_PRODUCED">
|
||||
<GuidCName>gEfiPrimaryStandardErrorDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_PRODUCED">
|
||||
<GuidCName>gEfiPrimaryConsoleInDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_PRODUCED">
|
||||
<GuidCName>gEfiPrimaryConsoleOutDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiConsoleOutDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiStandardErrorDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiConsoleInDeviceGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<ModuleEntryPoint>ConSplitterDriverEntry</ModuleEntryPoint>
|
||||
</Extern>
|
||||
<Extern>
|
||||
<DriverBinding>gConSplitterConInDriverBinding</DriverBinding>
|
||||
<ComponentName>gConSplitterConInComponentName</ComponentName>
|
||||
</Extern>
|
||||
<Extern>
|
||||
<DriverBinding>gConSplitterSimplePointerDriverBinding</DriverBinding>
|
||||
<ComponentName>gConSplitterSimplePointerComponentName</ComponentName>
|
||||
</Extern>
|
||||
<Extern>
|
||||
<DriverBinding>gConSplitterConOutDriverBinding</DriverBinding>
|
||||
<ComponentName>gConSplitterConOutComponentName</ComponentName>
|
||||
</Extern>
|
||||
<Extern>
|
||||
<DriverBinding>gConSplitterStdErrDriverBinding</DriverBinding>
|
||||
<ComponentName>gConSplitterStdErrComponentName</ComponentName>
|
||||
</Extern>
|
||||
</Externs>
|
||||
</ModuleSurfaceArea>
|
1222
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
Normal file
1222
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,47 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <PiDxe.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#include <Protocol/FrameworkHii.h>
|
||||
#include <Protocol/SimpleTextOut.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
#include <Protocol/UgaDraw.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/HiiLibFramework.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
//
|
||||
// Driver Binding Externs
|
||||
//
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName;
|
||||
|
||||
#endif
|
@ -0,0 +1,144 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "GraphicsConsole.h"
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName = {
|
||||
GraphicsConsoleComponentNameGetDriverName,
|
||||
GraphicsConsoleComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
STATIC EFI_UNICODE_STRING_TABLE mGraphicsConsoleDriverNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *)L"UGA Console Driver"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gGraphicsConsoleComponentName.SupportedLanguages,
|
||||
mGraphicsConsoleDriverNameTable,
|
||||
DriverName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language specified
|
||||
by Language from the point of view of the driver specified
|
||||
by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently managing
|
||||
the controller specified by ControllerHandle and
|
||||
ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _GRAPHICS_CONSOLE_COMPONENT_NAME_H
|
||||
#define _GRAPHICS_CONSOLE_COMPONENT_NAME_H
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName;
|
||||
|
||||
//
|
||||
// EFI Component Name Functions
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
;
|
||||
|
||||
#endif
|
@ -0,0 +1,56 @@
|
||||
/**@file
|
||||
Entry Point Source file.
|
||||
|
||||
This file contains the user entry point
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
/**
|
||||
The user Entry Point for module GraphicsConsole. The user code starts with this function.
|
||||
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||
@retval other Some error occurs when executing this entry point.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeGraphicsConsole(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install driver model protocol(s).
|
||||
//
|
||||
Status = EfiLibInstallAllDriverProtocols (
|
||||
ImageHandle,
|
||||
SystemTable,
|
||||
&gGraphicsConsoleDriverBinding,
|
||||
ImageHandle,
|
||||
&gGraphicsConsoleComponentName,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
1826
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
Normal file
1826
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,192 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
GraphicsConsole.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _GRAPHICS_CONSOLE_H
|
||||
#define _GRAPHICS_CONSOLE_H
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "ComponentName.h"
|
||||
|
||||
//
|
||||
// Glyph database
|
||||
//
|
||||
#define GLYPH_WIDTH 8
|
||||
#define GLYPH_HEIGHT 19
|
||||
|
||||
typedef union {
|
||||
EFI_NARROW_GLYPH NarrowGlyph;
|
||||
EFI_WIDE_GLYPH WideGlyph;
|
||||
} GLYPH_UNION;
|
||||
|
||||
extern EFI_NARROW_GLYPH UsStdNarrowGlyphData[];
|
||||
extern EFI_WIDE_GLYPH UsStdWideGlyphData[];
|
||||
|
||||
//
|
||||
// Device Structure
|
||||
//
|
||||
#define GRAPHICS_CONSOLE_DEV_SIGNATURE EFI_SIGNATURE_32 ('g', 's', 't', 'o')
|
||||
|
||||
typedef struct {
|
||||
UINTN Columns;
|
||||
UINTN Rows;
|
||||
INTN DeltaX;
|
||||
INTN DeltaY;
|
||||
UINT32 GopWidth;
|
||||
UINT32 GopHeight;
|
||||
UINT32 GopModeNumber;
|
||||
} GRAPHICS_CONSOLE_MODE_DATA;
|
||||
|
||||
#define GRAPHICS_MAX_MODE 3
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
|
||||
GRAPHICS_CONSOLE_MODE_DATA ModeData[GRAPHICS_MAX_MODE];
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
} GRAPHICS_CONSOLE_DEV;
|
||||
|
||||
#define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \
|
||||
CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)
|
||||
|
||||
//
|
||||
// Global Variables
|
||||
//
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding;
|
||||
|
||||
//
|
||||
// Prototypes
|
||||
//
|
||||
UINTN
|
||||
ReturnNarrowFontSize (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
ReturnWideFontSize (
|
||||
VOID
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutReset (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutOutputString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutTestString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutQueryMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber,
|
||||
OUT UINTN *Columns,
|
||||
OUT UINTN *Rows
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutSetMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutSetAttribute (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Attribute
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutClearScreen (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutSetCursorPosition (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Column,
|
||||
IN UINTN Row
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleConOutEnableCursor (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN Visible
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EfiLocateHiiProtocol (
|
||||
VOID
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleControllerDriverSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleControllerDriverStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GraphicsConsoleControllerDriverStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
);
|
||||
|
||||
#endif
|
@ -0,0 +1,110 @@
|
||||
#/** @file
|
||||
# Component description file for GraphicsConsole module
|
||||
#
|
||||
# This is the main routine for initializing the Graphics Console support routines.
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = GraphicsConsole
|
||||
FILE_GUID = CCCB0C28-4B24-11d5-9A5A-0090273FC14D
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = InitializeGraphicsConsole
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gGraphicsConsoleDriverBinding
|
||||
# COMPONENT_NAME = gGraphicsConsoleComponentName
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
ComponentName.c
|
||||
ComponentName.h
|
||||
LaffStd.c
|
||||
GraphicsConsole.c
|
||||
GraphicsConsole.h
|
||||
CommonHeader.h
|
||||
EntryPoint.c
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
BaseMemoryLib
|
||||
UefiLib
|
||||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
HiiLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Guids]
|
||||
FontPack # ALWAYS_PRODUCED HII Formset
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiSimpleTextOutProtocolGuid # PROTOCOL BY_START
|
||||
gEfiHiiProtocolGuid # PROTOCOL TO_START
|
||||
gEfiGraphicsOutputProtocolGuid # PROTOCOL TO_START
|
||||
gEfiUgaDrawProtocolGuid # PROTOCOL TO_START
|
||||
|
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<MsaHeader>
|
||||
<ModuleName>GraphicsConsole</ModuleName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<GuidValue>CCCB0C28-4B24-11d5-9A5A-0090273FC14D</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for GraphicsConsole module</Abstract>
|
||||
<Description>This is the main routine for initializing the Graphics Console support routines.</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>GraphicsConsole</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverModelLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>HiiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>GraphicsConsole.h</Filename>
|
||||
<Filename>GraphicsConsole.c</Filename>
|
||||
<Filename>LaffStd.c</Filename>
|
||||
<Filename>ComponentName.h</Filename>
|
||||
<Filename>ComponentName.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiUgaDrawProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiGraphicsOutputProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiHiiProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_CONSUMED">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<HiiPackages>
|
||||
<HiiPackage Usage="ALWAYS_PRODUCED">
|
||||
<HiiCName>FontPack</HiiCName>
|
||||
<HelpText>Register UsStdNarrow Fonts into the global database.</HelpText>
|
||||
</HiiPackage>
|
||||
</HiiPackages>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<DriverBinding>gGraphicsConsoleDriverBinding</DriverBinding>
|
||||
<ComponentName>gGraphicsConsoleComponentName</ComponentName>
|
||||
</Extern>
|
||||
</Externs>
|
||||
</ModuleSurfaceArea>
|
295
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/LaffStd.c
Normal file
295
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/LaffStd.c
Normal file
@ -0,0 +1,295 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
LaffStd.c
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "GraphicsConsole.h"
|
||||
|
||||
EFI_NARROW_GLYPH UsStdNarrowGlyphData[] = {
|
||||
//
|
||||
// Unicode glyphs from 0x20 to 0x7e are the same as ASCII characters 0x20 to 0x7e
|
||||
//
|
||||
{ 0x0020, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0021, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0022, 0x00, {0x00,0x00,0x00,0x6C,0x6C,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0023, 0x00, {0x00,0x00,0x00,0x00,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0024, 0x00, {0x00,0x00,0x18,0x18,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00}},
|
||||
{ 0x0025, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0026, 0x00, {0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x76,0xDC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0027, 0x00, {0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0028, 0x00, {0x00,0x00,0x00,0x06,0x0C,0x0C,0x18,0x18,0x18,0x18,0x18,0x18,0x0C,0x0C,0x06,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0029, 0x00, {0x00,0x00,0x00,0xC0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60,0xC0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x38,0xFE,0x38,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002b, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002c, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002e, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x002f, 0x00, {0x00,0x00,0x00,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC0,0xC0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0030, 0x00, {0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0031, 0x00, {0x00,0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0032, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC2,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0033, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x06,0x3C,0x06,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0034, 0x00, {0x00,0x00,0x00,0x1C,0x1C,0x3C,0x3C,0x6C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0035, 0x00, {0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0036, 0x00, {0x00,0x00,0x00,0x3C,0x60,0xC0,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0037, 0x00, {0x00,0x00,0x00,0xFE,0xC6,0x06,0x06,0x06,0x0C,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0038, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0039, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003b, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003c, 0x00, {0x00,0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003e, 0x00, {0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x003f, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x0C,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0040, 0x00, {0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0xC0,0x7E,0x00,0x00,0x00,0x00}},
|
||||
|
||||
{ 0x0041, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
|
||||
{ 0x0042, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0043, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0044, 0x00, {0x00,0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0045, 0x00, {0x00,0x00,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0046, 0x00, {0x00,0x00,0x00,0xFE,0x66,0x62,0x60,0x64,0x7C,0x64,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0047, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xDE,0xC6,0xC6,0xC6,0x66,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0048, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0049, 0x00, {0x00,0x00,0x00,0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xFC,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004a, 0x00, {0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004b, 0x00, {0x00,0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x70,0x78,0x6C,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004c, 0x00, {0x00,0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004d, 0x00, {0x00,0x00,0x00,0xC6,0xEE,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004e, 0x00, {0x00,0x00,0x00,0xC6,0xE6,0xF6,0xF6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x004f, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0050, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0051, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0x7C,0x1C,0x0E,0x00,0x00}},
|
||||
{ 0x0052, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x78,0x6C,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0053, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x60,0x38,0x0C,0x06,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0054, 0x00, {0x00,0x00,0x00,0xFC,0xFC,0xB4,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0055, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0056, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0057, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0058, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x6C,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0059, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005a, 0x00, {0x00,0x00,0x00,0xFE,0xC6,0x86,0x0C,0x0C,0x18,0x30,0x60,0xC0,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005b, 0x00, {0x00,0x00,0x00,0x1E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005c, 0x00, {0x00,0x00,0x00,0xC0,0xC0,0x60,0x60,0x30,0x30,0x18,0x18,0x0C,0x0C,0x06,0x06,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005d, 0x00, {0x00,0x00,0x00,0xF0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xF0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005e, 0x00, {0x00,0x00,0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x005f, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0060, 0x00, {0x00,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0061, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0062, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0063, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0064, 0x00, {0x00,0x00,0x00,0x1C,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0065, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0066, 0x00, {0x00,0x00,0x00,0x1E,0x33,0x30,0x30,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0067, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00}},
|
||||
{ 0x0068, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x76,0x66,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0069, 0x00, {0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x006a, 0x00, {0x00,0x00,0x00,0x0C,0x0C,0x0C,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x6C,0x38,0x00}},
|
||||
{ 0x006b, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x70,0x78,0x6C,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x006c, 0x00, {0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x006d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xEE,0xFE,0xD6,0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x006e, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}},
|
||||
{ 0x006f, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0070, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00}},
|
||||
{ 0x0071, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00}},
|
||||
{ 0x0072, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0073, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0074, 0x00, {0x00,0x00,0x00,0x10,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0075, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0076, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0077, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0078, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x0079, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00}},
|
||||
{ 0x007a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC0,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x007b, 0x00, {0x00,0x00,0x00,0x0E,0x18,0x18,0x18,0x18,0x30,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x007c, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x007d, 0x00, {0x00,0x00,0x00,0xE0,0x30,0x30,0x30,0x30,0x18,0x30,0x30,0x30,0x30,0x30,0xE0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x007e, 0x00, {0x00,0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
|
||||
{ 0x00a0, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a1, 0x00, {0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a2, 0x00, {0x00,0x00,0x00,0x00,0x18,0x18,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a3, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x64,0x60,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a4, 0x00, {0x00,0x00,0x18,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a5, 0x00, {0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a6, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a7, 0x00, {0x00,0x00,0x18,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a8, 0x00, {0x00,0x00,0x00,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00a9, 0x00, {0x00,0x00,0x00,0x00,0x7C,0x82,0x9A,0xA2,0xA2,0xA2,0x9A,0x82,0x7C,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00aa, 0x00, {0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ab, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ac, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ad, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ae, 0x00, {0x00,0x00,0x00,0x00,0x7C,0x82,0xB2,0xAA,0xAA,0xB2,0xAA,0xAA,0x82,0x7C,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00af, 0x00, {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b0, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b1, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b2, 0x00, {0x00,0x00,0x00,0x3C,0x66,0x0C,0x18,0x32,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b3, 0x00, {0x00,0x00,0x00,0x7C,0x06,0x3C,0x06,0x06,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b4, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b5, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00}},
|
||||
{ 0x00b6, 0x00, {0x00,0x00,0x00,0x7F,0xDB,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00b8, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78,0x00,0x00,0x00}},
|
||||
{ 0x00b9, 0x00, {0x00,0x00,0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ba, 0x00, {0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00bb, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00bc, 0x00, {0x00,0x00,0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00,0x00}},
|
||||
{ 0x00bd, 0x00, {0x00,0x00,0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x60,0xDC,0x86,0x0C,0x18,0x3E,0x00,0x00,0x00}},
|
||||
{ 0x00be, 0x00, {0x00,0x00,0x00,0xE0,0x30,0x62,0x36,0xEC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00,0x00}},
|
||||
{ 0x00bf, 0x00, {0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c0, 0x00, {0x60,0x30,0x18,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c1, 0x00, {0x18,0x30,0x60,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c2, 0x00, {0x10,0x38,0x6C,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c3, 0x00, {0x76,0xDC,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c4, 0x00, {0xCC,0xCC,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c5, 0x00, {0x38,0x6C,0x38,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c6, 0x00, {0x00,0x00,0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c7, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x18,0x70,0x00,0x00}},
|
||||
{ 0x00c8, 0x00, {0x60,0x30,0x18,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00c9, 0x00, {0x18,0x30,0x60,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ca, 0x00, {0x10,0x38,0x6C,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00cb, 0x00, {0xCC,0xCC,0x00,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00cc, 0x00, {0x60,0x30,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00cd, 0x00, {0x18,0x30,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ce, 0x00, {0x10,0x38,0x6C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00cf, 0x00, {0xCC,0xCC,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d0, 0x00, {0x00,0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0xF6,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d1, 0x00, {0x76,0xDC,0x00,0x00,0xC6,0xE6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d2, 0x00, {0x60,0x30,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d3, 0x00, {0x18,0x30,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d4, 0x00, {0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d5, 0x00, {0x76,0xDC,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d6, 0x00, {0xCC,0xCC,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d7, 0x00, {0x10,0x28,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00d8, 0x00, {0x00,0x00,0x00,0x7C,0xCE,0xCE,0xDE,0xD6,0xD6,0xD6,0xD6,0xF6,0xE6,0xE6,0x7C,0x40,0x00,0x00,0x00}},
|
||||
{ 0x00d9, 0x00, {0x60,0x30,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00da, 0x00, {0x18,0x30,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00db, 0x00, {0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00dc, 0x00, {0xCC,0xCC,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00dd, 0x00, {0x18,0x30,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00de, 0x00, {0x00,0x00,0x10,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00df, 0x00, {0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xC6,0xCC,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e0, 0x00, {0x00,0x30,0x30,0x60,0x30,0x18,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e1, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e2, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e3, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e4, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0x00,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e5, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e6, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x36,0x36,0x7E,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x70,0x00,0x00}},
|
||||
{ 0x00e8, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00e9, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ea, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00eb, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ec, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ed, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ee, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00ef, 0x00, {0x00,0x00,0x00,0x66,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f0, 0x00, {0x00,0x00,0x00,0x34,0x18,0x2C,0x0C,0x06,0x3E,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f1, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f2, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f3, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f4, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f5, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f6, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f8, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xD6,0xF6,0xE6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00f9, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00fa, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00fb, 0x00, {0x00,0x00,0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00fc, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
|
||||
{ 0x00fd, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00}},
|
||||
{ 0x00fe, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00}},
|
||||
{ 0x00ff, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00}},
|
||||
|
||||
{ (CHAR16)BOXDRAW_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_UP_RIGHT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_UP_LEFT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_RIGHT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_LEFT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_UP_HORIZONTAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_HORIZONTAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_VERTICAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_RIGHT_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_DOUBLE_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_DOWN_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_LEFT_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_DOUBLE_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_DOWN_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_UP_RIGHT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_UP_DOUBLE_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_UP_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_UP_LEFT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_UP_DOUBLE_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_UP_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_LEFT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_DOUBLE_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_VERTICAL_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_UP_HORIZONTAL_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_UP_DOUBLE_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_UP_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
|
||||
{ (CHAR16)BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
{ (CHAR16)BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
|
||||
|
||||
{ (CHAR16)BLOCKELEMENT_FULL_BLOCK, 0x00, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}},
|
||||
{ (CHAR16)BLOCKELEMENT_LIGHT_SHADE, 0x00, {0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22}},
|
||||
|
||||
{ (CHAR16)GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)GEOMETRICSHAPE_LEFT_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)GEOMETRICSHAPE_UP_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)GEOMETRICSHAPE_DOWN_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
|
||||
{ (CHAR16)ARROW_UP, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)ARROW_DOWN, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)ARROW_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x20,0x60,0x60,0xFE,0xFE,0x60,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
{ (CHAR16)ARROW_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x08,0x0C,0x0C,0xFE,0xFE,0x0C,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00}},
|
||||
|
||||
{ 0x0000, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} //EOL
|
||||
};
|
||||
|
||||
UINTN
|
||||
ReturnNarrowFontSize (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// I need the size of this outside of this file, so here is a stub function to do that for me
|
||||
//
|
||||
return sizeof (UsStdNarrowGlyphData);
|
||||
}
|
51
MdeModulePkg/Universal/Console/TerminalDxe/CommonHeader.h
Normal file
51
MdeModulePkg/Universal/Console/TerminalDxe/CommonHeader.h
Normal file
@ -0,0 +1,51 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <PiDxe.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#include <Protocol/SimpleTextOut.h>
|
||||
#include <Protocol/SerialIo.h>
|
||||
#include <Guid/GlobalVariable.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/SimpleTextIn.h>
|
||||
#include <Guid/HotPlugDevice.h>
|
||||
#include <Guid/PcAnsi.h>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
//
|
||||
// Driver Binding Externs
|
||||
//
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gTerminalDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName;
|
||||
|
||||
#endif
|
200
MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c
Normal file
200
MdeModulePkg/Universal/Console/TerminalDxe/ComponentName.c
Normal file
@ -0,0 +1,200 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "Terminal.h"
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName = {
|
||||
TerminalComponentNameGetDriverName,
|
||||
TerminalComponentNameGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
static EFI_UNICODE_STRING_TABLE mTerminalDriverNameTable[] = {
|
||||
{
|
||||
"eng",
|
||||
(CHAR16 *) L"Serial Terminal Driver"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gTerminalComponentName.SupportedLanguages,
|
||||
mTerminalDriverNameTable,
|
||||
DriverName
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language
|
||||
specified by Language from the point of view of the
|
||||
driver specified by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOutput;
|
||||
TERMINAL_DEV *TerminalDevice;
|
||||
|
||||
//
|
||||
// Make sure this driver is currently managing ControllHandle
|
||||
//
|
||||
Status = EfiTestManagedDevice (
|
||||
ControllerHandle,
|
||||
gTerminalDriverBinding.DriverBindingHandle,
|
||||
&gEfiSerialIoProtocolGuid
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// This is a bus driver, so ChildHandle can not be NULL.
|
||||
//
|
||||
if (ChildHandle == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Status = EfiTestChildHandle (
|
||||
ControllerHandle,
|
||||
ChildHandle,
|
||||
&gEfiSerialIoProtocolGuid
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Get our context back
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ChildHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID **) &SimpleTextOutput,
|
||||
gTerminalDriverBinding.DriverBindingHandle,
|
||||
ChildHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TerminalDevice = TERMINAL_CON_OUT_DEV_FROM_THIS (SimpleTextOutput);
|
||||
|
||||
return LookupUnicodeString (
|
||||
Language,
|
||||
gTerminalComponentName.SupportedLanguages,
|
||||
TerminalDevice->ControllerNameTable,
|
||||
ControllerName
|
||||
);
|
||||
}
|
56
MdeModulePkg/Universal/Console/TerminalDxe/EntryPoint.c
Normal file
56
MdeModulePkg/Universal/Console/TerminalDxe/EntryPoint.c
Normal file
@ -0,0 +1,56 @@
|
||||
/**@file
|
||||
Entry Point Source file.
|
||||
|
||||
This file contains the user entry point
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
/**
|
||||
The user Entry Point for module Terminal. The user code starts with this function.
|
||||
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||
@retval other Some error occurs when executing this entry point.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeTerminal(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install driver model protocol(s).
|
||||
//
|
||||
Status = EfiLibInstallAllDriverProtocols (
|
||||
ImageHandle,
|
||||
SystemTable,
|
||||
&gTerminalDriverBinding,
|
||||
ImageHandle,
|
||||
&gTerminalComponentName,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
1194
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
Normal file
1194
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
Normal file
File diff suppressed because it is too large
Load Diff
554
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Normal file
554
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Normal file
@ -0,0 +1,554 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
terminal.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _TERMINAL_H
|
||||
#define _TERMINAL_H
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#define RAW_FIFO_MAX_NUMBER 256
|
||||
#define FIFO_MAX_NUMBER 128
|
||||
|
||||
typedef struct {
|
||||
UINT8 Head;
|
||||
UINT8 Tail;
|
||||
UINT8 Data[RAW_FIFO_MAX_NUMBER + 1];
|
||||
} RAW_DATA_FIFO;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Head;
|
||||
UINT8 Tail;
|
||||
UINT16 Data[FIFO_MAX_NUMBER + 1];
|
||||
} UNICODE_FIFO;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Head;
|
||||
UINT8 Tail;
|
||||
EFI_INPUT_KEY Data[FIFO_MAX_NUMBER + 1];
|
||||
} EFI_KEY_FIFO;
|
||||
|
||||
#define TERMINAL_DEV_SIGNATURE EFI_SIGNATURE_32 ('t', 'm', 'n', 'l')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
EFI_HANDLE Handle;
|
||||
UINT8 TerminalType;
|
||||
EFI_SERIAL_IO_PROTOCOL *SerialIo;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
VENDOR_DEVICE_PATH Node;
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
|
||||
UINTN SerialInTimeOut;
|
||||
RAW_DATA_FIFO RawFiFo;
|
||||
UNICODE_FIFO UnicodeFiFo;
|
||||
EFI_KEY_FIFO EfiKeyFiFo;
|
||||
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
|
||||
EFI_EVENT TwoSecondTimeOut;
|
||||
UINT32 InputState;
|
||||
UINT32 ResetState;
|
||||
|
||||
//
|
||||
// Esc could not be output to the screen by user,
|
||||
// but the terminal driver need to output it to
|
||||
// the terminal emulation software to send control sequence.
|
||||
// This boolean is used by the terminal driver only
|
||||
// to indicate whether the Esc could be sent or not.
|
||||
//
|
||||
BOOLEAN OutputEscChar;
|
||||
} TERMINAL_DEV;
|
||||
|
||||
#define INPUT_STATE_DEFAULT 0x00
|
||||
#define INPUT_STATE_ESC 0x01
|
||||
#define INPUT_STATE_CSI 0x02
|
||||
#define INPUT_STATE_LEFTOPENBRACKET 0x04
|
||||
#define INPUT_STATE_O 0x08
|
||||
#define INPUT_STATE_2 0x10
|
||||
|
||||
#define RESET_STATE_DEFAULT 0x00
|
||||
#define RESET_STATE_ESC_R 0x01
|
||||
#define RESET_STATE_ESC_R_ESC_r 0x02
|
||||
|
||||
#define TERMINAL_CON_IN_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInput, TERMINAL_DEV_SIGNATURE)
|
||||
#define TERMINAL_CON_OUT_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleTextOutput, TERMINAL_DEV_SIGNATURE)
|
||||
|
||||
typedef union {
|
||||
UINT8 Utf8_1;
|
||||
UINT8 Utf8_2[2];
|
||||
UINT8 Utf8_3[3];
|
||||
} UTF8_CHAR;
|
||||
|
||||
#define PcAnsiType 0
|
||||
#define VT100Type 1
|
||||
#define VT100PlusType 2
|
||||
#define VTUTF8Type 3
|
||||
|
||||
#define LEFTOPENBRACKET 0x5b // '['
|
||||
#define ACAP 0x41
|
||||
#define BCAP 0x42
|
||||
#define CCAP 0x43
|
||||
#define DCAP 0x44
|
||||
|
||||
#define MODE0_COLUMN_COUNT 80
|
||||
#define MODE0_ROW_COUNT 25
|
||||
|
||||
#define BACKSPACE 8
|
||||
#define ESC 27
|
||||
#define CSI 0x9B
|
||||
#define DEL 127
|
||||
#define BRIGHT_CONTROL_OFFSET 2
|
||||
#define FOREGROUND_CONTROL_OFFSET 6
|
||||
#define BACKGROUND_CONTROL_OFFSET 11
|
||||
#define ROW_OFFSET 2
|
||||
#define COLUMN_OFFSET 5
|
||||
|
||||
typedef struct {
|
||||
UINT16 Unicode;
|
||||
CHAR8 PcAnsi;
|
||||
CHAR8 Ascii;
|
||||
} UNICODE_TO_CHAR;
|
||||
|
||||
#define VarConsoleInpDev L"ConInDev"
|
||||
#define VarConsoleOutDev L"ConOutDev"
|
||||
#define VarErrorOutDev L"ErrOutDev"
|
||||
|
||||
//
|
||||
// Global Variables
|
||||
//
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gTerminalDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName;
|
||||
|
||||
//
|
||||
// Prototypes
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeTerminal (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConInReset (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConInReadKeyStroke (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
TerminalConInWaitForKey (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutReset (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutOutputString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutTestString (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutQueryMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber,
|
||||
OUT UINTN *Columns,
|
||||
OUT UINTN *Rows
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutSetMode (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutSetAttribute (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Attribute
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutClearScreen (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutSetCursorPosition (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Column,
|
||||
IN UINTN Row
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalConOutEnableCursor (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN Visible
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalDriverBindingSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalDriverBindingStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalDriverBindingStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalComponentNameGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
TerminalComponentNameGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
//
|
||||
// internal functions
|
||||
//
|
||||
EFI_STATUS
|
||||
TerminalConInCheckForKey (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
TerminalUpdateConsoleDevVariable (
|
||||
IN CHAR16 *VariableName,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
TerminalRemoveConsoleDevVariable (
|
||||
IN CHAR16 *VariableName,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
VOID *
|
||||
TerminalGetVariableAndSize (
|
||||
IN CHAR16 *Name,
|
||||
IN EFI_GUID *VendorGuid,
|
||||
OUT UINTN *VariableSize
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
SetTerminalDevicePath (
|
||||
IN UINT8 TerminalType,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
|
||||
OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
InitializeRawFiFo (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
InitializeUnicodeFiFo (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
InitializeEfiKeyFiFo (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
GetOneKeyFromSerial (
|
||||
EFI_SERIAL_IO_PROTOCOL *SerialIo,
|
||||
UINT8 *Input
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
RawFiFoInsertOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
UINT8 Input
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
RawFiFoRemoveOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
UINT8 *Output
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsRawFiFoEmpty (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsRawFiFoFull (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
EfiKeyFiFoInsertOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
EFI_INPUT_KEY Key
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
EfiKeyFiFoRemoveOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
EFI_INPUT_KEY *Output
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsEfiKeyFiFoEmpty (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsEfiKeyFiFoFull (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
UnicodeFiFoInsertOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
UINT16 Input
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
UnicodeFiFoRemoveOneKey (
|
||||
TERMINAL_DEV *TerminalDevice,
|
||||
UINT16 *Output
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsUnicodeFiFoEmpty (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsUnicodeFiFoFull (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
UINT8
|
||||
UnicodeFiFoGetKeyCount (
|
||||
TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
TranslateRawDataToEfiKey (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// internal functions for PC ANSI
|
||||
//
|
||||
VOID
|
||||
AnsiRawDataToUnicode (
|
||||
IN TERMINAL_DEV *PcAnsiDevice
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
UnicodeToEfiKey (
|
||||
IN TERMINAL_DEV *PcAnsiDevice
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
AnsiTestString (
|
||||
IN TERMINAL_DEV *TerminalDevice,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// internal functions for VT100
|
||||
//
|
||||
EFI_STATUS
|
||||
VT100TestString (
|
||||
IN TERMINAL_DEV *VT100Device,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// internal functions for VT100Plus
|
||||
//
|
||||
EFI_STATUS
|
||||
VT100PlusTestString (
|
||||
IN TERMINAL_DEV *TerminalDevice,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// internal functions for VTUTF8
|
||||
//
|
||||
VOID
|
||||
VTUTF8RawDataToUnicode (
|
||||
IN TERMINAL_DEV *VtUtf8Device
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
VTUTF8TestString (
|
||||
IN TERMINAL_DEV *TerminalDevice,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
UnicodeToUtf8 (
|
||||
IN CHAR16 Unicode,
|
||||
OUT UTF8_CHAR *Utf8Char,
|
||||
OUT UINT8 *ValidBytes
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
GetOneValidUtf8Char (
|
||||
IN TERMINAL_DEV *Utf8Device,
|
||||
OUT UTF8_CHAR *Utf8Char,
|
||||
OUT UINT8 *ValidBytes
|
||||
)
|
||||
;
|
||||
|
||||
VOID
|
||||
Utf8ToUnicode (
|
||||
IN UTF8_CHAR Utf8Char,
|
||||
IN UINT8 ValidBytes,
|
||||
OUT CHAR16 *UnicodeChar
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// functions for boxdraw unicode
|
||||
//
|
||||
BOOLEAN
|
||||
TerminalIsValidTextGraphics (
|
||||
IN CHAR16 Graphic,
|
||||
OUT CHAR8 *PcAnsi, OPTIONAL
|
||||
OUT CHAR8 *Ascii OPTIONAL
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
TerminalIsValidAscii (
|
||||
IN CHAR16 Ascii
|
||||
)
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
TerminalIsValidEfiCntlChar (
|
||||
IN CHAR16 CharC
|
||||
)
|
||||
;
|
||||
|
||||
#endif
|
117
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.inf
Normal file
117
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.inf
Normal file
@ -0,0 +1,117 @@
|
||||
#/** @file
|
||||
# Component description file for Terminal module.
|
||||
#
|
||||
# This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = Terminal
|
||||
FILE_GUID = 9E863906-A40F-4875-977F-5B93FF237FC6
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = InitializeTerminal
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gTerminalDriverBinding
|
||||
# COMPONENT_NAME = gTerminalComponentName
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
ComponentName.c
|
||||
vtutf8.c
|
||||
ansi.c
|
||||
TerminalConOut.c
|
||||
TerminalConIn.c
|
||||
Terminal.c
|
||||
Terminal.h
|
||||
CommonHeader.h
|
||||
EntryPoint.c
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
DevicePathLib
|
||||
UefiRuntimeServicesTableLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
BaseMemoryLib
|
||||
ReportStatusCodeLib
|
||||
UefiLib
|
||||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Guids]
|
||||
gEfiGlobalVariableGuid # SOMETIMES_CONSUMED L"ErrOutDev"
|
||||
gEfiVTUTF8Guid # SOMETIMES_CONSUMED
|
||||
gEfiVT100Guid # SOMETIMES_CONSUMED
|
||||
gEfiVT100PlusGuid # SOMETIMES_CONSUMED
|
||||
gEfiPcAnsiGuid # SOMETIMES_CONSUMED
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiHotPlugDeviceGuid # PROTOCOL SOMETIMES_CONSUMED
|
||||
gEfiSerialIoProtocolGuid # PROTOCOL TO_START
|
||||
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
|
||||
gEfiSimpleTextInProtocolGuid # PROTOCOL BY_START
|
||||
gEfiSimpleTextOutProtocolGuid # PROTOCOL BY_START
|
||||
|
129
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.msa
Normal file
129
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.msa
Normal file
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
|
||||
<MsaHeader>
|
||||
<ModuleName>Terminal</ModuleName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<GuidValue>9E863906-A40F-4875-977F-5B93FF237FC6</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for Terminal module.</Abstract>
|
||||
<Description>This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>Terminal</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverModelLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>ReportStatusCodeLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiRuntimeServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>DevicePathLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>Terminal.h</Filename>
|
||||
<Filename>Terminal.c</Filename>
|
||||
<Filename>TerminalConIn.c</Filename>
|
||||
<Filename>TerminalConOut.c</Filename>
|
||||
<Filename>ansi.c</Filename>
|
||||
<Filename>vtutf8.c</Filename>
|
||||
<Filename>ComponentName.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiSimpleTextInProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiSerialIoProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_CONSUMED">
|
||||
<ProtocolCName>gEfiHotPlugDeviceGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<Variables>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x0049 0x006E 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConInDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0043 0x006F 0x006E 0x004F 0x0075 0x0074 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ConOutDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
<Variable Usage="SOMETIMES_CONSUMED">
|
||||
<VariableName>0x0045 0x0072 0x0072 0x004F 0x0075 0x0074 0x0044 0x0065 0x0076</VariableName>
|
||||
<GuidC_Name>gEfiGlobalVariableGuid</GuidC_Name>
|
||||
<HelpText>L"ErrOutDev" global variable will be updated if the serial device is not a hot plug device.</HelpText>
|
||||
</Variable>
|
||||
</Variables>
|
||||
<Guids>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiGlobalVariableGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiPcAnsiGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiVT100PlusGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiVT100Guid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||
<GuidCName>gEfiVTUTF8Guid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<DriverBinding>gTerminalDriverBinding</DriverBinding>
|
||||
<ComponentName>gTerminalComponentName</ComponentName>
|
||||
</Extern>
|
||||
</Externs>
|
||||
</ModuleSurfaceArea>
|
1184
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
Normal file
1184
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
Normal file
File diff suppressed because it is too large
Load Diff
1002
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
Normal file
1002
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
Normal file
File diff suppressed because it is too large
Load Diff
73
MdeModulePkg/Universal/Console/TerminalDxe/ansi.c
Normal file
73
MdeModulePkg/Universal/Console/TerminalDxe/ansi.c
Normal file
@ -0,0 +1,73 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
ansi.c
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
--*/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "Terminal.h"
|
||||
|
||||
VOID
|
||||
AnsiRawDataToUnicode (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
{
|
||||
UINT8 RawData;
|
||||
|
||||
//
|
||||
// pop the raw data out from the raw fifo,
|
||||
// and translate it into unicode, then push
|
||||
// the unicode into unicode fifo, until the raw fifo is empty.
|
||||
//
|
||||
while (!IsRawFiFoEmpty (TerminalDevice)) {
|
||||
|
||||
RawFiFoRemoveOneKey (TerminalDevice, &RawData);
|
||||
|
||||
UnicodeFiFoInsertOneKey (TerminalDevice, (UINT16) RawData);
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
AnsiTestString (
|
||||
IN TERMINAL_DEV *TerminalDevice,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
{
|
||||
CHAR8 GraphicChar;
|
||||
|
||||
//
|
||||
// support three kind of character:
|
||||
// valid ascii, valid efi control char, valid text graphics.
|
||||
//
|
||||
for (; *WString != CHAR_NULL; WString++) {
|
||||
|
||||
if ( !(TerminalIsValidAscii (*WString) ||
|
||||
TerminalIsValidEfiCntlChar (*WString) ||
|
||||
TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) {
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
275
MdeModulePkg/Universal/Console/TerminalDxe/vtutf8.c
Normal file
275
MdeModulePkg/Universal/Console/TerminalDxe/vtutf8.c
Normal file
@ -0,0 +1,275 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
vtutf8.c
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
Revision History
|
||||
--*/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "Terminal.h"
|
||||
|
||||
VOID
|
||||
VTUTF8RawDataToUnicode (
|
||||
IN TERMINAL_DEV *TerminalDevice
|
||||
)
|
||||
{
|
||||
UTF8_CHAR Utf8Char;
|
||||
UINT8 ValidBytes;
|
||||
UINT16 UnicodeChar;
|
||||
|
||||
ValidBytes = 0;
|
||||
//
|
||||
// pop the raw data out from the raw fifo,
|
||||
// and translate it into unicode, then push
|
||||
// the unicode into unicode fifo, until the raw fifo is empty.
|
||||
//
|
||||
while (!IsRawFiFoEmpty (TerminalDevice)) {
|
||||
|
||||
GetOneValidUtf8Char (TerminalDevice, &Utf8Char, &ValidBytes);
|
||||
|
||||
if (ValidBytes < 1 || ValidBytes > 3) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Utf8ToUnicode (Utf8Char, ValidBytes, (CHAR16 *) &UnicodeChar);
|
||||
|
||||
UnicodeFiFoInsertOneKey (TerminalDevice, UnicodeChar);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
GetOneValidUtf8Char (
|
||||
IN TERMINAL_DEV *Utf8Device,
|
||||
OUT UTF8_CHAR *Utf8Char,
|
||||
OUT UINT8 *ValidBytes
|
||||
)
|
||||
{
|
||||
UINT8 Temp;
|
||||
UINT8 Index;
|
||||
BOOLEAN FetchFlag;
|
||||
|
||||
Temp = 0;
|
||||
Index = 0;
|
||||
FetchFlag = TRUE;
|
||||
|
||||
//
|
||||
// if no valid Utf8 char is found in the RawFiFo,
|
||||
// then *ValidBytes will be zero.
|
||||
//
|
||||
*ValidBytes = 0;
|
||||
|
||||
while (!IsRawFiFoEmpty (Utf8Device)) {
|
||||
|
||||
RawFiFoRemoveOneKey (Utf8Device, &Temp);
|
||||
|
||||
switch (*ValidBytes) {
|
||||
|
||||
case 0:
|
||||
if ((Temp & 0x80) == 0) {
|
||||
//
|
||||
// one-byte utf8 char
|
||||
//
|
||||
*ValidBytes = 1;
|
||||
|
||||
Utf8Char->Utf8_1 = Temp;
|
||||
|
||||
FetchFlag = FALSE;
|
||||
|
||||
} else if ((Temp & 0xe0) == 0xc0) {
|
||||
//
|
||||
// two-byte utf8 char
|
||||
//
|
||||
*ValidBytes = 2;
|
||||
|
||||
Utf8Char->Utf8_2[1] = Temp;
|
||||
|
||||
} else if ((Temp & 0xf0) == 0xe0) {
|
||||
//
|
||||
// three-byte utf8 char
|
||||
//
|
||||
*ValidBytes = 3;
|
||||
|
||||
Utf8Char->Utf8_3[2] = Temp;
|
||||
|
||||
Index++;
|
||||
|
||||
} else {
|
||||
//
|
||||
// reset *ValidBytes to zero, let valid utf8 char search restart
|
||||
//
|
||||
*ValidBytes = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if ((Temp & 0xc0) == 0x80) {
|
||||
|
||||
Utf8Char->Utf8_2[0] = Temp;
|
||||
|
||||
FetchFlag = FALSE;
|
||||
|
||||
} else {
|
||||
|
||||
*ValidBytes = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ((Temp & 0xc0) == 0x80) {
|
||||
|
||||
Utf8Char->Utf8_3[2 - Index] = Temp;
|
||||
Index++;
|
||||
if (Index == 3) {
|
||||
FetchFlag = FALSE;
|
||||
}
|
||||
} else {
|
||||
|
||||
*ValidBytes = 0;
|
||||
Index = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!FetchFlag) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
VOID
|
||||
Utf8ToUnicode (
|
||||
IN UTF8_CHAR Utf8Char,
|
||||
IN UINT8 ValidBytes,
|
||||
OUT CHAR16 *UnicodeChar
|
||||
)
|
||||
{
|
||||
UINT8 UnicodeByte0;
|
||||
UINT8 UnicodeByte1;
|
||||
UINT8 Byte0;
|
||||
UINT8 Byte1;
|
||||
UINT8 Byte2;
|
||||
|
||||
*UnicodeChar = 0;
|
||||
|
||||
//
|
||||
// translate utf8 code to unicode, in terminal standard,
|
||||
// up to 3 bytes utf8 code is supported.
|
||||
//
|
||||
switch (ValidBytes) {
|
||||
case 1:
|
||||
//
|
||||
// one-byte utf8 code
|
||||
//
|
||||
*UnicodeChar = (UINT16) Utf8Char.Utf8_1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
//
|
||||
// two-byte utf8 code
|
||||
//
|
||||
Byte0 = Utf8Char.Utf8_2[0];
|
||||
Byte1 = Utf8Char.Utf8_2[1];
|
||||
|
||||
UnicodeByte0 = (UINT8) ((Byte1 << 6) | (Byte0 & 0x3f));
|
||||
UnicodeByte1 = (UINT8) ((Byte1 >> 2) & 0x07);
|
||||
*UnicodeChar = (UINT16) (UnicodeByte0 | (UnicodeByte1 << 8));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
//
|
||||
// three-byte utf8 code
|
||||
//
|
||||
Byte0 = Utf8Char.Utf8_3[0];
|
||||
Byte1 = Utf8Char.Utf8_3[1];
|
||||
Byte2 = Utf8Char.Utf8_3[2];
|
||||
|
||||
UnicodeByte0 = (UINT8) ((Byte1 << 6) | (Byte0 & 0x3f));
|
||||
UnicodeByte1 = (UINT8) ((Byte2 << 4) | ((Byte1 >> 2) & 0x0f));
|
||||
*UnicodeChar = (UINT16) (UnicodeByte0 | (UnicodeByte1 << 8));
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
VOID
|
||||
UnicodeToUtf8 (
|
||||
IN CHAR16 Unicode,
|
||||
OUT UTF8_CHAR *Utf8Char,
|
||||
OUT UINT8 *ValidBytes
|
||||
)
|
||||
{
|
||||
UINT8 UnicodeByte0;
|
||||
UINT8 UnicodeByte1;
|
||||
//
|
||||
// translate unicode to utf8 code
|
||||
//
|
||||
UnicodeByte0 = (UINT8) Unicode;
|
||||
UnicodeByte1 = (UINT8) (Unicode >> 8);
|
||||
|
||||
if (Unicode < 0x0080) {
|
||||
|
||||
Utf8Char->Utf8_1 = (UINT8) (UnicodeByte0 & 0x7f);
|
||||
*ValidBytes = 1;
|
||||
|
||||
} else if (Unicode < 0x0800) {
|
||||
//
|
||||
// byte sequence: high -> low
|
||||
// Utf8_2[0], Utf8_2[1]
|
||||
//
|
||||
Utf8Char->Utf8_2[1] = (UINT8) ((UnicodeByte0 & 0x3f) + 0x80);
|
||||
Utf8Char->Utf8_2[0] = (UINT8) ((((UnicodeByte1 << 2) + (UnicodeByte0 >> 6)) & 0x1f) + 0xc0);
|
||||
|
||||
*ValidBytes = 2;
|
||||
|
||||
} else {
|
||||
//
|
||||
// byte sequence: high -> low
|
||||
// Utf8_3[0], Utf8_3[1], Utf8_3[2]
|
||||
//
|
||||
Utf8Char->Utf8_3[2] = (UINT8) ((UnicodeByte0 & 0x3f) + 0x80);
|
||||
Utf8Char->Utf8_3[1] = (UINT8) ((((UnicodeByte1 << 2) + (UnicodeByte0 >> 6)) & 0x3f) + 0x80);
|
||||
Utf8Char->Utf8_3[0] = (UINT8) (((UnicodeByte1 >> 4) & 0x0f) + 0xe0);
|
||||
|
||||
*ValidBytes = 3;
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
VTUTF8TestString (
|
||||
IN TERMINAL_DEV *TerminalDevice,
|
||||
IN CHAR16 *WString
|
||||
)
|
||||
{
|
||||
//
|
||||
// to utf8, all kind of characters are supported.
|
||||
//
|
||||
return EFI_SUCCESS;
|
||||
}
|
44
MdeModulePkg/Universal/DevicePathDxe/CommonHeader.h
Normal file
44
MdeModulePkg/Universal/DevicePathDxe/CommonHeader.h
Normal file
@ -0,0 +1,44 @@
|
||||
/**@file
|
||||
Common header file shared by all source files.
|
||||
|
||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
||||
|
||||
Copyright (c) 2006 - 2007, 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.
|
||||
**/
|
||||
|
||||
#ifndef __COMMON_HEADER_H_
|
||||
#define __COMMON_HEADER_H_
|
||||
|
||||
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <PiDxe.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
#include <Protocol/DevicePathUtilities.h>
|
||||
#include <Protocol/DebugPort.h>
|
||||
#include <Protocol/DevicePathToText.h>
|
||||
#include <Protocol/DevicePathFromText.h>
|
||||
#include <Guid/PcAnsi.h>
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#endif
|
114
MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
Normal file
114
MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
Normal file
@ -0,0 +1,114 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DevicePathDriver.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol
|
||||
and DevPathToText Protocol.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DevicePath.h"
|
||||
|
||||
EFI_HANDLE mDevicePathHandle = NULL;
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {
|
||||
GetDevicePathSizeProtocolInterface,
|
||||
DuplicateDevicePathProtocolInterface,
|
||||
AppendDevicePathProtocolInterface,
|
||||
AppendDeviceNodeProtocolInterface,
|
||||
AppendDevicePathInstanceProtocolInterface,
|
||||
GetNextDevicePathInstanceProtocolInterface,
|
||||
IsDevicePathMultiInstanceProtocolInterface,
|
||||
CreateDeviceNodeProtocolInterface
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {
|
||||
ConvertDeviceNodeToText,
|
||||
ConvertDevicePathToText
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {
|
||||
ConvertTextToDeviceNode,
|
||||
ConvertTextToDevicePath
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DevicePathEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Entry point for EFI drivers.
|
||||
|
||||
Arguments:
|
||||
ImageHandle - EFI_HANDLE
|
||||
SystemTable - EFI_SYSTEM_TABLE
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS
|
||||
others
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = EFI_UNSUPPORTED;
|
||||
if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {
|
||||
if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mDevicePathHandle,
|
||||
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
|
||||
&gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
|
||||
&gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mDevicePathHandle,
|
||||
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
|
||||
&gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mDevicePathHandle,
|
||||
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
|
||||
&gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mDevicePathHandle,
|
||||
&gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
412
MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
Normal file
412
MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
Normal file
@ -0,0 +1,412 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DevicePath.h
|
||||
|
||||
Abstract:
|
||||
Definition for Device Path Utilities driver
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEVICE_PATH_DRIVER_H
|
||||
#define _DEVICE_PATH_DRIVER_H
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
extern const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid;
|
||||
extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
|
||||
|
||||
#define MAX_CHAR 480
|
||||
|
||||
#define MIN_ALIGNMENT_SIZE sizeof(UINTN)
|
||||
#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)
|
||||
|
||||
#define IS_COMMA(a) ((a) == L',')
|
||||
#define IS_HYPHEN(a) ((a) == L'-')
|
||||
#define IS_DOT(a) ((a) == L'.')
|
||||
#define IS_LEFT_PARENTH(a) ((a) == L'(')
|
||||
#define IS_RIGHT_PARENTH(a) ((a) == L')')
|
||||
#define IS_SLASH(a) ((a) == L'/')
|
||||
#define IS_NULL(a) ((a) == L'\0')
|
||||
|
||||
#define DEVICE_NODE_END 1
|
||||
#define DEVICE_PATH_INSTANCE_END 2
|
||||
#define DEVICE_PATH_END 3
|
||||
|
||||
#define SetDevicePathInstanceEndNode(a) { \
|
||||
(a)->Type = END_DEVICE_PATH_TYPE; \
|
||||
(a)->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; \
|
||||
(a)->Length[0] = sizeof (EFI_DEVICE_PATH_PROTOCOL); \
|
||||
(a)->Length[1] = 0; \
|
||||
}
|
||||
|
||||
//
|
||||
// Private Data structure
|
||||
//
|
||||
typedef struct {
|
||||
CHAR16 *Str;
|
||||
UINTN Len;
|
||||
UINTN MaxLen;
|
||||
} POOL_PRINT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 SubType;
|
||||
VOID (*Function) (POOL_PRINT *, VOID *, BOOLEAN, BOOLEAN);
|
||||
} DEVICE_PATH_TO_TEXT_TABLE;
|
||||
|
||||
typedef struct {
|
||||
CHAR16 *DevicePathNodeText;
|
||||
EFI_DEVICE_PATH_PROTOCOL * (*Function) (CHAR16 *);
|
||||
} DEVICE_PATH_FROM_TEXT_TABLE;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN ClassExist;
|
||||
UINT8 Class;
|
||||
BOOLEAN SubClassExist;
|
||||
UINT8 SubClass;
|
||||
} USB_CLASS_TEXT;
|
||||
|
||||
#define USB_CLASS_AUDIO 1
|
||||
#define USB_CLASS_CDCCONTROL 2
|
||||
#define USB_CLASS_HID 3
|
||||
#define USB_CLASS_IMAGE 6
|
||||
#define USB_CLASS_PRINTER 7
|
||||
#define USB_CLASS_MASS_STORAGE 8
|
||||
#define USB_CLASS_HUB 9
|
||||
#define USB_CLASS_CDCDATA 10
|
||||
#define USB_CLASS_SMART_CARD 11
|
||||
#define USB_CLASS_VIDEO 14
|
||||
#define USB_CLASS_DIAGNOSTIC 220
|
||||
#define USB_CLASS_WIRELESS 224
|
||||
|
||||
#define USB_CLASS_RESERVE 254
|
||||
#define USB_SUBCLASS_FW_UPDATE 1
|
||||
#define USB_SUBCLASS_IRDA_BRIDGE 2
|
||||
#define USB_SUBCLASS_TEST 3
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT8 VendorDefinedData[1];
|
||||
} VENDOR_DEFINED_HARDWARE_DEVICE_PATH;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT8 VendorDefinedData[1];
|
||||
} VENDOR_DEFINED_MESSAGING_DEVICE_PATH;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT8 VendorDefinedData[1];
|
||||
} VENDOR_DEFINED_MEDIA_DEVICE_PATH;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 HID;
|
||||
UINT32 UID;
|
||||
UINT32 CID;
|
||||
CHAR8 HidUidCidStr[3];
|
||||
} ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 NetworkProtocol;
|
||||
UINT16 LoginOption;
|
||||
UINT16 Reserved;
|
||||
UINT16 TargetPortalGroupTag;
|
||||
UINT64 Lun;
|
||||
CHAR16 iSCSITargetName[1];
|
||||
} ISCSI_DEVICE_PATH_WITH_NAME;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT8 VendorDefinedData[1];
|
||||
} VENDOR_DEVICE_PATH_WITH_DATA;
|
||||
|
||||
CHAR16 *
|
||||
ConvertDeviceNodeToText (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
|
||||
IN BOOLEAN DisplayOnly,
|
||||
IN BOOLEAN AllowShortcuts
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert a device node to its text representation.
|
||||
|
||||
Arguments:
|
||||
DeviceNode - Points to the device node to be converted.
|
||||
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
|
||||
of the display node is used, where applicable. If DisplayOnly
|
||||
is FALSE, then the longer text representation of the display node
|
||||
is used.
|
||||
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
|
||||
representation for a device node can be used, where applicable.
|
||||
|
||||
Returns:
|
||||
A pointer - a pointer to the allocated text representation of the device node.
|
||||
NULL - if DeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
CHAR16 *
|
||||
ConvertDevicePathToText (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
|
||||
IN BOOLEAN DisplayOnly,
|
||||
IN BOOLEAN AllowShortcuts
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert a device path to its text representation.
|
||||
|
||||
Arguments:
|
||||
DeviceNode - Points to the device path to be converted.
|
||||
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
|
||||
of the display node is used, where applicable. If DisplayOnly
|
||||
is FALSE, then the longer text representation of the display node
|
||||
is used.
|
||||
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
|
||||
representation for a device node can be used, where applicable.
|
||||
|
||||
Returns:
|
||||
A pointer - a pointer to the allocated text representation of the device path.
|
||||
NULL - if DeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
ConvertTextToDeviceNode (
|
||||
IN CONST CHAR16 *TextDeviceNode
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert text to the binary representation of a device node.
|
||||
|
||||
Arguments:
|
||||
TextDeviceNode - TextDeviceNode points to the text representation of a device
|
||||
node. Conversion starts with the first character and continues
|
||||
until the first non-device node character.
|
||||
|
||||
Returns:
|
||||
A pointer - Pointer to the EFI device node.
|
||||
NULL - if TextDeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
ConvertTextToDevicePath (
|
||||
IN CONST CHAR16 *TextDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert text to the binary representation of a device path.
|
||||
|
||||
Arguments:
|
||||
TextDevicePath - TextDevicePath points to the text representation of a device
|
||||
path. Conversion starts with the first character and continues
|
||||
until the first non-device node character.
|
||||
|
||||
Returns:
|
||||
A pointer - Pointer to the allocated device path.
|
||||
NULL - if TextDeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
UINTN
|
||||
GetDevicePathSizeProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns the size of the device path, in bytes.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the start of the EFI device path.
|
||||
|
||||
Returns:
|
||||
Size - Size of the specified device path, in bytes, including the end-of-path tag.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
DuplicateDevicePathProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a duplicate of the specified path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the source EFI device path.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the duplicate device path.
|
||||
NULL - Insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDevicePathProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a new path by appending the second device path to the first.
|
||||
|
||||
Arguments:
|
||||
Src1 - Points to the first device path. If NULL, then it is ignored.
|
||||
Src2 - Points to the second device path. If NULL, then it is ignored.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDeviceNodeProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the device node to the device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path.
|
||||
DeviceNode - Points to the device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the allocated device node.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDevicePathInstanceProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the specified device path instance to the specified device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
DevicePathInstance - Points to the device path instance.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path
|
||||
NULL - Memory could not be allocated or DevicePathInstance is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
GetNextDevicePathInstanceProtocolInterface (
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
|
||||
OUT UINTN *DevicePathInstanceSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a copy of the current device path instance and returns a pointer to the next device path instance.
|
||||
|
||||
Arguments:
|
||||
DevicePathInstance - On input, this holds the pointer to the current device path
|
||||
instance. On output, this holds the pointer to the next
|
||||
device path instance or NULL if there are no more device
|
||||
path instances in the device path.
|
||||
DevicePathInstanceSize - On output, this holds the size of the device path instance,
|
||||
in bytes or zero, if DevicePathInstance is zero.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the copy of the current device path instance.
|
||||
NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsDevicePathMultiInstanceProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns whether a device path is multi-instance.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
|
||||
Returns:
|
||||
TRUE - The device path has more than one instance
|
||||
FALSE - The device path is empty or contains only a single instance.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
CreateDeviceNodeProtocolInterface (
|
||||
IN UINT8 NodeType,
|
||||
IN UINT8 NodeSubType,
|
||||
IN UINT16 NodeLength
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a device node
|
||||
|
||||
Arguments:
|
||||
NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
|
||||
the new device node.
|
||||
NodeSubType - NodeSubType is the device node sub-type
|
||||
EFI_DEVICE_PATH.SubType) for the new device node.
|
||||
NodeLength - NodeLength is the length of the device node
|
||||
(EFI_DEVICE_PATH.Length) for the new device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device node.
|
||||
NULL - NodeLength is less than
|
||||
the size of the header or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
122
MdeModulePkg/Universal/DevicePathDxe/DevicePath.inf
Normal file
122
MdeModulePkg/Universal/DevicePathDxe/DevicePath.inf
Normal file
@ -0,0 +1,122 @@
|
||||
#/** @file
|
||||
# Component description file for Device Path Driver.
|
||||
#
|
||||
# This driver implement these three UEFI deveice path protocols (
|
||||
# DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them.
|
||||
# Copyright (c) 2006 - 2007, 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.
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = DevicePath
|
||||
FILE_GUID = 9B680FCE-AD6B-4F3A-B60B-F59899003443
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
EDK_RELEASE_VERSION = 0x00090000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
ENTRY_POINT = DevicePathEntryPoint
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Sources Section - list of files that are required for the build to succeed.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Sources.common]
|
||||
DevicePathUtilities.c
|
||||
DevicePathToText.c
|
||||
DevicePathFromText.c
|
||||
DevicePath.h
|
||||
DevicePath.c
|
||||
CommonHeader.h
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Package Dependency Section - list of Package files that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Packages]
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Section - list of Library Classes that are required for
|
||||
# this module.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[LibraryClasses]
|
||||
PcdLib
|
||||
DevicePathLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
BaseMemoryLib
|
||||
BaseLib
|
||||
UefiDriverEntryPoint
|
||||
PrintLib
|
||||
DebugLib
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Guids]
|
||||
gEfiVTUTF8Guid # ALWAYS_CONSUMED
|
||||
gEfiVT100Guid # ALWAYS_CONSUMED
|
||||
gEfiVT100PlusGuid # ALWAYS_CONSUMED
|
||||
gEfiPcAnsiGuid # ALWAYS_CONSUMED
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||
# that this module uses or produces.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Protocols]
|
||||
gEfiDevicePathToTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiDevicePathFromTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiDevicePathUtilitiesProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiDebugPortProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Pcd FEATURE_FLAG - list of PCDs that this module is coded for.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[PcdsFeatureFlag.common]
|
||||
PcdDevicePathSupportDevicePathFromText|gEfiEdkModulePkgTokenSpaceGuid
|
||||
PcdDevicePathSupportDevicePathToText|gEfiEdkModulePkgTokenSpaceGuid
|
||||
|
117
MdeModulePkg/Universal/DevicePathDxe/DevicePath.msa
Normal file
117
MdeModulePkg/Universal/DevicePathDxe/DevicePath.msa
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<MsaHeader>
|
||||
<ModuleName>DevicePath</ModuleName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<GuidValue>9B680FCE-AD6B-4F3A-B60B-F59899003443</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for Device Path Driver.</Abstract>
|
||||
<Description>This driver implement these three UEFI deveice path protocols (
|
||||
DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them.</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>DevicePath</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3">
|
||||
<Keyword>PrintLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is BasePrintLib instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="91c1677a-e57f-4191-8b8e-eb7711a716e0">
|
||||
<Keyword>DevicePathLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is UefiDevicePathLib instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>PcdLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>DevicePath.c</Filename>
|
||||
<Filename>DevicePath.h</Filename>
|
||||
<Filename>DevicePathFromText.c</Filename>
|
||||
<Filename>DevicePathToText.c</Filename>
|
||||
<Filename>DevicePathUtilities.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="ALWAYS_CONSUMED">
|
||||
<ProtocolCName>gEfiDebugPortProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiDevicePathUtilitiesProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiDevicePathFromTextProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiDevicePathToTextProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<Guids>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiPcAnsiGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiVT100PlusGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiVT100Guid</GuidCName>
|
||||
</GuidCNames>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiVTUTF8Guid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
|
||||
<Extern>
|
||||
<ModuleEntryPoint>DevicePathEntryPoint</ModuleEntryPoint>
|
||||
</Extern>
|
||||
</Externs>
|
||||
<PcdCoded>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_PRODUCED">
|
||||
<C_Name>PcdDevicePathSupportDevicePathToText</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>FALSE</DefaultValue>
|
||||
<HelpText>If TRUE, then the Device Path To Text Protocol should be produced by the platform</HelpText>
|
||||
</PcdEntry>
|
||||
<PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_PRODUCED">
|
||||
<C_Name>PcdDevicePathSupportDevicePathFromText</C_Name>
|
||||
<TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
|
||||
<DefaultValue>FALSE</DefaultValue>
|
||||
<HelpText>If TRUE, then the Device Path From Text Protocol should be produced by the platform</HelpText>
|
||||
</PcdEntry>
|
||||
</PcdCoded>
|
||||
</ModuleSurfaceArea>
|
2375
MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
Normal file
2375
MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
Normal file
File diff suppressed because it is too large
Load Diff
1503
MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
Normal file
1503
MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
Normal file
File diff suppressed because it is too large
Load Diff
216
MdeModulePkg/Universal/DevicePathDxe/DevicePathUtilities.c
Normal file
216
MdeModulePkg/Universal/DevicePathDxe/DevicePathUtilities.c
Normal file
@ -0,0 +1,216 @@
|
||||
/*++
|
||||
|
||||
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:
|
||||
|
||||
DevicePathUtilities.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Implementation file for Device Path Utilities Protocol
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "DevicePath.h"
|
||||
|
||||
UINTN
|
||||
GetDevicePathSizeProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns the size of the device path, in bytes.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the start of the EFI device path.
|
||||
|
||||
Returns:
|
||||
Size - Size of the specified device path, in bytes, including the end-of-path tag.
|
||||
|
||||
--*/
|
||||
{
|
||||
return GetDevicePathSize (DevicePath);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
DuplicateDevicePathProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a duplicate of the specified path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the source EFI device path.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the duplicate device path.
|
||||
NULL - Insufficient memory.
|
||||
|
||||
--*/
|
||||
{
|
||||
return DuplicateDevicePath (DevicePath);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDevicePathProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a new path by appending the second device path to the first.
|
||||
|
||||
Arguments:
|
||||
Src1 - Points to the first device path. If NULL, then it is ignored.
|
||||
Src2 - Points to the second device path. If NULL, then it is ignored.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
return AppendDevicePath (Src1, Src2);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDeviceNodeProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the device node to the device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path.
|
||||
DeviceNode - Points to the device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the allocated device node.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
return AppendDevicePathNode (DevicePath, DeviceNode);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
AppendDevicePathInstanceProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the specified device path instance to the specified device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
DevicePathInstance - Points to the device path instance.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path
|
||||
NULL - Memory could not be allocated or DevicePathInstance is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
return AppendDevicePathInstance (DevicePath, DevicePathInstance);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
GetNextDevicePathInstanceProtocolInterface (
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
|
||||
OUT UINTN *DevicePathInstanceSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a copy of the current device path instance and returns a pointer to the next device path instance.
|
||||
|
||||
Arguments:
|
||||
DevicePathInstance - On input, this holds the pointer to the current device path
|
||||
instance. On output, this holds the pointer to the next
|
||||
device path instance or NULL if there are no more device
|
||||
path instances in the device path.
|
||||
DevicePathInstanceSize - On output, this holds the size of the device path instance,
|
||||
in bytes or zero, if DevicePathInstance is zero.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the copy of the current device path instance.
|
||||
NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
{
|
||||
return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
IsDevicePathMultiInstanceProtocolInterface (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns whether a device path is multi-instance.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
|
||||
Returns:
|
||||
TRUE - The device path has more than one instance
|
||||
FALSE - The device path is empty or contains only a single instance.
|
||||
|
||||
--*/
|
||||
{
|
||||
return IsDevicePathMultiInstance (DevicePath);
|
||||
}
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *
|
||||
CreateDeviceNodeProtocolInterface (
|
||||
IN UINT8 NodeType,
|
||||
IN UINT8 NodeSubType,
|
||||
IN UINT16 NodeLength
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a device node
|
||||
|
||||
Arguments:
|
||||
NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
|
||||
the new device node.
|
||||
NodeSubType - NodeSubType is the device node sub-type
|
||||
EFI_DEVICE_PATH.SubType) for the new device node.
|
||||
NodeLength - NodeLength is the length of the device node
|
||||
(EFI_DEVICE_PATH.Length) for the new device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device node.
|
||||
NULL - NodeLength is less than
|
||||
the size of the header or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
{
|
||||
return CreateDeviceNode (NodeType, NodeSubType, NodeLength);
|
||||
}
|
@ -19,8 +19,7 @@
|
||||
//
|
||||
// The package level header files this module uses
|
||||
//
|
||||
#include <Peim.h>
|
||||
#include <EdkPeim.h>
|
||||
#include <PiPei.h>
|
||||
//
|
||||
// The protocols, PPI and GUID defintions for this module
|
||||
//
|
||||
@ -28,6 +27,6 @@
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/EdkPeCoffLoaderLib.h>
|
||||
#include <Library/PeCoffLoaderLib.h>
|
||||
|
||||
#endif
|
||||
|
@ -56,6 +56,7 @@
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -70,6 +70,8 @@
|
||||
gEfiWinNtPhysicalDisksGuid = { 0x0C95A92F, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
|
||||
gEfiWinNtVirtualDisksGuid = { 0x0C95A928, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
|
||||
gEfiNt32PkgTokenSpaceGuid = { 0x0D79A645, 0x1D91, 0x40a6, { 0xA8, 0x1F, 0x61, 0xE6, 0x98, 0x2B, 0x32, 0xB4 }}
|
||||
gEfiEndOfPeiSignalPpiGuid = { 0x605EA650, 0xC65C, 0x42e1, { 0xBA, 0x80, 0x91, 0xA5, 0x2A, 0xB6, 0x18, 0xC6 }}
|
||||
gEfiPeiFvFileLoaderPpiGuid = { 0x7e1f0d85, 0x04ff, 0x4bb2, { 0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 }}
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -63,12 +63,10 @@
|
||||
[LibraryClasses.common]
|
||||
TimerLib|$(WORKSPACE)/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||
PrintLib|$(WORKSPACE)/MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
||||
UefiDecompressLib|$(WORKSPACE)/MdeModulePkg/Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.inf
|
||||
DebugLib|$(WORKSPACE)/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||
SerialPortLib|$(WORKSPACE)/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf
|
||||
BaseMemoryLib|$(WORKSPACE)/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||
BaseLib|$(WORKSPACE)/MdePkg/Library/BaseLib/BaseLib.inf
|
||||
CustomDecompressLib|$(WORKSPACE)/MdeModulePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf
|
||||
PerformanceLib|$(WORKSPACE)/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
|
||||
PeCoffLib|$(WORKSPACE)/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
|
||||
PciIncompatibleDeviceSupportLib|${WORKSPACE}/IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf
|
||||
@ -77,6 +75,8 @@
|
||||
GraphicsLib|$(WORKSPACE)/IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf
|
||||
FvbServiceLib|${WORKSPACE}/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
|
||||
IoLib|$(WORKSPACE)/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
|
||||
CustomDecompressLib|${WORKSPACE}/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
||||
HiiLib|${WORKSPACE}/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_CORE]
|
||||
DevicePathLib|$(WORKSPACE)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||
@ -215,6 +215,15 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[PcdsFeatureFlag.common]
|
||||
PcdDevicePathSupportDevicePathFromText|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDevicePathSupportDevicePathToText|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid|FALSE
|
||||
PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE
|
||||
|
||||
[PcdsPatchableInModule.IA32]
|
||||
PcdStatusCodeMemorySize|gEfiIntelFrameworkModulePkgTokenSpaceGuid|1
|
||||
PcdStatusCodeRuntimeMemorySize|gEfiIntelFrameworkModulePkgTokenSpaceGuid|128
|
||||
@ -369,4 +378,9 @@
|
||||
$(WORKSPACE)/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.inf ##This driver follows UEFI specification definition
|
||||
$(WORKSPACE)/Nt32Pkg/Sec/SecMain.inf
|
||||
$(WORKSPACE)/MdeModulePkg/Core/Pei/PeiMain.inf
|
||||
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/DevicePathDxe/DevicePath.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.inf
|
||||
${WORKSPACE}/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
|
||||
${WORKSPACE}/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.inf
|
Reference in New Issue
Block a user