diff options
Diffstat (limited to 'MdePkg/Library/BasePostCodeLibPort80/PostCode.c')
-rw-r--r-- | MdePkg/Library/BasePostCodeLibPort80/PostCode.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c index 925c7404bc..f1fdbabce4 100644 --- a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c +++ b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c @@ -1,7 +1,7 @@ /** @file
Post Code Library instance that writes post code values to I/O port 0x80.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
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
@@ -17,6 +17,7 @@ #include <Library/PostCodeLib.h>
#include <Library/PcdLib.h>
#include <Library/IoLib.h>
+#include <Library/DebugLib.h>
/**
Sends an 32-bit value to a POST card.
@@ -42,7 +43,24 @@ PostCode ( IN UINT32 Value
)
{
- IoWrite8 (0x80, (UINT8)(Value));
+ switch (PcdGet8 (PcdPort80DataWidth)) {
+ case 8:
+ IoWrite8 (0x80, (UINT8)(Value));
+ break;
+ case 16:
+ IoWrite16 (0x80, (UINT16)(Value));
+ break;
+ case 32:
+ IoWrite32 (0x80, Value);
+ break;
+ default:
+ //
+ // Assert on the invalid data width
+ //
+ ASSERT (FALSE);
+ break;
+ }
+
return Value;
}
@@ -78,7 +96,7 @@ PostCodeWithDescription ( IN CONST CHAR8 *Description OPTIONAL
)
{
- IoWrite8 (0x80, (UINT8)(Value));
+ PostCode (Value);
return Value;
}
|