aboutsummaryrefslogtreecommitdiffstats
path: root/roms/qboot/include/memaccess.h
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/qboot/include/memaccess.h
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/qboot/include/memaccess.h')
-rw-r--r--roms/qboot/include/memaccess.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/roms/qboot/include/memaccess.h b/roms/qboot/include/memaccess.h
new file mode 100644
index 000000000..900b47e63
--- /dev/null
+++ b/roms/qboot/include/memaccess.h
@@ -0,0 +1,30 @@
+#ifndef MEMACCESS_H_
+#define MEMACCESS_H_
+
+#include "string.h"
+
+static inline uint16_t lduw_p(void *p)
+{
+ uint16_t val;
+ memcpy(&val, p, 2);
+ return val;
+}
+
+static inline uint32_t ldl_p(void *p)
+{
+ uint32_t val;
+ memcpy(&val, p, 4);
+ return val;
+}
+
+static inline void stw_p(void *p, uint16_t val)
+{
+ memcpy(p, &val, 2);
+}
+
+static inline void stl_p(void *p, uint32_t val)
+{
+ memcpy(p, &val, 4);
+}
+
+#endif /* MEMACCESS_H_ */