- case SCANCODE_ALT_MAKE:\r
- ConsoleIn->Alted = TRUE;\r
- break;\r
-\r
- case SCANCODE_ALT_BREAK:\r
- ConsoleIn->Alted = FALSE;\r
- break;\r
- }\r
- //\r
- // if Alt+Ctrl+Del, Reboot the System\r
- //\r
- if (ConsoleIn->Ctrled && ConsoleIn->Alted && Data == 0x53) {\r
- gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
- }\r
- }\r
- //\r
- // Leave critical section and return\r
- //\r
- gBS->RestoreTPL (OldTpl);\r
-\r
- return ;\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-GetScancodeBufHead (\r
- KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r
- IN UINT32 Count,\r
- OUT UINT8 *Buf\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Read several bytes from the scancode buffer without removing them.\r
- This function is called to see if there are enough bytes of scancode\r
- representing a single key.\r
-\r
-Arguments:\r
-\r
- Count - Number of bytes to be read\r
- Buf - Store the results\r
-\r
-Returns:\r
-\r
- EFI_STATUS\r
-\r
---*/\r
-// GC_TODO: ConsoleIn - add argument and description to function comment\r
-// GC_TODO: EFI_NOT_READY - add return value to function comment\r
-// GC_TODO: EFI_SUCCESS - add return value to function comment\r
-{\r
- UINT32 Index;\r
- UINT32 Pos;\r
-\r
- Index = 0;\r
- Pos = 0;\r
-\r
- //\r
- // check the valid range of parameter 'Count'\r
- //\r
- if (Count <= 0 || ConsoleIn->ScancodeBufCount < Count) {\r
- return EFI_NOT_READY;\r
- }\r
- //\r
- // retrieve the values\r
- //\r
- for (Index = 0; Index < Count; Index++) {\r
-\r
- if (Index == 0) {\r
-\r
- Pos = ConsoleIn->ScancodeBufStartPos;\r
- } else {\r
-\r
- Pos = Pos + 1;\r
- if (Pos >= KEYBOARD_BUFFER_MAX_COUNT) {\r
- Pos = 0;\r
- }\r
- }\r
-\r
- Buf[Index] = ConsoleIn->ScancodeBuf[Pos];\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-PopScancodeBufHead (\r
- KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r
- IN UINT32 Count,\r
- OUT UINT8 *Buf\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Read & remove several bytes from the scancode buffer.\r
- This function is usually called after GetScancodeBufHead()\r
-\r
-Arguments:\r
-\r
- Count - Number of bytes to be read\r
- Buf - Store the results\r
-\r
-Returns:\r
-\r
- EFI_STATUS\r
-\r
---*/\r
-// GC_TODO: ConsoleIn - add argument and description to function comment\r
-// GC_TODO: EFI_NOT_READY - add return value to function comment\r
-// GC_TODO: EFI_SUCCESS - add return value to function comment\r
-{\r
- UINT32 Index;\r
-\r
- Index = 0;\r
-\r
- //\r
- // Check the valid range of parameter 'Count'\r
- //\r
- if (Count <= 0 || ConsoleIn->ScancodeBufCount < Count) {\r
- return EFI_NOT_READY;\r
- }\r
- //\r
- // Retrieve and remove the values\r
- //\r
- for (Index = 0; Index < Count; Index++) {\r
-\r
- if (Index != 0) {\r
-\r
- ConsoleIn->ScancodeBufStartPos++;\r
- if (ConsoleIn->ScancodeBufStartPos >= KEYBOARD_BUFFER_MAX_COUNT) {\r
- ConsoleIn->ScancodeBufStartPos = 0;\r
- }\r
- }\r
-\r
- Buf[Index] = ConsoleIn->ScancodeBuf[ConsoleIn->ScancodeBufStartPos];\r
- ConsoleIn->ScancodeBufCount--;\r
- }\r
-\r
- ConsoleIn->ScancodeBufStartPos++;\r
- if (ConsoleIn->ScancodeBufStartPos >= KEYBOARD_BUFFER_MAX_COUNT) {\r
- ConsoleIn->ScancodeBufStartPos = 0;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-KeyboardRead (\r
- IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r
- OUT UINT8 *Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- ConsoleIn - GC_TODO: add argument description\r
- Data - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_TIMEOUT - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- UINT32 TimeOut;\r
- UINT32 RegFilled;\r