summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Dawson <marshalldawson3rd@gmail.com>2017-04-20 14:03:11 -0600
committerMarc Jones <marc@marcjonesconsulting.com>2017-04-25 06:14:39 +0200
commitefd077ac5283cb88627a53b703f1eb67aec4e5a3 (patch)
tree4387502a696e4e06833215c66f5046c157834698
parent8e055f8f5335ef72ca019317594e036f0b6cec37 (diff)
downloadcoreboot-efd077ac5283cb88627a53b703f1eb67aec4e5a3.tar.xz
arch/x86: Add read64 and write64 functions
Create new functions similar to read and write of other sizes. Change-Id: I35a08c498f25227233604c65c45b73b1c44fae1f Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/19394 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/arch/x86/include/arch/io.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index c194379bb6..a59ac2c50b 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -174,6 +174,14 @@ static inline __attribute__((always_inline)) uint32_t read32(
return *((volatile uint32_t *)(addr));
}
+#ifndef __ROMCC__
+static inline __attribute__((always_inline)) uint64_t read64(
+ const volatile void *addr)
+{
+ return *((volatile uint64_t *)(addr));
+}
+#endif
+
static inline __attribute__((always_inline)) void write8(volatile void *addr,
uint8_t value)
{
@@ -192,6 +200,14 @@ static inline __attribute__((always_inline)) void write32(volatile void *addr,
*((volatile uint32_t *)(addr)) = value;
}
+#ifndef __ROMCC__
+static inline __attribute__((always_inline)) void write64(volatile void *addr,
+ uint64_t value)
+{
+ *((volatile uint64_t *)(addr)) = value;
+}
+#endif
+
/* Conflicts with definition in lib.h */
#if defined(__ROMCC__)
static inline int log2(u32 value)