mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
parent
97b1a22a8a
commit
3f269b773d
@ -60,7 +60,7 @@ Net::Session_component::Session_component(Allocator &alloc,
|
||||
size_t const rx_buf_size,
|
||||
Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Duration &curr_time,
|
||||
Env &env)
|
||||
:
|
||||
Session_component_base(alloc, amount, env.ram(), tx_buf_size, rx_buf_size),
|
||||
@ -109,7 +109,7 @@ Net::Root::Root(Env &env,
|
||||
Allocator &alloc,
|
||||
Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time)
|
||||
Duration &curr_time)
|
||||
:
|
||||
Root_component<Session_component, Genode::Single_client>(&env.ep().rpc_ep(),
|
||||
&alloc),
|
||||
|
@ -96,7 +96,7 @@ class Net::Session_component : public Session_component_base,
|
||||
Genode::size_t const rx_buf_size,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Genode::Duration &curr_time,
|
||||
Genode::Env &env);
|
||||
|
||||
|
||||
@ -106,7 +106,8 @@ class Net::Session_component : public Session_component_base,
|
||||
|
||||
Mac_address mac_address() { return _uplink.mac_address(); }
|
||||
bool link_state() { return _uplink.link_state(); }
|
||||
void link_state_sigh(Genode::Signal_context_capability sigh) { _link_state_sigh = sigh; }
|
||||
void link_state_sigh(Genode::Signal_context_capability sigh) {
|
||||
_link_state_sigh = sigh; }
|
||||
};
|
||||
|
||||
|
||||
@ -116,9 +117,9 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||
private:
|
||||
|
||||
Genode::Env &_env;
|
||||
Genode::Xml_node _config;
|
||||
Genode::Xml_node _config;
|
||||
Timer::Connection &_timer;
|
||||
unsigned &_curr_time;
|
||||
Genode::Duration &_curr_time;
|
||||
|
||||
|
||||
/********************
|
||||
@ -133,7 +134,7 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||
Genode::Allocator &alloc,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time);
|
||||
Genode::Duration &curr_time);
|
||||
};
|
||||
|
||||
#endif /* _COMPONENT_H_ */
|
||||
|
@ -29,10 +29,14 @@ void Interface::_handle_eth(void *const eth_base,
|
||||
Ethernet_frame ð = *new (eth_base) Ethernet_frame(eth_size);
|
||||
Interface &remote = _remote.deref();
|
||||
if (_log_time) {
|
||||
unsigned new_time = _timer.curr_time().trunc_to_plain_us().value / 1000;
|
||||
Genode::Duration const new_time = _timer.curr_time();
|
||||
unsigned long const new_time_ms = new_time.trunc_to_plain_us().value / 1000;
|
||||
unsigned long const old_time_ms = _curr_time.trunc_to_plain_us().value / 1000;
|
||||
|
||||
log("\033[33m(", remote._label, " <- ", _label, ")\033[0m ", eth,
|
||||
" \033[33mtime ", new_time, " (", new_time - _curr_time,
|
||||
")\033[0m");
|
||||
" \033[33mtime ", new_time_ms, " ms (Δ ",
|
||||
new_time_ms - old_time_ms, " ms)\033[0m");
|
||||
|
||||
_curr_time = new_time;
|
||||
} else {
|
||||
log("\033[33m(", remote._label, " <- ", _label, ")\033[0m ", eth);
|
||||
@ -89,7 +93,7 @@ void Interface::_ready_to_ack()
|
||||
Interface::Interface(Entrypoint &ep,
|
||||
Interface_label label,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Duration &curr_time,
|
||||
bool log_time,
|
||||
Allocator &alloc)
|
||||
:
|
||||
|
@ -50,7 +50,7 @@ class Net::Interface
|
||||
Pointer<Interface> _remote;
|
||||
Interface_label _label;
|
||||
Timer::Connection &_timer;
|
||||
unsigned &_curr_time;
|
||||
Genode::Duration &_curr_time;
|
||||
bool _log_time;
|
||||
|
||||
void _send(Ethernet_frame ð, Genode::size_t const eth_size);
|
||||
@ -78,7 +78,7 @@ class Net::Interface
|
||||
Interface(Genode::Entrypoint &ep,
|
||||
Interface_label label,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Genode::Duration &curr_time,
|
||||
bool log_time,
|
||||
Genode::Allocator &alloc);
|
||||
|
||||
|
@ -28,11 +28,11 @@ class Main
|
||||
{
|
||||
private:
|
||||
|
||||
Genode::Attached_rom_dataspace _config;
|
||||
Timer::Connection _timer;
|
||||
unsigned _curr_time { 0 };
|
||||
Genode::Heap _heap;
|
||||
Net::Root _root;
|
||||
Attached_rom_dataspace _config;
|
||||
Timer::Connection _timer;
|
||||
Duration _curr_time { Microseconds(0UL) };
|
||||
Heap _heap;
|
||||
Net::Root _root;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -25,7 +25,7 @@ using namespace Genode;
|
||||
Net::Uplink::Uplink(Env &env,
|
||||
Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Duration &curr_time,
|
||||
Allocator &alloc)
|
||||
:
|
||||
Nic::Packet_allocator(&alloc),
|
||||
|
@ -47,7 +47,7 @@ class Net::Uplink : public Nic::Packet_allocator,
|
||||
Uplink(Genode::Env &env,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Genode::Duration &curr_time,
|
||||
Genode::Allocator &alloc);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user