[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] minios: Add ioread/iowrite functions to mini-os


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 10 Oct 2012 22:11:12 +0000
  • Delivery-date: Wed, 10 Oct 2012 22:11:24 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@xxxxxxxxxx>
# Date 1349703388 -3600
# Node ID a797d59e1d2981f892b5d07e8fe87ee27828c10c
# Parent  02e744da52c997de70ebde8d1baaf45dc4399866
minios: Add ioread/iowrite functions to mini-os

This patch adds iowritexx() and ioreadxx() functions for interacting
with hardware memory to mini-os. The functions are available in a header
iorw.h

Signed-off-by: Matthew Fioravante <matthew.fioravante@xxxxxxxxxx>
Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/arch/x86/iorw.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/arch/x86/iorw.c    Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,35 @@
+#include <mini-os/iorw.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   *((volatile uint8_t*)addr) = val;
+}
+void iowrite16(volatile void* addr, uint16_t val)
+{
+   *((volatile uint16_t*)addr) = val;
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   *((volatile uint32_t*)addr) = val;
+}
+void iowrite64(volatile void* addr, uint64_t val)
+{
+   *((volatile uint64_t*)addr) = val;
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   return *((volatile uint8_t*) addr);
+}
+uint16_t ioread16(volatile void* addr)
+{
+   return *((volatile uint16_t*) addr);
+}
+uint32_t ioread32(volatile void* addr)
+{
+   return *((volatile uint32_t*) addr);
+}
+uint64_t ioread64(volatile void* addr)
+{
+   return *((volatile uint64_t*) addr);
+}
diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/include/iorw.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/iorw.h     Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,16 @@
+#ifndef MINIOS_IORW_H
+#define MINIOS_IORW_H
+
+#include <mini-os/types.h>
+
+void iowrite8(volatile void* addr, uint8_t val);
+void iowrite16(volatile void* addr, uint16_t val);
+void iowrite32(volatile void* addr, uint32_t val);
+void iowrite64(volatile void* addr, uint64_t val);
+
+uint8_t ioread8(volatile void* addr);
+uint16_t ioread16(volatile void* addr);
+uint32_t ioread32(volatile void* addr);
+uint64_t ioread64(volatile void* addr);
+
+#endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.