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

Marc Jones (Code Review) gerrit at coreboot.org
Tue Apr 25 06:14:40 CEST 2017


Marc Jones has submitted this change and it was merged. ( 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>
Reviewed-on: https://review.coreboot.org/19394
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
M src/arch/x86/include/arch/io.h
1 file changed, 16 insertions(+), 0 deletions(-)

Approvals:
  Aaron Durbin: Looks good to me, approved
  Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
  Paul Menzel: Looks good to me, but someone else must approve
  build bot (Jenkins): Verified



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: merged
Gerrit-Change-Id: I35a08c498f25227233604c65c45b73b1c44fae1f
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Marc Jones <marc at marcjonesconsulting.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list