LWIP: Fix dead lock in semaphore back-end

Make sure unlock is called when 'global_mutex' reaches zero count. Add verbose
variable in order to disable some output. Disable irritating 'Overflow' messages
in 'sys_mbox_post' and 'sys_mbox_try_post' per default. This may happen and is
not an error, since the ring buffer is full and will be emptied eventually.
Remove priority from genode_org run script.

Should fix #347
This commit is contained in:
Sebastian Sumpf 2012-09-26 14:01:39 +02:00 committed by Norman Feske
parent 1497d5e48f
commit ad70160847
4 changed files with 34 additions and 6 deletions

View File

@ -0,0 +1,22 @@
/*
* \brief Enable debugging output
* \author Sebastian Sumpf
* \date 2012-09-26
*/
/*
* Copyright (C) 2009-2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _LWIP__VERBOSE_H_
#define _LWIP__VERBOSE_H_
/**
* Set to one for more output
*/
static int verbose = 0;
#endif //_LWIP__VERBOSE_H_

View File

@ -23,6 +23,7 @@ extern "C" {
#include <netif/etharp.h>
#include <netif/ppp_oe.h>
#include <nic.h>
#include <verbose.h>
}
/* Genode includes */
@ -217,7 +218,8 @@ extern "C" {
if (p == NULL) return;
if (netif->input(p, netif) != ERR_OK) {
PERR("genode_netif_input: input error");
if (verbose)
PERR("genode_netif_input: input error");
pbuf_free(p);
p = 0;
}

View File

@ -23,6 +23,7 @@
#include <timer.h>
#include <ring_buffer.h>
#include <thread.h>
#include <verbose.h>
namespace Lwip {
@ -352,12 +353,13 @@ extern "C" {
{
if(global_mutex()->thread != Genode::Thread_base::myself())
return;
if(global_mutex()->counter > 0)
if(global_mutex()->counter > 1)
global_mutex()->counter--;
else {
global_mutex()->counter = 0;
global_mutex()->thread = 0;
global_mutex()->lock.unlock();
}
}
}
@ -456,7 +458,8 @@ extern "C" {
_mbox->add(msg);
return;
} catch (Mailbox::Overflow) {
PWRN("Overflow exception!");
if (verbose)
PWRN("Overflow exception!");
} catch (...) {
PERR("Unknown Exception occured!");
}
@ -481,7 +484,8 @@ extern "C" {
_mbox->add(msg);
return ERR_OK;
} catch (Mailbox::Overflow) {
PWRN("Overflow exception!");
if (verbose)
PWRN("Overflow exception!");
} catch (...) {
PERR("Unknown Exception occured!");
}

View File

@ -54,7 +54,7 @@ append_if [have_spec pci] config {
</start>}
append_if [have_spec omap4] config {
<start name="usb_drv" priority="-1">
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides>
<service name="Input"/>