From e5d10a43278b10875ef0a80be4af2d1b5692c1c9 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Tue, 2 Jun 2020 09:28:11 +0200 Subject: ipc: fix endianness issues Use native byte-order for IPC and program serialization. This way we will be able to support both little- and big-endian architectures. Signed-off-by: Alexander Egorenkov --- executor/executor_linux.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'executor/executor_linux.h') diff --git a/executor/executor_linux.h b/executor/executor_linux.h index 47804f4f4..98b89fc9a 100644 --- a/executor/executor_linux.h +++ b/executor/executor_linux.h @@ -167,8 +167,10 @@ static void cover_reset(cover_t* cov) static void cover_collect(cover_t* cov) { - // Note: this assumes little-endian kernel. - cov->size = *(uint32*)cov->data; + if (is_kernel_64_bit) + cov->size = *(uint64*)cov->data; + else + cov->size = *(uint32*)cov->data; } static bool cover_check(uint32 pc) -- cgit mrf-deployment