From 6272c71fbbfb26ebde9954708f74f875c083f822 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Sat, 19 Feb 2022 21:17:44 +0100 Subject: hwaccess: replace macros by C code Split the code for endian conversion into separate files for big and little endian. The buildsystem selects the correct file for the used endianness. Replace the swab macros with `static inline` c functions. Define macros for returning the same or swapped value. Call those macros in the endian specific files. Change-Id: I86d38d816b37c283279c485fac8027f8fb94364a Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/62898 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- hwaccess_endian_big.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 hwaccess_endian_big.c (limited to 'hwaccess_endian_big.c') diff --git a/hwaccess_endian_big.c b/hwaccess_endian_big.c new file mode 100644 index 00000000..1f7b5a37 --- /dev/null +++ b/hwaccess_endian_big.c @@ -0,0 +1,42 @@ +/* + * This file is part of the flashrom project. + * + * Copyright (C) 2022 secunet Security Networks AG + * (written by Thomas Heijligen