Guest User

Untitled

a guest
Jul 4th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. From d75df61eefa8f59e7f40c4c9a3e02e9a7d9cf130 Mon Sep 17 00:00:00 2001
  2. From: Arne Hasselbring <[email protected]>
  3. Date: Wed, 4 Jul 2012 19:25:23 +0200
  4. Subject: [PATCH] =?UTF-8?q?kbc:=20m=C3=B6gliche=20Endlosschleife=20gefixt?=
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8.  
  9. ! Wenn in send_kbc_command kein 0xfa (ACK), sondern 0xfe (Resend) zurück-
  10. kommt, hätte es eine Endlosschleife gegeben.
  11.  
  12. Signed-off-by: Arne Hasselbring <[email protected]>
  13. ---
  14. src/modules/kbc/keyboard.c | 11 ++++++-----
  15. 1 Datei geändert, 6 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)
  16.  
  17. diff --git a/src/modules/kbc/keyboard.c b/src/modules/kbc/keyboard.c
  18. index bfacf01..4fdaadc 100644
  19. --- a/src/modules/kbc/keyboard.c
  20. +++ b/src/modules/kbc/keyboard.c
  21. @@ -85,11 +85,12 @@ static void send_key_event(uint8_t keycode, bool release);
  22. */
  23. static void send_kbd_command(uint8_t command)
  24. {
  25. - while (inb(0x64) & 0x2) {
  26. - yield();
  27. - }
  28. - outb(0x60, command);
  29. - while (inb(0x60) != 0xfa);
  30. + do {
  31. + while (inb(0x64) & 0x2) {
  32. + yield();
  33. + }
  34. + outb(0x60, command);
  35. + } while (inb(0x60) == 0xfe);
  36. }
  37.  
  38.  
  39. --
  40. 1.7.11.1
Advertisement
Add Comment
Please, Sign In to add comment