2
0
Fork 0

solo5: 0.6.5 -> 0.6.6

i686
Emery Hemingway 2 years ago
parent 2d16e134aa
commit f54b0c7d51
  1. 6
      packages/solo5/default.nix
  2. 60
      packages/solo5/time.patch

@ -4,7 +4,7 @@
# WARNING: recursive make ahead
let version = "0.6.5";
let version = "0.6.6";
in stdenv.mkDerivation {
pname = "solo5";
inherit version;
@ -15,12 +15,12 @@ in stdenv.mkDerivation {
src = fetchurl {
url =
"https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
sha256 = "sha256-noKINkyP8yCmQFGC3TKWfZ2r4SDJKSsd2+BXbGj2FSA=";
hash = "sha256-WBqjuYb7IObHeuoCvBSGQa9swN+Y8pHxcQbiB7k1CeI=";
};
enableParallelBuilding = true;
patches = [ ./genode.patch ./elftool.patch ./time.patch ];
patches = [ ./genode.patch ./elftool.patch ];
configurePhase = with stdenv; ''
runHook preConfigure

@ -1,60 +0,0 @@
commit a7902e24ba8fd2c6cfd56f68952f8d5417b9a303
Author: Emery Hemingway <ehmry@posteo.net>
Date: Sat May 16 02:07:54 2020 +0530
Genode: do not yield for expired deadlines
diff --git a/bindings/genode/bindings.cc b/bindings/genode/bindings.cc
index 5785ae5..a4a4a34 100644
--- a/bindings/genode/bindings.cc
+++ b/bindings/genode/bindings.cc
@@ -104,6 +104,12 @@ namespace Solo5
return epoch;
}
+
+ static Microseconds from_ns(solo5_time_t ns) {
+ return Microseconds { ns / 1000ULL }; }
+
+ static solo5_time_t to_ns(Microseconds us) {
+ return us.value * 1000ULL; }
}
@@ -431,20 +437,19 @@ struct Solo5::Platform
_initial_epoch = rtc_epoch(env);
return _initial_epoch * 1000000000ULL
- + timer.curr_time().trunc_to_plain_us().value * 1000ULL;
+ + to_ns(timer.curr_time().trunc_to_plain_us());
}
void
yield(solo5_time_t deadline_ns, solo5_handle_set_t *ready_set)
{
if (!nic_ready) {
- solo5_time_t deadline_us = deadline_ns / 1000;
- solo5_time_t now_us = timer.curr_time()
- .trunc_to_plain_us().value;
+ Microseconds deadline = from_ns(deadline_ns);
+ Microseconds now = timer.curr_time().trunc_to_plain_us();
+ if (deadline.value <= now.value) return;
// schedule a timeout signal
- yield_timeout.schedule(
- Genode::Microseconds{deadline_us - now_us});
+ yield_timeout.schedule(Microseconds {deadline.value - now.value});
/*
* Block for Nic and Timer signals until a packet is
@@ -531,8 +536,8 @@ void solo5_abort(void)
solo5_time_t solo5_clock_monotonic(void)
{
- return Platform::instance->timer.curr_time()
- .trunc_to_plain_us().value*1000;
+ return Solo5::to_ns(Platform::instance->
+ timer.curr_time().trunc_to_plain_us());
}
Loading…
Cancel
Save