From f54b0c7d517721265bc9fcf1b910fab79f17c9f1 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 23 Jul 2020 11:49:31 +0200 Subject: [PATCH] solo5: 0.6.5 -> 0.6.6 --- packages/solo5/default.nix | 6 ++-- packages/solo5/time.patch | 60 -------------------------------------- 2 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 packages/solo5/time.patch diff --git a/packages/solo5/default.nix b/packages/solo5/default.nix index 666db48..a81dd39 100644 --- a/packages/solo5/default.nix +++ b/packages/solo5/default.nix @@ -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 diff --git a/packages/solo5/time.patch b/packages/solo5/time.patch deleted file mode 100644 index ab0da2e..0000000 --- a/packages/solo5/time.patch +++ /dev/null @@ -1,60 +0,0 @@ -commit a7902e24ba8fd2c6cfd56f68952f8d5417b9a303 -Author: Emery Hemingway -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()); - } - -