From c607395208f6b82aedd99bd3df3f391532e5b258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 29 Feb 2008 16:25:35 +0000 Subject: [PATCH] Accidently read one response less than needed since reworking it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24181 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/drivers/audio/hda/hda_controller.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp index 07f3a16899..e6f451aa9c 100644 --- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp +++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp @@ -37,10 +37,10 @@ static const struct { }; -static inline rirb_t* +static inline rirb_t& current_rirb(hda_controller *controller) { - return &controller->rirb[controller->rirb_read_pos]; + return controller->rirb[controller->rirb_read_pos]; } @@ -401,11 +401,13 @@ hda_interrupt_handler(hda_controller* controller) REG8(controller, RIRBSTS) = rirbStatus; if (rirbStatus & RIRBSTS_RINTFL) { - uint16 writePos = REG16(controller, RIRBWP); + uint16 writePos = (REG16(controller, RIRBWP) + 1) + % controller->rirb_length; + for (; controller->rirb_read_pos != writePos; controller->rirb_read_pos = next_rirb(controller)) { - uint32 response = current_rirb(controller)->response; - uint32 responseFlags = current_rirb(controller)->flags; + uint32 response = current_rirb(controller).response; + uint32 responseFlags = current_rirb(controller).flags; uint32 cad = responseFlags & RESPONSE_FLAGS_CODEC_MASK; hda_codec* codec = controller->codecs[cad];