All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/10] microblaze: Fix in/out_be8/16/32 functions
Date: Wed, 31 Aug 2011 10:35:12 +0200	[thread overview]
Message-ID: <1314779721-1113-2-git-send-email-monstr@monstr.eu> (raw)
In-Reply-To: <1314779721-1113-1-git-send-email-monstr@monstr.eu>

Use inline functions instead of macros because
of typechecking.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/include/asm/io.h |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 7e190d1..a35700e 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -46,14 +46,35 @@
 #define outl(x, addr)	((void) writel (x, addr))
 
 /* Some #definitions to keep strange Xilinx code happy */
-#define in_8(addr)	readb (addr)
-#define in_be16(addr)	readw (addr)
-#define in_be32(addr)	readl (addr)
+extern inline int in_8(volatile unsigned char *addr)
+{
+	return readb(addr);
+}
+
+extern inline int in_be16(volatile unsigned short *addr)
+{
+	return readw(addr);
+}
 
-#define out_8(addr,x )	outb (x,addr)
-#define out_be16(addr,x )	outw (x,addr)
-#define out_be32(addr,x )	outl (x,addr)
+extern inline int in_be32(volatile unsigned int *addr)
+{
+	return readl(addr);
+}
 
+extern inline void out_8(volatile unsigned char *addr, char val)
+{
+	outb (val, addr);
+}
+
+extern inline void out_be16(volatile unsigned short *addr, short val)
+{
+	outw (val, addr);
+}
+
+extern inline void out_be32(volatile unsigned int *addr, int val)
+{
+	outl (val, addr);
+}
 
 #define inb_p(port)		inb((port))
 #define outb_p(val, port)	outb((val), (port))
-- 
1.5.5.6

  reply	other threads:[~2011-08-31  8:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31  8:35 [U-Boot] Microblaze changes Michal Simek
2011-08-31  8:35 ` Michal Simek [this message]
2011-08-31  8:35   ` [U-Boot] [PATCH 02/10] microblaze: Support CTRL+C when tftp is running Michal Simek
2011-08-31  8:35     ` [U-Boot] [PATCH 03/10] microblaze: Support flashes on lower addresses Michal Simek
2011-08-31  8:35       ` [U-Boot] [PATCH 04/10] microblaze: Add netconsole support Michal Simek
2011-08-31  8:35         ` [U-Boot] [PATCH 05/10] microblaze: Fix unaligned.h for endians Michal Simek
2011-08-31  8:35           ` [U-Boot] [PATCH 06/10] microblaze: Copy bootfile from variables Michal Simek
2011-08-31  8:35             ` [U-Boot] [PATCH 07/10] microblaze: Remove debug saving value Michal Simek
2011-08-31  8:35               ` [U-Boot] [PATCH 08/10] microblaze: Setup MB vectors if feature is enable for u-boot Michal Simek
2011-08-31  8:35                 ` [U-Boot] [PATCH 09/10] microblaze: Save and restore first unused vector Michal Simek
2011-08-31  8:35                   ` [U-Boot] [PATCH 10/10] microblaze: Clean up reset asm code Michal Simek
2011-08-31 19:20           ` [U-Boot] [PATCH 05/10] microblaze: Fix unaligned.h for endians Mike Frysinger
2011-09-01 12:51             ` Michal Simek
2011-08-31 19:19         ` [U-Boot] [PATCH 04/10] microblaze: Add netconsole support Mike Frysinger
2011-09-01 13:04           ` Michal Simek
2011-09-07 21:02         ` Wolfgang Denk
2011-08-31 19:18       ` [U-Boot] [PATCH 03/10] microblaze: Support flashes on lower addresses Mike Frysinger
2011-09-01 12:55         ` Michal Simek
2011-09-07 21:01       ` Wolfgang Denk
2011-09-07 20:59   ` [U-Boot] [PATCH 01/10] microblaze: Fix in/out_be8/16/32 functions Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314779721-1113-2-git-send-email-monstr@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.