MdeModulePkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the MdeModulePkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:02 -08:00
committed by mergify[bot]
parent 7c7184e201
commit 1436aea4d5
994 changed files with 107608 additions and 101311 deletions

View File

@@ -10,7 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#ifndef _TERMINAL_H_
#define _TERMINAL_H_
#include <Uefi.h>
#include <Guid/GlobalVariable.h>
@@ -36,44 +35,43 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/PcdLib.h>
#include <Library/BaseLib.h>
#define RAW_FIFO_MAX_NUMBER 255
#define FIFO_MAX_NUMBER 128
#define RAW_FIFO_MAX_NUMBER 255
#define FIFO_MAX_NUMBER 128
typedef struct {
UINT8 Head;
UINT8 Tail;
UINT8 Data[RAW_FIFO_MAX_NUMBER + 1];
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];
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];
UINT8 Head;
UINT8 Tail;
EFI_INPUT_KEY Data[FIFO_MAX_NUMBER + 1];
} EFI_KEY_FIFO;
typedef struct {
UINTN Columns;
UINTN Rows;
UINTN Columns;
UINTN Rows;
} TERMINAL_CONSOLE_MODE_DATA;
#define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s
#define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s
#define TERMINAL_DEV_SIGNATURE SIGNATURE_32 ('t', 'm', 'n', 'l')
#define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('t', 'm', 'e', 'n')
#define TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('t', 'm', 'e', 'n')
typedef struct _TERMINAL_CONSOLE_IN_EX_NOTIFY {
UINTN Signature;
EFI_KEY_DATA KeyData;
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
LIST_ENTRY NotifyEntry;
UINTN Signature;
EFI_KEY_DATA KeyData;
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
LIST_ENTRY NotifyEntry;
} TERMINAL_CONSOLE_IN_EX_NOTIFY;
typedef enum {
@@ -89,27 +87,27 @@ typedef enum {
} TERMINAL_TYPE;
typedef struct {
UINTN Signature;
EFI_HANDLE Handle;
TERMINAL_TYPE TerminalType;
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
TERMINAL_CONSOLE_MODE_DATA *TerminalConsoleModeData;
UINTN SerialInTimeOut;
RAW_DATA_FIFO *RawFiFo;
UNICODE_FIFO *UnicodeFiFo;
EFI_KEY_FIFO *EfiKeyFiFo;
EFI_KEY_FIFO *EfiKeyFiFoForNotify;
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
EFI_EVENT TimerEvent;
EFI_EVENT TwoSecondTimeOut;
UINT32 InputState;
UINT32 ResetState;
UINT16 TtyEscapeStr[3];
INTN TtyEscapeIndex;
UINTN Signature;
EFI_HANDLE Handle;
TERMINAL_TYPE TerminalType;
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
TERMINAL_CONSOLE_MODE_DATA *TerminalConsoleModeData;
UINTN SerialInTimeOut;
RAW_DATA_FIFO *RawFiFo;
UNICODE_FIFO *UnicodeFiFo;
EFI_KEY_FIFO *EfiKeyFiFo;
EFI_KEY_FIFO *EfiKeyFiFoForNotify;
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
EFI_EVENT TimerEvent;
EFI_EVENT TwoSecondTimeOut;
UINT32 InputState;
UINT32 ResetState;
UINT16 TtyEscapeStr[3];
INTN TtyEscapeIndex;
//
// Esc could not be output to the screen by user,
@@ -118,57 +116,57 @@ typedef struct {
// This boolean is used by the terminal driver only
// to indicate whether the Esc could be sent or not.
//
BOOLEAN OutputEscChar;
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx;
LIST_ENTRY NotifyList;
EFI_EVENT KeyNotifyProcessEvent;
BOOLEAN OutputEscChar;
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx;
LIST_ENTRY NotifyList;
EFI_EVENT KeyNotifyProcessEvent;
} 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 INPUT_STATE_LEFTOPENBRACKET_TTY 0x20
#define INPUT_STATE_1 0x40
#define INPUT_STATE_LEFTOPENBRACKET_2ND 0x80
#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 INPUT_STATE_LEFTOPENBRACKET_TTY 0x20
#define INPUT_STATE_1 0x40
#define INPUT_STATE_LEFTOPENBRACKET_2ND 0x80
#define RESET_STATE_DEFAULT 0x00
#define RESET_STATE_ESC_R 0x01
#define RESET_STATE_ESC_R_ESC_R 0x02
#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)
#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)
#define TERMINAL_CON_IN_EX_DEV_FROM_THIS(a) CR (a, TERMINAL_DEV, SimpleInputEx, TERMINAL_DEV_SIGNATURE)
typedef union {
UINT8 Utf8_1;
UINT8 Utf8_2[2];
UINT8 Utf8_3[3];
UINT8 Utf8_1;
UINT8 Utf8_2[2];
UINT8 Utf8_3[3];
} UTF8_CHAR;
#define LEFTOPENBRACKET 0x5b // '['
#define ACAP 0x41
#define BCAP 0x42
#define CCAP 0x43
#define DCAP 0x44
#define LEFTOPENBRACKET 0x5b // '['
#define ACAP 0x41
#define BCAP 0x42
#define CCAP 0x43
#define DCAP 0x44
#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
#define FW_BACK_OFFSET 2
#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
#define FW_BACK_OFFSET 2
typedef struct {
UINT16 Unicode;
CHAR8 PcAnsi;
CHAR8 Ascii;
UINT16 Unicode;
CHAR8 PcAnsi;
CHAR8 Ascii;
} UNICODE_TO_CHAR;
//
@@ -191,8 +189,8 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2;
EFI_STATUS
EFIAPI
InitializeTerminal (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
@@ -210,11 +208,10 @@ InitializeTerminal (
EFI_STATUS
EFIAPI
TerminalConInReset (
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
);
/**
Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().
@@ -266,8 +263,8 @@ IsKeyRegistered (
VOID
EFIAPI
TerminalConInWaitForKeyEx (
IN EFI_EVENT Event,
IN VOID *Context
IN EFI_EVENT Event,
IN VOID *Context
);
//
@@ -311,8 +308,8 @@ TerminalConInResetEx (
EFI_STATUS
EFIAPI
TerminalConInReadKeyStrokeEx (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
OUT EFI_KEY_DATA *KeyData
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
OUT EFI_KEY_DATA *KeyData
);
/**
@@ -399,8 +396,8 @@ TerminalConInUnregisterKeyNotify (
VOID
EFIAPI
TerminalConInWaitForKey (
IN EFI_EVENT Event,
IN VOID *Context
IN EFI_EVENT Event,
IN VOID *Context
);
/**
@@ -421,8 +418,8 @@ TerminalConInWaitForKey (
EFI_STATUS
EFIAPI
TerminalConOutReset (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
);
/**
@@ -609,9 +606,9 @@ TerminalConOutEnableCursor (
EFI_STATUS
EFIAPI
TerminalDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
@@ -633,12 +630,11 @@ TerminalDriverBindingSupported (
EFI_STATUS
EFIAPI
TerminalDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Stop this driver on Controller by closing Simple Text In, Simple Text
In Ex, Simple Text Out protocol, and removing parent device path from
@@ -657,10 +653,10 @@ TerminalDriverBindingStart (
EFI_STATUS
EFIAPI
TerminalDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
/**
@@ -674,7 +670,7 @@ TerminalDriverBindingStop (
**/
EFI_STATUS
TerminalFreeNotifyList (
IN OUT LIST_ENTRY *ListHead
IN OUT LIST_ENTRY *ListHead
);
/**
@@ -724,7 +720,6 @@ TerminalComponentNameGetDriverName (
OUT CHAR16 **DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
@@ -796,14 +791,13 @@ TerminalComponentNameGetDriverName (
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
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
//
// internal functions
//
@@ -866,9 +860,9 @@ TerminalRemoveConsoleDevVariable (
**/
EFI_STATUS
SetTerminalDevicePath (
IN TERMINAL_TYPE TerminalType,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath
IN TERMINAL_TYPE TerminalType,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath
);
/**
@@ -963,8 +957,8 @@ IsRawFiFoFull (
**/
BOOLEAN
EfiKeyFiFoForNotifyInsertOneKey (
EFI_KEY_FIFO *EfiKeyFiFo,
EFI_INPUT_KEY *Input
EFI_KEY_FIFO *EfiKeyFiFo,
EFI_INPUT_KEY *Input
);
/**
@@ -979,8 +973,8 @@ EfiKeyFiFoForNotifyInsertOneKey (
**/
BOOLEAN
EfiKeyFiFoForNotifyRemoveOneKey (
EFI_KEY_FIFO *EfiKeyFiFo,
EFI_INPUT_KEY *Output
EFI_KEY_FIFO *EfiKeyFiFo,
EFI_INPUT_KEY *Output
);
/**
@@ -994,7 +988,7 @@ EfiKeyFiFoForNotifyRemoveOneKey (
**/
BOOLEAN
IsEfiKeyFiFoForNotifyEmpty (
IN EFI_KEY_FIFO *EfiKeyFiFo
IN EFI_KEY_FIFO *EfiKeyFiFo
);
/**
@@ -1008,7 +1002,7 @@ IsEfiKeyFiFoForNotifyEmpty (
**/
BOOLEAN
IsEfiKeyFiFoForNotifyFull (
EFI_KEY_FIFO *EfiKeyFiFo
EFI_KEY_FIFO *EfiKeyFiFo
);
/**
@@ -1024,8 +1018,8 @@ IsEfiKeyFiFoForNotifyFull (
**/
BOOLEAN
EfiKeyFiFoInsertOneKey (
TERMINAL_DEV *TerminalDevice,
EFI_INPUT_KEY *Key
TERMINAL_DEV *TerminalDevice,
EFI_INPUT_KEY *Key
);
/**
@@ -1040,8 +1034,8 @@ EfiKeyFiFoInsertOneKey (
**/
BOOLEAN
EfiKeyFiFoRemoveOneKey (
TERMINAL_DEV *TerminalDevice,
EFI_INPUT_KEY *Output
TERMINAL_DEV *TerminalDevice,
EFI_INPUT_KEY *Output
);
/**
@@ -1085,8 +1079,8 @@ IsEfiKeyFiFoFull (
**/
BOOLEAN
UnicodeFiFoInsertOneKey (
TERMINAL_DEV *TerminalDevice,
UINT16 Input
TERMINAL_DEV *TerminalDevice,
UINT16 Input
);
/**
@@ -1132,7 +1126,6 @@ IsUnicodeFiFoFull (
TERMINAL_DEV *TerminalDevice
);
/**
Translate raw data into Unicode (according to different encode), and
translate Unicode into key information. (according to different standard).
@@ -1142,7 +1135,7 @@ IsUnicodeFiFoFull (
**/
VOID
TranslateRawDataToEfiKey (
IN TERMINAL_DEV *TerminalDevice
IN TERMINAL_DEV *TerminalDevice
);
//
@@ -1158,7 +1151,7 @@ TranslateRawDataToEfiKey (
**/
VOID
AnsiRawDataToUnicode (
IN TERMINAL_DEV *TerminalDevice
IN TERMINAL_DEV *TerminalDevice
);
/**
@@ -1248,7 +1241,7 @@ Putty function key map:
**/
VOID
UnicodeToEfiKey (
IN TERMINAL_DEV *TerminalDevice
IN TERMINAL_DEV *TerminalDevice
);
/**
@@ -1264,8 +1257,8 @@ UnicodeToEfiKey (
**/
EFI_STATUS
AnsiTestString (
IN TERMINAL_DEV *TerminalDevice,
IN CHAR16 *WString
IN TERMINAL_DEV *TerminalDevice,
IN CHAR16 *WString
);
//
@@ -1281,7 +1274,7 @@ AnsiTestString (
**/
VOID
VTUTF8RawDataToUnicode (
IN TERMINAL_DEV *VtUtf8Device
IN TERMINAL_DEV *VtUtf8Device
);
/**
@@ -1295,8 +1288,8 @@ VTUTF8RawDataToUnicode (
**/
EFI_STATUS
VTUTF8TestString (
IN TERMINAL_DEV *TerminalDevice,
IN CHAR16 *WString
IN TERMINAL_DEV *TerminalDevice,
IN CHAR16 *WString
);
/**
@@ -1317,9 +1310,9 @@ VTUTF8TestString (
**/
VOID
UnicodeToUtf8 (
IN CHAR16 Unicode,
OUT UTF8_CHAR *Utf8Char,
OUT UINT8 *ValidBytes
IN CHAR16 Unicode,
OUT UTF8_CHAR *Utf8Char,
OUT UINT8 *ValidBytes
);
/**
@@ -1333,9 +1326,9 @@ UnicodeToUtf8 (
**/
VOID
GetOneValidUtf8Char (
IN TERMINAL_DEV *Utf8Device,
OUT UTF8_CHAR *Utf8Char,
OUT UINT8 *ValidBytes
IN TERMINAL_DEV *Utf8Device,
OUT UTF8_CHAR *Utf8Char,
OUT UINT8 *ValidBytes
);
/**
@@ -1355,9 +1348,9 @@ GetOneValidUtf8Char (
**/
VOID
Utf8ToUnicode (
IN UTF8_CHAR Utf8Char,
IN UINT8 ValidBytes,
OUT CHAR16 *UnicodeChar
IN UTF8_CHAR Utf8Char,
IN UINT8 ValidBytes,
OUT CHAR16 *UnicodeChar
);
//
@@ -1425,7 +1418,7 @@ TerminalIsValidEfiCntlChar (
**/
BOOLEAN
IsHotPlugDevice (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
);
/**
@@ -1437,11 +1430,10 @@ IsHotPlugDevice (
VOID
EFIAPI
TerminalConInTimerHandler (
IN EFI_EVENT Event,
IN VOID *Context
IN EFI_EVENT Event,
IN VOID *Context
);
/**
Process key notify.
@@ -1451,8 +1443,8 @@ TerminalConInTimerHandler (
VOID
EFIAPI
KeyNotifyProcessHandler (
IN EFI_EVENT Event,
IN VOID *Context
IN EFI_EVENT Event,
IN VOID *Context
);
#endif