summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-23 02:11:31 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-23 02:11:31 +0000
commit9875a3e33e65041577fdbf57da9fb31f93e9e1b8 (patch)
treea0cc438feaa83b3847265ef56962412852a871a3 /MdeModulePkg
parentb1aab293ea13a4be62da9d6c1e3d69c084240341 (diff)
downloadedk2-platforms-9875a3e33e65041577fdbf57da9fb31f93e9e1b8.tar.xz
MdeModulePkg Terminal: Add text mode for PcdConOutColumn/Row
Add a new text mode with a resolution of PcdConOutColumn x PcdConOutRow. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11416 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c2
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h6
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c16
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf4
4 files changed, 24 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 04c79aff5a..313092c2c9 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -724,7 +724,7 @@ TerminalDriverBindingStart (
);
SimpleTextOutput->Mode = &TerminalDevice->SimpleTextOutputMode;
- TerminalDevice->SimpleTextOutputMode.MaxMode = 3;
+ TerminalDevice->SimpleTextOutputMode.MaxMode = TERMINAL_MAX_MODE;
//
// For terminal devices, cursor is always visible
//
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 8a6e997916..34c1c02f3d 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -143,6 +143,12 @@ typedef union {
#define MODE2_COLUMN_COUNT 100
#define MODE2_ROW_COUNT 31
+//
+// MODE3 is defined by PcdConOutColumn & PcdConOutRow
+//
+
+#define TERMINAL_MAX_MODE 4
+
#define BACKSPACE 8
#define ESC 27
#define CSI 0x9B
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index 2f1762f037..8f2675228f 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -205,7 +205,7 @@ TerminalConOutOutputString (
//
Mode = This->Mode;
- if (Mode->Mode > 2) {
+ if (Mode->Mode >= TERMINAL_MAX_MODE) {
return EFI_UNSUPPORTED;
}
@@ -414,7 +414,7 @@ TerminalConOutQueryMode (
OUT UINTN *Rows
)
{
- if (This->Mode->MaxMode > 3) {
+ if (This->Mode->MaxMode > TERMINAL_MAX_MODE) {
return EFI_DEVICE_ERROR;
}
@@ -430,6 +430,16 @@ TerminalConOutQueryMode (
*Columns = MODE2_COLUMN_COUNT;
*Rows = MODE2_ROW_COUNT;
return EFI_SUCCESS;
+ } else if (ModeNumber == 3) {
+ *Columns = (UINTN) PcdGet32 (PcdConOutColumn);
+ if (*Columns == 0) {
+ *Columns = MODE0_COLUMN_COUNT;
+ }
+ *Rows = (UINTN) PcdGet32 (PcdConOutRow);
+ if (*Rows == 0) {
+ *Rows = MODE0_ROW_COUNT;
+ }
+ return EFI_SUCCESS;
}
return EFI_UNSUPPORTED;
@@ -466,7 +476,7 @@ TerminalConOutSetMode (
//
TerminalDevice = TERMINAL_CON_OUT_DEV_FROM_THIS (This);
- if (ModeNumber > 2) {
+ if (ModeNumber >= TERMINAL_MAX_MODE) {
return EFI_UNSUPPORTED;
}
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
index a20ade2a31..7d67eba81a 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
@@ -44,6 +44,7 @@
[Packages]
MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
DevicePathLib
@@ -74,6 +75,8 @@
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType
+ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
+ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
# [Event]
# ##
@@ -82,3 +85,4 @@
# EVENT_TYPE_RELATIVE_TIMER ## PRODUCES
#
#
+