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

Re: [Minios-devel] [PATCH 33/40] arm64: gic: implement the REG_WRITE32/REG_READ32



Hi Shijie,

On 03/11/17 03:12, Huang Shijie wrote:
Implement the REG_WRITE32/REG_READ32.

This patch refers to Chen Baozi's patch:
      "Initial codes for arm64"

Change-Id: I942d68d7e9ed31382951a2bfebd29d87acc84281
Jira: ENTOS-247
Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
  arch/arm/gic.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/arch/arm/gic.c b/arch/arm/gic.c
index e72c723..ce7f7c8 100644
--- a/arch/arm/gic.c
+++ b/arch/arm/gic.c
@@ -44,14 +44,22 @@ static struct gic gic;
  static inline uint32_t REG_READ32(volatile uint32_t *addr)

This should be implemented in an arch specific header.

  {
      uint32_t value;
+#if defined(__arm__)
      __asm__ __volatile__("ldr %0, [%1]":"=&r"(value):"r"(addr));
+#else
+    __asm__ __volatile__("ldr %w0, [%1]":"=&r"(value):"r"(addr));
+#endif
      rmb();
      return value;
  }
static inline void REG_WRITE32(volatile uint32_t *addr, unsigned int value)
  {
+#if defined(__arm__)
      __asm__ __volatile__("str %0, [%1]"::"r"(value), "r"(addr));
+#else
+    __asm__ __volatile__("str %w0, [%1]"::"r" (value), "r"(addr));
+#endif
      wmb();
  }
   >

Cheers,

--
Julien Grall

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

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