- UINTN Divisor;\r
- UINT8 OutputData;\r
- UINT8 Data;\r
-\r
- //\r
- // Some init is done by the platform status code initialization.\r
- //\r
- \r
- //\r
- // Map 5..8 to 0..3\r
- //\r
- Data = (UINT8) (gData - (UINT8)5);\r
-\r
- //\r
- // Calculate divisor for baud generator\r
- //\r
- Divisor = 115200 / gBps; \r
- \r
- //\r
- // Set communications format\r
- //\r
- OutputData = (UINT8)((DLAB << 7) | ((gBreakSet << 6) | ((gParity << 3) | ((gStop << 2) | Data))));\r
- IoWrite8 (gComBase + LCR_OFFSET, OutputData);\r
-\r
- //\r
- // Configure baud rate\r
- //\r
- IoWrite8 (gComBase + BAUD_HIGH_OFFSET, (UINT8)(Divisor >> 8));\r
- IoWrite8 (gComBase + BAUD_LOW_OFFSET, (UINT8)(Divisor & 0xff));\r
-\r
- //\r
- // Switch back to bank 0\r
- //\r
- OutputData = (UINT8)((~DLAB<<7)|((gBreakSet<<6)|((gParity<<3)|((gStop<<2)| Data))));\r
- IoWrite8 (gComBase + LCR_OFFSET, OutputData);\r
-\r