mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 19:20:09 +00:00
parent
6d653b3c0f
commit
7d1fd0b0a3
@ -20,7 +20,7 @@
|
|||||||
namespace Lwip {
|
namespace Lwip {
|
||||||
void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer);
|
void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer);
|
||||||
|
|
||||||
Genode::Lock &lock();
|
Genode::Mutex &mutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -141,7 +141,7 @@ class Lwip::Nic_netif
|
|||||||
|
|
||||||
void handle_rx_packets()
|
void handle_rx_packets()
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g { Lwip::lock() };
|
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||||
auto &rx = *_nic.rx();
|
auto &rx = *_nic.rx();
|
||||||
|
|
||||||
while (rx.packet_avail() && rx.ready_to_ack()) {
|
while (rx.packet_avail() && rx.ready_to_ack()) {
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/snprintf.h>
|
#include <base/snprintf.h>
|
||||||
#include <base/lock.h>
|
|
||||||
#include <base/env.h>
|
#include <base/env.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -38,7 +38,7 @@ namespace Lwip {
|
|||||||
{
|
{
|
||||||
void check_timeouts(Genode::Duration)
|
void check_timeouts(Genode::Duration)
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g{ Lwip::lock() };
|
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||||
sys_check_timeouts();
|
sys_check_timeouts();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,10 +66,10 @@ namespace Lwip {
|
|||||||
lwip_init();
|
lwip_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Genode::Lock &lock()
|
Genode::Mutex &mutex()
|
||||||
{
|
{
|
||||||
static Genode::Lock _lwip_lock;
|
static Genode::Mutex _lwip_mutex;
|
||||||
return _lwip_lock;
|
return _lwip_mutex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,7 +902,7 @@ class Lwip::Udp_socket_dir final :
|
|||||||
char *dst, file_size count,
|
char *dst, file_size count,
|
||||||
file_size &out_count) override
|
file_size &out_count) override
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g { Lwip::lock() };
|
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||||
Read_result result = Read_result::READ_ERR_INVALID;
|
Read_result result = Read_result::READ_ERR_INVALID;
|
||||||
|
|
||||||
switch(handle.kind) {
|
switch(handle.kind) {
|
||||||
@ -988,7 +988,7 @@ class Lwip::Udp_socket_dir final :
|
|||||||
char const *src, file_size count,
|
char const *src, file_size count,
|
||||||
file_size &out_count) override
|
file_size &out_count) override
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g { Lwip::lock() };
|
Genode::Mutex::Guard g { Lwip::mutex() };
|
||||||
|
|
||||||
switch(handle.kind) {
|
switch(handle.kind) {
|
||||||
|
|
||||||
@ -1291,7 +1291,7 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
char *dst, file_size count,
|
char *dst, file_size count,
|
||||||
file_size &out_count) override
|
file_size &out_count) override
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g { Lwip::lock() };
|
Genode::Mutex::Guard g { Lwip::mutex() };
|
||||||
|
|
||||||
switch(handle.kind) {
|
switch(handle.kind) {
|
||||||
|
|
||||||
@ -1377,9 +1377,9 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
|
|
||||||
handle.kind = Lwip_file_handle::LOCATION;
|
handle.kind = Lwip_file_handle::LOCATION;
|
||||||
/* read the location of the new socket directory */
|
/* read the location of the new socket directory */
|
||||||
Lwip::lock().unlock();
|
Lwip::mutex().release();
|
||||||
Read_result result = handle.read(dst, count, out_count);
|
Read_result result = handle.read(dst, count, out_count);
|
||||||
Lwip::lock().lock();
|
Lwip::mutex().acquire();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1443,7 +1443,7 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
char const *src, file_size count,
|
char const *src, file_size count,
|
||||||
file_size &out_count) override
|
file_size &out_count) override
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard g { Lwip::lock() };
|
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||||
if (_pcb == NULL) {
|
if (_pcb == NULL) {
|
||||||
/* socket is closed */
|
/* socket is closed */
|
||||||
return Write_result::WRITE_ERR_IO;
|
return Write_result::WRITE_ERR_IO;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user