[coreboot-gerrit] Change in coreboot[master]: arch/x86: Add read64 and write64 functions

Marshall Dawson (Code Review) gerrit at coreboot.org
Fri Apr 21 02:00:54 CEST 2017


Marshall Dawson has uploaded a new change for review. ( https://review.coreboot.org/19394 )

Change subject: arch/x86: Add read64 and write64 functions
......................................................................

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 at gmail.com>
---
M src/arch/x86/include/arch/io.h
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/19394/1

diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index c194379..a59ac2c 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -174,6 +174,14 @@
 	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 @@
 	*((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)

-- 
To view, visit https://review.coreboot.org/19394
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35a08c498f25227233604c65c45b73b1c44fae1f
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>



More information about the coreboot-gerrit mailing list