From a529fffb7b312bf82291fdef5c28c2917d9bb924 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 8 Feb 2024 08:14:57 +0100 Subject: [PATCH] Update jitterentropy to version 3.4.1 Fixes #5112 --- .../lib/import/import-jitterentropy.mk | 2 - repos/libports/lib/mk/jitterentropy.inc | 12 +-- .../lib/mk/spec/arm_v6/jitterentropy.mk | 2 - .../lib/mk/spec/arm_v7/jitterentropy.mk | 2 - .../lib/mk/spec/arm_v8/jitterentropy.mk | 2 - .../lib/mk/spec/x86_32/jitterentropy.mk | 2 - .../lib/mk/spec/x86_64/jitterentropy.mk | 2 - repos/libports/ports/jitterentropy.hash | 2 +- repos/libports/ports/jitterentropy.port | 31 ++----- .../recipes/api/jitterentropy/content.mk | 2 +- .../jitterentropy-base-genode.cc | 11 ++- .../jitterentropy/jitterentropy-base-genode.h | 40 ++------- .../jitterentropy/jitterentropy-base-user.h | 74 +++++++++++++++++ .../src/lib/jitterentropy/jitterentropy.patch | 81 +++++++++++++++++++ .../jitterentropy_delta_compare.patch | 13 --- .../lib/jitterentropy/jitterentropy_h.patch | 31 ------- .../jitterentropy/jitterentropy_memcpy.patch | 13 --- .../arm_v6/jitterentropy-base-genode-nstime.h | 2 +- .../arm_v7/jitterentropy-base-genode-nstime.h | 2 +- .../arm_v8/jitterentropy-base-genode-nstime.h | 2 +- .../x86_32/jitterentropy-base-genode-nstime.h | 6 +- .../x86_64/jitterentropy-base-genode-nstime.h | 2 +- 22 files changed, 192 insertions(+), 144 deletions(-) create mode 100644 repos/libports/src/lib/jitterentropy/jitterentropy-base-user.h create mode 100644 repos/libports/src/lib/jitterentropy/jitterentropy.patch delete mode 100644 repos/libports/src/lib/jitterentropy/jitterentropy_delta_compare.patch delete mode 100644 repos/libports/src/lib/jitterentropy/jitterentropy_h.patch delete mode 100644 repos/libports/src/lib/jitterentropy/jitterentropy_memcpy.patch diff --git a/repos/libports/lib/import/import-jitterentropy.mk b/repos/libports/lib/import/import-jitterentropy.mk index 4fc0283a63..95206ee4c9 100644 --- a/repos/libports/lib/import/import-jitterentropy.mk +++ b/repos/libports/lib/import/import-jitterentropy.mk @@ -20,5 +20,3 @@ endif INC_DIR += $(call select_from_repositories,src/lib/jitterentropy) INC_DIR += $(call select_from_repositories,src/lib/jitterentropy/spec/$(TARGET_CPUARCH)) - -CC_OPT += -DJITTERENTROPY_GENODE diff --git a/repos/libports/lib/mk/jitterentropy.inc b/repos/libports/lib/mk/jitterentropy.inc index d363b8739b..07497bfb1b 100644 --- a/repos/libports/lib/mk/jitterentropy.inc +++ b/repos/libports/lib/mk/jitterentropy.inc @@ -3,12 +3,14 @@ JENT_CONTRIB_DIR := $(call select_from_ports,jitterentropy) INC_DIR += $(JENT_CONTRIB_DIR)/include/jitterentropy \ $(REP_DIR)/src/lib/jitterentropy -SRC_C = jitterentropy-base.c -SRC_CC = jitterentropy-base-genode.cc - -CC_OPT += -DJITTERENTROPY_GENODE +SRC_C += jitterentropy-base.c +SRC_C += jitterentropy-gcd.c +SRC_C += jitterentropy-health.c +SRC_C += jitterentropy-noise.c +SRC_C += jitterentropy-sha3.c +SRC_CC += jitterentropy-base-genode.cc override CC_OLEVEL := -O0 -vpath %.c $(JENT_CONTRIB_DIR)/src/lib/jitterentropy +vpath %.c $(JENT_CONTRIB_DIR)/src/lib/jitterentropy/src vpath %.cc $(REP_DIR)/src/lib/jitterentropy diff --git a/repos/libports/lib/mk/spec/arm_v6/jitterentropy.mk b/repos/libports/lib/mk/spec/arm_v6/jitterentropy.mk index bddeed3d03..774bebe942 100644 --- a/repos/libports/lib/mk/spec/arm_v6/jitterentropy.mk +++ b/repos/libports/lib/mk/spec/arm_v6/jitterentropy.mk @@ -1,5 +1,3 @@ INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/arm_v6 include $(REP_DIR)/lib/mk/jitterentropy.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/spec/arm_v7/jitterentropy.mk b/repos/libports/lib/mk/spec/arm_v7/jitterentropy.mk index b8e7c46ebc..006c91f95e 100644 --- a/repos/libports/lib/mk/spec/arm_v7/jitterentropy.mk +++ b/repos/libports/lib/mk/spec/arm_v7/jitterentropy.mk @@ -1,5 +1,3 @@ INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/arm_v7 include $(REP_DIR)/lib/mk/jitterentropy.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/spec/arm_v8/jitterentropy.mk b/repos/libports/lib/mk/spec/arm_v8/jitterentropy.mk index 9b3dc833c5..f6adefb8f9 100644 --- a/repos/libports/lib/mk/spec/arm_v8/jitterentropy.mk +++ b/repos/libports/lib/mk/spec/arm_v8/jitterentropy.mk @@ -1,5 +1,3 @@ INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/arm_v8 include $(REP_DIR)/lib/mk/jitterentropy.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/spec/x86_32/jitterentropy.mk b/repos/libports/lib/mk/spec/x86_32/jitterentropy.mk index b79fc1da26..cebde308f5 100644 --- a/repos/libports/lib/mk/spec/x86_32/jitterentropy.mk +++ b/repos/libports/lib/mk/spec/x86_32/jitterentropy.mk @@ -1,5 +1,3 @@ INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/x86_32 include $(REP_DIR)/lib/mk/jitterentropy.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/spec/x86_64/jitterentropy.mk b/repos/libports/lib/mk/spec/x86_64/jitterentropy.mk index 4be30f5bc6..8241a2cc24 100644 --- a/repos/libports/lib/mk/spec/x86_64/jitterentropy.mk +++ b/repos/libports/lib/mk/spec/x86_64/jitterentropy.mk @@ -1,5 +1,3 @@ INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/x86_64 include $(REP_DIR)/lib/mk/jitterentropy.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/ports/jitterentropy.hash b/repos/libports/ports/jitterentropy.hash index f33b9922e4..8852ad5aa5 100644 --- a/repos/libports/ports/jitterentropy.hash +++ b/repos/libports/ports/jitterentropy.hash @@ -1 +1 @@ -5a9912059b31cef732fde73b1933e9bf0ed15adc +6bed43a43605b0006c7298cf4824a8214f36bb07 diff --git a/repos/libports/ports/jitterentropy.port b/repos/libports/ports/jitterentropy.port index 56af84795a..6a65adecd2 100644 --- a/repos/libports/ports/jitterentropy.port +++ b/repos/libports/ports/jitterentropy.port @@ -1,28 +1,13 @@ LICENSE := BSD -VERSION := 1.2.0 +VERSION := 3.4.1 DOWNLOADS := jitterentropy.archive -URL(jitterentropy) := http://www.chronox.de/jent/releases/historic/jitterentropy-$(VERSION).tar.xz -SHA(jitterentropy) := c2cadcc413b9f5f40b6cc0e092933a32585f7db8f28269af2bee794fde8034b2 -SIG(jitterentropy) := ${URL(jitterentropy)}.asc -KEY(jitterentropy) := 5F0D446594D2BF6977A9828AF02C639D843B5F11 -DIR(jitterentropy) := src/lib/jitterentropy +NAME(jitterentropy) := jitterentropy-$(VERSION).tar.gz +URL(jitterentropy) := https://github.com/smuellerDD/jitterentropy-library/archive/refs/tags/v$(VERSION).tar.gz +SHA(jitterentropy) := 33352369092b5a0d1463c720f5a8a3e870dbd63502ea57692e7da84a65c0c5c3 +DIR(jitterentropy) := src/lib/jitterentropy + +PATCHES := src/lib/jitterentropy/jitterentropy.patch DIRS := include/jitterentropy -DIR_CONTENT(include/jitterentropy) := $(addprefix src/lib/jitterentropy/,\ - jitterentropy.h) - -PATCHES := src/lib/jitterentropy/jitterentropy_h.patch \ - src/lib/jitterentropy/jitterentropy_delta_compare.patch \ - src/lib/jitterentropy/jitterentropy_memcpy.patch -PATCH_OPT := -p1 -d src/lib/jitterentropy - -# -# Just to make sure that the compiler will use the right header files -# we delete the local copy from the source directory after the files -# were copied to the include directory. -# -default: rm_header -rm_header: _dirs - @$(MSG_PREFIX)"remove header files from source directory " - $(VERBOSE)rm src/lib/jitterentropy/jitterentropy.h +DIR_CONTENT(include/jitterentropy) := $(addprefix src/lib/jitterentropy/,jitterentropy.h) diff --git a/repos/libports/recipes/api/jitterentropy/content.mk b/repos/libports/recipes/api/jitterentropy/content.mk index 9a355ec0c8..08b56f2ceb 100644 --- a/repos/libports/recipes/api/jitterentropy/content.mk +++ b/repos/libports/recipes/api/jitterentropy/content.mk @@ -5,7 +5,7 @@ MIRROR_FROM_REP_DIR := lib/mk/jitterentropy.inc \ src/lib/jitterentropy PORT_DIR := $(call port_dir,$(REP_DIR)/ports/jitterentropy) -MIRROR_FROM_PORT_DIR := src/lib/jitterentropy/jitterentropy-base.c \ +MIRROR_FROM_PORT_DIR := src/lib/jitterentropy/src \ include/jitterentropy/jitterentropy.h content: $(MIRROR_FROM_REP_DIR) $(MIRROR_FROM_PORT_DIR) LICENSE diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.cc b/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.cc index 1c8575a889..57f85adb11 100644 --- a/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.cc +++ b/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.cc @@ -15,8 +15,7 @@ #include #include -/* local includes */ -#include +#include static Genode::Allocator *_alloc; @@ -40,7 +39,7 @@ void *jent_zalloc(size_t len) } -void jent_zfree(void *ptr, unsigned int len) +void jent_zfree(void *ptr, unsigned int) { if (!_alloc) { return; } _alloc->free(ptr, 0); @@ -51,3 +50,9 @@ void *jent_memcpy(void *dest, const void *src, size_t n) { return Genode::memcpy(dest, src, n); } + + +void *jent_memset(void *dest, int c, size_t n) +{ + return Genode::memset(dest, (uint8_t)c, n); +} diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.h b/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.h index cdbf980e7a..e035e2bcd5 100644 --- a/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.h +++ b/repos/libports/src/lib/jitterentropy/jitterentropy-base-genode.h @@ -1,11 +1,15 @@ /* * \brief Genode base for jitterentropy * \author Josef Soentgen + * \author Christian Helmuth * \date 2014-08-18 + * + * Required to be included outside of extern "C" {...} at top of + * jitterentropy.h. */ /* - * Copyright (C) 2014-2017 Genode Labs GmbH + * Copyright (C) 2014-2024 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. @@ -14,21 +18,6 @@ #ifndef _JITTERENTROPY_BASE_GENODE_H_ #define _JITTERENTROPY_BASE_GENODE_H_ -/* needed type definitions */ -#include - -typedef unsigned long size_t; -typedef signed long ssize_t; -typedef genode_uint32_t uint32_t; -typedef genode_uint64_t uint64_t; -typedef uint32_t __u32; -typedef uint64_t __u64; -typedef genode_int64_t __s64; - -#ifndef __cplusplus -#define NULL (void*)0 -#endif - #ifdef __cplusplus #include @@ -36,25 +25,6 @@ typedef genode_int64_t __s64; /* Genode specific function to set the backend allocator */ void jitterentropy_init(Genode::Allocator &alloc); -extern "C" { -#endif - -#include - -void *jent_zalloc(size_t len); -void jent_zfree(void *ptr, unsigned int len); - -static inline int jent_fips_enabled(void) { return 0; } - -static inline __u64 rol64(__u64 word, unsigned int shift) -{ - return (word << shift) | (word >> (64 - shift)); -} - -void *jent_memcpy(void *dest, const void *src, size_t n); - -#ifdef __cplusplus -} #endif #endif /* _JITTERENTROPY_BASE_GENODE_H_ */ diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy-base-user.h b/repos/libports/src/lib/jitterentropy/jitterentropy-base-user.h new file mode 100644 index 0000000000..dbb3d56d74 --- /dev/null +++ b/repos/libports/src/lib/jitterentropy/jitterentropy-base-user.h @@ -0,0 +1,74 @@ +/* + * \brief Genode base for jitterentropy + * \author Josef Soentgen + * \author Christian Helmuth + * \date 2014-08-18 + */ + +/* + * Copyright (C) 2014-2024 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _JITTERENTROPY_BASE_USER_H_ +#define _JITTERENTROPY_BASE_USER_H_ + +/* needed type definitions */ +#include + +typedef unsigned long size_t; +typedef signed long ssize_t; +typedef genode_uint8_t uint8_t; +typedef genode_uint32_t uint32_t; +typedef genode_uint64_t uint64_t; +typedef uint32_t __u32; +typedef uint64_t __u64; +typedef genode_int64_t __s64; + +/* use gcc standard defines */ +#define UINT32_MAX __UINT32_MAX__ +#define UINT32_C __UINT32_C +#define UINT64_C __UINT64_C + +#ifndef __cplusplus +#define NULL (void*)0 + +#define EAGAIN 35 /* jitterentropy-health.c */ +#define EOPNOTSUPP 45 /* jitterentropy-timer.h */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void *jent_zalloc(size_t len); +void jent_zfree(void *ptr, unsigned int len); + +static inline int jent_fips_enabled(void) { return 0; } + +static inline uint32_t jent_cache_size_roundup(void) { return 0; } + +static inline __u64 rol64(__u64 word, unsigned int shift) +{ + return (word << shift) | (word >> (64 - shift)); +} + +void *jent_memcpy(void *dest, void const *src, size_t n); + +void *jent_memset(void *dest, int c, size_t n); + +static inline void jent_memset_secure(void *s, size_t n) +{ + jent_memset(s, 0, n); + asm volatile ("" : : "r" (s) : "memory"); +} + +#ifdef __cplusplus +} +#endif + +#endif /* _JITTERENTROPY_BASE_USER_H_ */ diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy.patch b/repos/libports/src/lib/jitterentropy/jitterentropy.patch new file mode 100644 index 0000000000..4836c0ec2d --- /dev/null +++ b/repos/libports/src/lib/jitterentropy/jitterentropy.patch @@ -0,0 +1,81 @@ +diff -ur -x '*~' -x recording_userspace src.orig/lib/jitterentropy/jitterentropy.h src/lib/jitterentropy/jitterentropy.h +--- src.orig/lib/jitterentropy/jitterentropy.h ++++ src/lib/jitterentropy/jitterentropy.h +@@ -42,6 +42,8 @@ + #ifndef _JITTERENTROPY_H + #define _JITTERENTROPY_H + ++#include "jitterentropy-base-genode.h" ++ + #ifdef __cplusplus + extern "C" { + #endif +diff -ur -x '*~' -x recording_userspace src.orig/lib/jitterentropy/src/jitterentropy-noise.c src/lib/jitterentropy/src/jitterentropy-noise.c +--- src.orig/lib/jitterentropy/src/jitterentropy-noise.c ++++ src/lib/jitterentropy/src/jitterentropy-noise.c +@@ -112,7 +112,7 @@ + jent_loop_shuffle(ec, MAX_HASH_LOOP, MIN_HASH_LOOP); + + /* Use the memset to shut up valgrind */ +- memset(intermediary, 0, sizeof(intermediary)); ++ jent_memset(intermediary, 0, sizeof(intermediary)); + + sha3_256_init(&ctx); + +@@ -413,7 +413,7 @@ + /* The final operation automatically re-initializes the ->hash_state */ + sha3_final(ec->hash_state, jent_block); + if (dst_len) +- memcpy(dst, jent_block, dst_len); ++ jent_memcpy(dst, jent_block, dst_len); + + /* + * Stir the new state with the data from the old state - the digest +diff -ur -x '*~' -x recording_userspace src.orig/lib/jitterentropy/src/jitterentropy-sha3.c src/lib/jitterentropy/src/jitterentropy-sha3.c +--- src.orig/lib/jitterentropy/src/jitterentropy-sha3.c ++++ src/lib/jitterentropy/src/jitterentropy-sha3.c +@@ -295,7 +295,7 @@ + * buffer, copy it and leave it unprocessed. + */ + if (inlen < todo) { +- memcpy(ctx->partial + partial, in, inlen); ++ jent_memcpy(ctx->partial + partial, in, inlen); + return; + } + +@@ -303,7 +303,7 @@ + * The input data is large enough to fill the entire partial + * block buffer. Thus, we fill it and transform it. + */ +- memcpy(ctx->partial + partial, in, todo); ++ jent_memcpy(ctx->partial + partial, in, todo); + inlen -= todo; + in += todo; + +@@ -318,7 +318,7 @@ + } + + /* If we have data left, copy it into the partial block buffer */ +- memcpy(ctx->partial, in, inlen); ++ jent_memcpy(ctx->partial, in, inlen); + } + + void sha3_final(struct sha_ctx *ctx, uint8_t *digest) +@@ -329,7 +329,7 @@ + /* Final round in sponge absorbing phase */ + + /* Fill the unused part of the partial buffer with zeros */ +- memset(ctx->partial + partial, 0, ctx->r - partial); ++ jent_memset(ctx->partial + partial, 0, ctx->r - partial); + + /* + * Add the leading and trailing bit as well as the 01 bits for the +@@ -353,7 +353,7 @@ + if (ctx->digestsize % 8) + le32_to_ptr(digest, (uint32_t)(ctx->state[i])); + +- memset(ctx->partial, 0, ctx->r); ++ jent_memset(ctx->partial, 0, ctx->r); + sha3_init(ctx); + } + diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy_delta_compare.patch b/repos/libports/src/lib/jitterentropy/jitterentropy_delta_compare.patch deleted file mode 100644 index 4d9bbacaf0..0000000000 --- a/repos/libports/src/lib/jitterentropy/jitterentropy_delta_compare.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/jitterentropy-base.c b/jitterentropy-base.c -index c71e1e7..28b1462 100644 ---- a/jitterentropy-base.c -+++ b/jitterentropy-base.c -@@ -754,7 +754,7 @@ int jent_entropy_init(void) - * than 1 to ensure the entropy estimation - * implied with 1 is preserved - */ -- if (!(delta_sum) > 1) -+ if (!(delta_sum > 1)) - return EMINVARVAR; - - /* diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy_h.patch b/repos/libports/src/lib/jitterentropy/jitterentropy_h.patch deleted file mode 100644 index dc718fd787..0000000000 --- a/repos/libports/src/lib/jitterentropy/jitterentropy_h.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/jitterentropy.h.orig -+++ b/jitterentropy.h -@@ -42,11 +42,19 @@ - #ifndef _JITTERENTROPY_H - #define _JITTERENTROPY_H - -+#ifdef JITTERENTROPY_GENODE -+#include -+#else - #ifdef __KERNEL__ - #include "jitterentropy-base-kernel.h" - #else - #include "jitterentropy-base-user.h" - #endif /* __KERNEL__ */ -+#endif -+ -+#ifdef __cplusplus -+extern "C" { -+#endif - - /* Statistical data from the entropy source */ - struct entropy_stat { -@@ -171,4 +179,8 @@ - - /* -- END of statistical test function -- */ - -+#ifdef __cplusplus -+} -+#endif /* extern "C" */ -+ - #endif /* _JITTERENTROPY_H */ diff --git a/repos/libports/src/lib/jitterentropy/jitterentropy_memcpy.patch b/repos/libports/src/lib/jitterentropy/jitterentropy_memcpy.patch deleted file mode 100644 index a75f1e53d3..0000000000 --- a/repos/libports/src/lib/jitterentropy/jitterentropy_memcpy.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/jitterentropy-base.c b/jitterentropy-base.c -index 28b1462..3ea4c90 100644 ---- a/jitterentropy-base.c -+++ b/jitterentropy-base.c -@@ -553,7 +553,7 @@ ssize_t jent_read_entropy(struct rand_data *ec, char *data, size_t len) - tocopy = (DATA_SIZE_BITS / 8); - else - tocopy = len; -- memcpy(p, &ec->data, tocopy); -+ jent_memcpy(p, &ec->data, tocopy); - - len -= tocopy; - p += tocopy; diff --git a/repos/libports/src/lib/jitterentropy/spec/arm_v6/jitterentropy-base-genode-nstime.h b/repos/libports/src/lib/jitterentropy/spec/arm_v6/jitterentropy-base-genode-nstime.h index 262ee32c87..3cbcb75250 100644 --- a/repos/libports/src/lib/jitterentropy/spec/arm_v6/jitterentropy-base-genode-nstime.h +++ b/repos/libports/src/lib/jitterentropy/spec/arm_v6/jitterentropy-base-genode-nstime.h @@ -17,7 +17,7 @@ static inline void jent_get_nstime(__u64 *out) { uint32_t t; - asm volatile("mrc p15, 0, %0, c15, c12, 1" : "=r"(t)); + asm volatile ("mrc p15, 0, %0, c15, c12, 1" : "=r"(t)); *out = t; } diff --git a/repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h b/repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h index 2933538db2..e7e7f56a0a 100644 --- a/repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h +++ b/repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h @@ -17,7 +17,7 @@ static inline void jent_get_nstime(__u64 *out) { uint32_t t; - asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(t)); + asm volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(t)); *out = t; } diff --git a/repos/libports/src/lib/jitterentropy/spec/arm_v8/jitterentropy-base-genode-nstime.h b/repos/libports/src/lib/jitterentropy/spec/arm_v8/jitterentropy-base-genode-nstime.h index 1baa46406f..fb9c6ebf6a 100644 --- a/repos/libports/src/lib/jitterentropy/spec/arm_v8/jitterentropy-base-genode-nstime.h +++ b/repos/libports/src/lib/jitterentropy/spec/arm_v8/jitterentropy-base-genode-nstime.h @@ -18,7 +18,7 @@ static inline void jent_get_nstime(__u64 *out) { uint64_t t; /* cycle counter */ - asm volatile("mrs %0, pmccntr_el0" : "=r" (t)); + asm volatile ("mrs %0, pmccntr_el0" : "=r" (t)); *out = t; } diff --git a/repos/libports/src/lib/jitterentropy/spec/x86_32/jitterentropy-base-genode-nstime.h b/repos/libports/src/lib/jitterentropy/spec/x86_32/jitterentropy-base-genode-nstime.h index 34b7f8db64..2d5af47ed9 100644 --- a/repos/libports/src/lib/jitterentropy/spec/x86_32/jitterentropy-base-genode-nstime.h +++ b/repos/libports/src/lib/jitterentropy/spec/x86_32/jitterentropy-base-genode-nstime.h @@ -16,9 +16,9 @@ static inline void jent_get_nstime(__u64 *out) { - uint64_t t; - __asm__ __volatile__ ( "rdtsc" : "=A" (t)); - *out = t; + uint64_t t; + asm volatile ( "rdtsc" : "=A" (t)); + *out = t; } #endif /* _JITTERENTROPY_X86_32_BASE_GENODE_NSTIME_H */ diff --git a/repos/libports/src/lib/jitterentropy/spec/x86_64/jitterentropy-base-genode-nstime.h b/repos/libports/src/lib/jitterentropy/spec/x86_64/jitterentropy-base-genode-nstime.h index d984ed5439..9bb787f55f 100644 --- a/repos/libports/src/lib/jitterentropy/spec/x86_64/jitterentropy-base-genode-nstime.h +++ b/repos/libports/src/lib/jitterentropy/spec/x86_64/jitterentropy-base-genode-nstime.h @@ -17,7 +17,7 @@ static inline void jent_get_nstime(__u64 *out) { uint32_t lo, hi; - __asm__ __volatile__ ( "rdtsc" : "=a" (lo), "=d" (hi)); + asm volatile ( "rdtsc" : "=a" (lo), "=d" (hi)); *out = (uint64_t)hi << 32 | lo; }