goto error_handler;\r
}\r
\r
+ // The SPCR InterfaceType uses the same encoding as that of the\r
+ // DBG2 table Port Subtype field. However InterfaceType is 8-bit\r
+ // while the Port Subtype field in the DBG2 table is 16-bit.\r
+ if ((SerialPortInfo->PortSubtype & 0xFF00) != 0) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "ERROR: SPCR: Invalid Port Sybtype (must be < 256). Status = %r\n",\r
+ Status\r
+ ));\r
+ goto error_handler;\r
+ }\r
+\r
// Update the serial port subtype\r
- AcpiSpcr.InterfaceType = SerialPortInfo->PortSubtype;\r
+ AcpiSpcr.InterfaceType = (UINT8)SerialPortInfo->PortSubtype;\r
\r
// Update the base address\r
AcpiSpcr.BaseAddress.Address = SerialPortInfo->BaseAddress;\r