diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-25 07:29:13 +0000 |
commit | ccd55824e79865a04b1c872bda4af0f1de1f50be (patch) | |
tree | e67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/UnixConsoleDxe | |
parent | 7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff) | |
download | edk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.gz edk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.bz2 edk2-ccd55824e79865a04b1c872bda4af0f1de1f50be.zip |
Integrate patch from Andrew Fish to make it run on OS X.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/UnixConsoleDxe')
-rw-r--r-- | UnixPkg/UnixConsoleDxe/Console.h | 8 | ||||
-rw-r--r-- | UnixPkg/UnixConsoleDxe/ConsoleIn.c | 20 | ||||
-rw-r--r-- | UnixPkg/UnixConsoleDxe/ConsoleOut.c | 96 | ||||
-rw-r--r-- | UnixPkg/UnixConsoleDxe/UnixConsole.inf | 4 |
4 files changed, 64 insertions, 64 deletions
diff --git a/UnixPkg/UnixConsoleDxe/Console.h b/UnixPkg/UnixConsoleDxe/Console.h index 7a3c7da8b9..a3ab0e173e 100644 --- a/UnixPkg/UnixConsoleDxe/Console.h +++ b/UnixPkg/UnixConsoleDxe/Console.h @@ -94,7 +94,7 @@ typedef struct { UINTN RowsY;
} UNIX_SIMPLE_TEXT_OUT_MODE;
-#if 0 +#if 0
//
// Simple Text Out protocol member functions
//
@@ -319,7 +319,7 @@ Returns: --*/
;
-#endif +#endif
//
// Simple Text Out constructor and destructor.
//
@@ -365,7 +365,7 @@ Returns: --*/
;
-#if 0 +#if 0
//
// Simple Text In protocol member functions.
//
@@ -441,7 +441,7 @@ Returns: --*/
;
-#endif +#endif
//
// Simple Text In constructor
//
diff --git a/UnixPkg/UnixConsoleDxe/ConsoleIn.c b/UnixPkg/UnixConsoleDxe/ConsoleIn.c index 821ff2c805..6ab68956e9 100644 --- a/UnixPkg/UnixConsoleDxe/ConsoleIn.c +++ b/UnixPkg/UnixConsoleDxe/ConsoleIn.c @@ -27,7 +27,7 @@ Abstract: --*/
#include "Console.h"
-#include <sys/poll.h> +#include <sys/poll.h>
//
// Private worker functions
@@ -68,7 +68,7 @@ Returns: EFI_STATUS
UnixConvertInputRecordToEfiKey (
- IN char c, + IN char c,
OUT EFI_INPUT_KEY *Key
)
/*++
@@ -92,8 +92,8 @@ Returns: --*/
{
Key->ScanCode = 0;
- if (c == '\n') - c = '\r'; + if (c == '\n')
+ c = '\r';
Key->UnicodeChar = c;
return EFI_SUCCESS;
}
@@ -124,7 +124,7 @@ Returns: {
EFI_STATUS Status;
UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;
- char c; + char c;
Private = UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS (This);
@@ -133,7 +133,7 @@ Returns: return Status;
}
- if (Private->UnixThunk->Read (0, &c, 1) != 1) + if (Private->UnixThunk->Read (0, &c, 1) != 1)
return EFI_NOT_READY;
Status = UnixConvertInputRecordToEfiKey (c, Key);
@@ -193,11 +193,11 @@ Returns: --*/
{
- struct pollfd pfd; + struct pollfd pfd;
- pfd.fd = 0; - pfd.events = POLLIN; - if (Private->UnixThunk->Poll (&pfd, 1, 0) <= 0) { + pfd.fd = 0;
+ pfd.events = POLLIN;
+ if (Private->UnixThunk->Poll (&pfd, 1, 0) <= 0) {
return EFI_NOT_READY;
}
return EFI_SUCCESS;
diff --git a/UnixPkg/UnixConsoleDxe/ConsoleOut.c b/UnixPkg/UnixConsoleDxe/ConsoleOut.c index 693cf60d01..93ace4d80b 100644 --- a/UnixPkg/UnixConsoleDxe/ConsoleOut.c +++ b/UnixPkg/UnixConsoleDxe/ConsoleOut.c @@ -26,13 +26,13 @@ Abstract: // Private worker functions.
//
-#if 0 +#if 0
VOID
UnixSimpleTextOutScrollScreen (
IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console
);
-#endif +#endif
VOID
UnixSimpleTextOutPutChar (
IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console,
@@ -51,7 +51,7 @@ UnixSimpleTextOutSetMode ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN ModeNumber
);
- +
//
// Modeule Global for Simple Text Out Mode.
//
@@ -60,12 +60,12 @@ UnixSimpleTextOutSetMode ( UNIX_SIMPLE_TEXT_OUT_MODE mUnixSimpleTextOutSupportedModes[] = {
{ 80, 25 },
-#if 0 +#if 0
{ 80, 50 },
{ 80, 43 },
{ 100, 100 },
{ 100, 999 }
-#endif +#endif
};
EFI_STATUS
@@ -131,7 +131,7 @@ Returns: for (Str = String; *Str != '\0'; Str++) {
switch (*Str) {
-#if 0 +#if 0
case '\n':
if (Private->Position.Y == (Private->MaxScreenSize.Y - 1)) {
UnixSimpleTextOutScrollScreen (Private);
@@ -155,7 +155,7 @@ Returns: }
break;
-#endif +#endif
default:
UnixSimpleTextOutPutChar (Private, *Str);
}
@@ -186,11 +186,11 @@ Returns: --*/
{
- char c = Char; - Console->UnixThunk->Write (1, &c, 1); + char c = Char;
+ Console->UnixThunk->Write (1, &c, 1);
}
-#if 0 +#if 0
VOID
UnixSimpleTextOutScrollScreen (
IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console
@@ -212,8 +212,8 @@ Returns: --*/
{
}
-#endif - +#endif
+
EFI_STATUS
EFIAPI
@@ -358,9 +358,9 @@ Returns: Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);
-#if 0 +#if 0
Private->Attribute = (WORD) Attribute;
-#endif +#endif
This->Mode->Attribute = (INT32) Attribute;
return EFI_SUCCESS;
@@ -393,10 +393,10 @@ Returns: Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);
This->SetCursorPosition (This, 0, 0);
- Private->UnixThunk->Write (1, "\e[2J", 4); - + Private->UnixThunk->Write (1, "\e[2J", 4);
-#if 0 +
+#if 0
Private->UnixThunk->FillConsoleOutputCharacter (
Private->NtOutHandle,
' ',
@@ -411,7 +411,7 @@ Returns: Private->Possition,
&ConsoleWindow
);
-#endif +#endif
return EFI_SUCCESS;
}
@@ -441,36 +441,36 @@ Returns: --*/
{
- char buf[12]; + char buf[12];
UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;
Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);
-#if 0 +#if 0
Private->Position.X = (WORD) Column;
-#endif +#endif
This->Mode->CursorColumn = (INT32) Column;
-#if 0 +#if 0
Private->Position.Y = (WORD) Row;
-#endif +#endif
This->Mode->CursorRow = (INT32) Row;
-#if 0 +#if 0
Private->UnixThunk->SetConsoleCursorPosition (Private->NtOutHandle, Private->Possition);
-#endif -
- buf[0] = '\e'; - buf[1] = '['; - buf[2] = '0' + ((Row / 100) % 10); - buf[3] = '0' + ((Row / 10) % 10); - buf[4] = '0' + ((Row / 1) % 10); - buf[5] = ';'; - buf[6] = '0' + ((Column / 100) % 10); - buf[7] = '0' + ((Column / 10) % 10); - buf[8] = '0' + ((Column / 1) % 10); - buf[9] = 'H'; - Private->UnixThunk->Write (1, buf, 10); - +#endif
+
+ buf[0] = '\e';
+ buf[1] = '[';
+ buf[2] = '0' + ((Row / 100) % 10);
+ buf[3] = '0' + ((Row / 10) % 10);
+ buf[4] = '0' + ((Row / 1) % 10);
+ buf[5] = ';';
+ buf[6] = '0' + ((Column / 100) % 10);
+ buf[7] = '0' + ((Column / 10) % 10);
+ buf[8] = '0' + ((Column / 1) % 10);
+ buf[9] = 'H';
+ Private->UnixThunk->Write (1, buf, 10);
+
return EFI_SUCCESS;
}
@@ -498,19 +498,19 @@ Returns: --*/
{
UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;
-#if 0 +#if 0
CONSOLE_CURSOR_INFO Info;
-#endif +#endif
Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);
Private->CursorEnable = Enable;
This->Mode->CursorVisible = Enable;
-#if 0 +#if 0
Private->UnixThunk->GetConsoleCursorInfo (Private->NtOutHandle, &Info);
Info.bVisible = Enable;
Private->UnixThunk->SetConsoleCursorInfo (Private->NtOutHandle, &Info);
-#endif +#endif
return EFI_SUCCESS;
}
@@ -539,13 +539,13 @@ Returns: CHAR16 *WindowName;
//WindowName = Private->UnixIo->EnvString;
-#if 0 +#if 0
Private->Attribute = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
if (*WindowName == '?') {
Private->Attribute = BACKGROUND_RED | FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
WindowName = L"EFI Emulator Error Console";
}
-#endif +#endif
WindowName = L"EFI Emulator Error Console";
AddUnicodeString (
@@ -576,7 +576,7 @@ Returns: SimpleTextOut->Mode->MaxMode = MAX_SIMPLE_TEXT_OUT_MODE;
SimpleTextOut->Mode->Attribute = 0; //FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
-#if 0 +#if 0
//
// Open the window an initialize it!
//
@@ -588,7 +588,7 @@ Returns: NULL
);
Private->UnixThunk->SetConsoleTitle (WindowName);
-#endif +#endif
return SimpleTextOut->SetMode (SimpleTextOut, 0);
}
@@ -613,8 +613,8 @@ Returns: --*/
{
-#if 0 +#if 0
Console->UnixThunk->CloseHandle (Console->NtOutHandle);
-#endif +#endif
return EFI_SUCCESS;
}
diff --git a/UnixPkg/UnixConsoleDxe/UnixConsole.inf b/UnixPkg/UnixConsoleDxe/UnixConsole.inf index 636a6cb880..6a9748a323 100644 --- a/UnixPkg/UnixConsoleDxe/UnixConsole.inf +++ b/UnixPkg/UnixConsoleDxe/UnixConsole.inf @@ -62,6 +62,6 @@ gEfiSimpleTextInProtocolGuid # PROTOCOL BY_START
gEfiSimpleTextOutProtocolGuid # PROTOCOL BY_START
gEfiUnixIoProtocolGuid # PROTOCOL TO_START
- -[Guids] +
+[Guids]
gEfiUnixConsoleGuid
|