From 9c3755363be8b7ba7ff2828b073a0821e3402d28 Mon Sep 17 00:00:00 2001 From: hsc Date: Tue, 6 Nov 2012 18:29:45 +0000 Subject: [PATCH] bochs bugfix: store the timer ID for correct deregistration Over a few indirections, this broke Bochs' 16550 UART simulation after transferring a few hundreds of bytes. The UART uses internal timers to simulate the configured baud rate; these timers cease to work after repeated misuse from the Fail/Bochs bridge. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1887 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- src/core/sal/bochs/BochsListener.ah | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/sal/bochs/BochsListener.ah b/src/core/sal/bochs/BochsListener.ah index e68a8d35..80eef732 100644 --- a/src/core/sal/bochs/BochsListener.ah +++ b/src/core/sal/bochs/BochsListener.ah @@ -21,10 +21,12 @@ aspect BochsListener { bool onAddition() { // Register the timer listener in the Bochs simulator: - if(m_registerTimer(this) == -1) { + timer_id_t id = m_registerTimer(this); + if (id == -1) { setId(INVALID_TIMER); return false; // unable to register the timer (error in Bochs' function call) } + setId(id); return true; } void onDeletion()