mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTVDM]
Don't calculate NextElement twice. Properly initialize the keyboard buffer head and tail. svn path=/trunk/; revision=63302
This commit is contained in:
parent
3ed2e2a095
commit
5f6ac9ac39
1 changed files with 2 additions and 9 deletions
|
@ -39,14 +39,7 @@ static BOOLEAN BiosKbdBufferPush(WORD Data)
|
|||
|
||||
/* Put the value in the queue */
|
||||
*((LPWORD)((ULONG_PTR)Bda + Bda->KeybdBufferTail)) = Data;
|
||||
Bda->KeybdBufferTail += sizeof(WORD);
|
||||
|
||||
/* Check if we are at, or have passed, the end of the buffer */
|
||||
if (Bda->KeybdBufferTail >= Bda->KeybdBufferEnd)
|
||||
{
|
||||
/* Return it to the beginning */
|
||||
Bda->KeybdBufferTail = Bda->KeybdBufferStart;
|
||||
}
|
||||
Bda->KeybdBufferTail = NextElement;
|
||||
|
||||
/* Return success */
|
||||
return TRUE;
|
||||
|
@ -271,7 +264,7 @@ BOOLEAN KbdBios32Initialize(VOID)
|
|||
/* Initialize the BDA */
|
||||
Bda->KeybdBufferStart = FIELD_OFFSET(BIOS_DATA_AREA, KeybdBuffer);
|
||||
Bda->KeybdBufferEnd = Bda->KeybdBufferStart + BIOS_KBD_BUFFER_SIZE * sizeof(WORD);
|
||||
Bda->KeybdBufferHead = Bda->KeybdBufferTail = 0;
|
||||
Bda->KeybdBufferHead = Bda->KeybdBufferTail = Bda->KeybdBufferStart;
|
||||
|
||||
// FIXME: Fill the keyboard buffer with invalid values, for diagnostic purposes...
|
||||
RtlFillMemory(((LPVOID)((ULONG_PTR)Bda + Bda->KeybdBufferStart)), BIOS_KBD_BUFFER_SIZE * sizeof(WORD), 'A');
|
||||
|
|
Loading…
Reference in a new issue