hwaccess: add endianness converting deserialization functions

Add functions like
  `uint32_t read_le32(const void *base, size_t offset);`
Read a 32 bit unsigned from a base with an offset.
Having prototypes and a macro generated implementation makes it easier
to read, understand and spot errors in one of them.

Change-Id: Idde177acf8bc5f94cd046b6539dc31532c98e452
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/31016
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72317
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/meson.build b/meson.build
index 2ccb012..09572a3 100644
--- a/meson.build
+++ b/meson.build
@@ -132,6 +132,8 @@
   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
 endif
 
+srcs += 'platform/memaccess.c'
+
 if host_machine.endian() == 'little'
   srcs += 'platform/endian_little.c'
   add_project_arguments('-D__FLASHROM_LITTLE_ENDIAN__=1', language : 'c')