xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mini-os enhancements for vtpm 1/8]
@ 2012-09-17 21:52 Matthew Fioravante
  2012-09-17 22:23 ` Samuel Thibault
  2012-09-18  7:23 ` Ian Campbell
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Fioravante @ 2012-09-17 21:52 UTC (permalink / raw)
  To: Samuel Thibault, xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 1840 bytes --]

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

diff --git a/extras/mini-os/arch/ia64/iorw.c
b/extras/mini-os/arch/ia64/iorw.c
--- /dev/null
+++ b/extras/mini-os/arch/ia64/iorw.c
@@ -0,0 +1,22 @@
+#include <mini-os/iorw.h>
+#include <mini-os/console.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   printk("iorw not implemented!!\n");
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   printk("iorw not implemented!!\n");
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   return 0;
+}
+uint32_t ioread32(volatile void* addr)
+{
+   printk("iorw not implemented!!\n");
+   return 0;
+}
diff --git a/extras/mini-os/arch/x86/iorw.c b/extras/mini-os/arch/x86/iorw.c
--- /dev/null
+++ b/extras/mini-os/arch/x86/iorw.c
@@ -0,0 +1,19 @@
+#include <mini-os/iorw.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   *((volatile uint8_t*)addr) = val;
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   *((volatile uint32_t*)addr) = val;
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   return *((volatile uint8_t*) addr);
+}
+uint32_t ioread32(volatile void* addr)
+{
+   return *((volatile uint32_t*) addr);
+}
diff --git a/extras/mini-os/include/iorw.h b/extras/mini-os/include/iorw.h
--- /dev/null
+++ b/extras/mini-os/include/iorw.h
@@ -0,0 +1,12 @@
+#ifndef MINIOS_IORW_H
+#define MINIOS_IORW_H
+
+#include <mini-os/types.h>
+
+void iowrite8(volatile void* addr, uint8_t val);
+void iowrite32(volatile void* addr, uint32_t val);
+
+uint8_t ioread8(volatile void* addr);
+uint32_t ioread32(volatile void* addr);
+
+#endif



[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 1459 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH mini-os enhancements for vtpm 1/8]
  2012-09-17 21:52 [PATCH mini-os enhancements for vtpm 1/8] Matthew Fioravante
@ 2012-09-17 22:23 ` Samuel Thibault
  2012-09-18 17:56   ` Matthew Fioravante
  2012-09-18  7:23 ` Ian Campbell
  1 sibling, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2012-09-17 22:23 UTC (permalink / raw)
  To: Matthew Fioravante; +Cc: xen-devel@lists.xensource.com

Matthew Fioravante, le Mon 17 Sep 2012 17:52:38 -0400, a écrit :
> b/extras/mini-os/arch/ia64/iorw.c

> +void iowrite8(volatile void* addr, uint8_t val)
> +{
> +   printk("iorw not implemented!!\n");

Maybe even crash?  Such things can be overlooked.

> +#include <mini-os/types.h>
> +
> +void iowrite8(volatile void* addr, uint8_t val);
> +void iowrite32(volatile void* addr, uint32_t val);
> +
> +uint8_t ioread8(volatile void* addr);
> +uint32_t ioread32(volatile void* addr);

I'd say while you are at it, add 16 and 64 variants.

Samuel

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

* Re: [PATCH mini-os enhancements for vtpm 1/8]
  2012-09-17 21:52 [PATCH mini-os enhancements for vtpm 1/8] Matthew Fioravante
  2012-09-17 22:23 ` Samuel Thibault
@ 2012-09-18  7:23 ` Ian Campbell
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2012-09-18  7:23 UTC (permalink / raw)
  To: Matthew Fioravante; +Cc: Samuel Thibault, xen-devel@lists.xensource.com

On Mon, 2012-09-17 at 22:52 +0100, Matthew Fioravante wrote:
> 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
> 
> diff --git a/extras/mini-os/arch/ia64/iorw.c
> b/extras/mini-os/arch/ia64/iorw.c
> --- /dev/null
> +++ b/extras/mini-os/arch/ia64/iorw.c

The last vestiges of ia64 support have now been removed from the tree,
so there is no need for this change any more.

If you spot any other ia64 bits as you go through please feel free to
remove or report them.

Ian.

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

* Re: [PATCH mini-os enhancements for vtpm 1/8]
  2012-09-17 22:23 ` Samuel Thibault
@ 2012-09-18 17:56   ` Matthew Fioravante
  2012-09-18 18:07     ` Samuel Thibault
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Fioravante @ 2012-09-18 17:56 UTC (permalink / raw)
  To: Samuel Thibault, xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 3430 bytes --]

On 09/17/2012 06:23 PM, Samuel Thibault wrote:
> Matthew Fioravante, le Mon 17 Sep 2012 17:52:38 -0400, a écrit :
>> b/extras/mini-os/arch/ia64/iorw.c
>> +void iowrite8(volatile void* addr, uint8_t val)
>> +{
>> +   printk("iorw not implemented!!\n");
> Maybe even crash?  Such things can be overlooked.
I agree.
>> +#include <mini-os/types.h>
>> +
>> +void iowrite8(volatile void* addr, uint8_t val);
>> +void iowrite32(volatile void* addr, uint32_t val);
>> +
>> +uint8_t ioread8(volatile void* addr);
>> +uint32_t ioread32(volatile void* addr);
> I'd say while you are at it, add 16 and 64 variants.
Included below
>
> Samuel

New patch.

Signed off by: Matthew Fioravante matthew.fioravante@jhuapl.edu

diff --git a/extras/mini-os/arch/ia64/iorw.c
b/extras/mini-os/arch/ia64/iorw.c
--- /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
--- /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
--- /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



[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 1459 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH mini-os enhancements for vtpm 1/8]
  2012-09-18 17:56   ` Matthew Fioravante
@ 2012-09-18 18:07     ` Samuel Thibault
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2012-09-18 18:07 UTC (permalink / raw)
  To: Matthew Fioravante; +Cc: xen-devel@lists.xensource.com

Matthew Fioravante, le Tue 18 Sep 2012 13:56:10 -0400, a écrit :
> New patch.
> 
> 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
> --- /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
> --- /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
> --- /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
> 
> 



-- 
Samuel
#ifndef I_WISH_WORLD_WERE_PERFECT
/* It is not :-( All the routers (except for Linux) return only
...
 -+- linux/net/ipv4/ipip.c -+-

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

end of thread, other threads:[~2012-09-18 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 21:52 [PATCH mini-os enhancements for vtpm 1/8] Matthew Fioravante
2012-09-17 22:23 ` Samuel Thibault
2012-09-18 17:56   ` Matthew Fioravante
2012-09-18 18:07     ` Samuel Thibault
2012-09-18  7:23 ` Ian Campbell

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).