xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/11] Add ioread/iowrite functions to mini-os
@ 2012-09-27 17:09 Matthew Fioravante
  2012-09-27 17:09 ` [PATCH 02/11] add posix io for blkfront Matthew Fioravante
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Matthew Fioravante @ 2012-09-27 17:09 UTC (permalink / raw)
  To: xen-devel, samuel.thibault, Ian.Campbell; +Cc: Matthew Fioravante

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@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff --git a/extras/mini-os/arch/ia64/iorw.c b/extras/mini-os/arch/ia64/iorw.c
new file mode 100644
index 0000000..aa58807
--- /dev/null
+++ b/extras/mini-os/arch/ia64/iorw.c
@@ -0,0 +1,48 @@
+#include <mini-os/iorw.h>
+#include <mini-os/console.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+}
+void iowrite16(volatile void* addr, uint16_t val)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+}
+void iowrite64(volatile void* addr, uint64_t val)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+   return 0;
+}
+uint16_t ioread16(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+   return 0;
+}
+uint32_t ioread32(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+   return 0;
+}
+uint64_t ioread64(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   BUG();
+   return 0;
+}
diff --git a/extras/mini-os/arch/x86/iorw.c b/extras/mini-os/arch/x86/iorw.c
new file mode 100644
index 0000000..3080769
--- /dev/null
+++ b/extras/mini-os/arch/x86/iorw.c
@@ -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 --git a/extras/mini-os/include/iorw.h b/extras/mini-os/include/iorw.h
new file mode 100644
index 0000000..d5ec065
--- /dev/null
+++ b/extras/mini-os/include/iorw.h
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-10-02 14:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 17:09 [PATCH 01/11] Add ioread/iowrite functions to mini-os Matthew Fioravante
2012-09-27 17:09 ` [PATCH 02/11] add posix io for blkfront Matthew Fioravante
2012-09-28 10:36   ` George Dunlap
2012-09-27 17:09 ` [PATCH 03/11] Add endian, byteswap, and wordsize macros to mini-os Matthew Fioravante
2012-09-28 10:48   ` George Dunlap
2012-09-27 17:09 ` [PATCH 04/11] Disable the mfn_is_ram() check, it doesn't work correctly on all systems Matthew Fioravante
2012-10-02 10:49   ` Ian Campbell
2012-10-02 14:20     ` Matthew Fioravante
2012-09-27 17:09 ` [PATCH 05/11] add CONFIG_XC conditional Matthew Fioravante
2012-09-28 11:18   ` George Dunlap
2012-09-28 13:59     ` Matthew Fioravante
2012-09-28 15:24       ` Matthew Fioravante
2012-09-28 15:26         ` Matthew Fioravante
2012-09-27 17:10 ` [PATCH 06/11] add select definition to sys/time.h when HAVE_LIBC is defined Matthew Fioravante
2012-09-27 17:10 ` [PATCH 07/11] setup fpu and sse in mini-os Matthew Fioravante
2012-09-27 17:10 ` [PATCH 08/11] add tpmfront, tpm_tis, and tpmback drivers to mini-os Matthew Fioravante
2012-10-02 10:57   ` Ian Campbell
2012-10-02 11:08     ` Ian Jackson
2012-10-02 14:17     ` Matthew Fioravante
2012-10-02 14:44       ` Ian Campbell
2012-09-28 10:16 ` [PATCH 01/11] Add ioread/iowrite functions " George Dunlap
2012-09-28 13:57   ` Matthew Fioravante
2012-09-28 15:39     ` George Dunlap
2012-10-02  9:10     ` Ian Campbell
2012-10-02 14:23       ` Matthew Fioravante

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).