All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 1/2] x86: Add 64-bit memory-mapped I/O functions
Date: Fri, 06 Apr 2018 22:40:55 +0300	[thread overview]
Message-ID: <1523043655.21176.406.camel@linux.intel.com> (raw)
In-Reply-To: <cb4f991947caa10acc7439735dae7b246245f8e5.1523041697.git.ivan.gorinov@intel.com>

On Fri, 2018-04-06 at 12:17 -0700, Ivan Gorinov wrote:
> Add readq() and writeq() definitions for x86.
> 
> Please note: in 32-bit code readq/writeq will generate two 32-bit
> memory access instructions instead of one atomic 64-bit operation.
> 

 
> -#define readb(addr) (*(volatile unsigned char *) (addr))
> -#define readw(addr) (*(volatile unsigned short *) (addr))
> -#define readl(addr) (*(volatile unsigned int *) (addr))
> +#define readb(addr) (*(volatile u8 *) (addr))
> +#define readw(addr) (*(volatile u16 *) (addr))
> +#define readl(addr) (*(volatile u32 *) (addr))


> -#define writeb(b,addr) (*(volatile unsigned char *) (addr) = (b))
> -#define writew(b,addr) (*(volatile unsigned short *) (addr) = (b))
> -#define writel(b,addr) (*(volatile unsigned int *) (addr) = (b))
> +#define writeb(b, addr) (*(volatile u8 *) (addr) = (b))
> +#define writew(b, addr) (*(volatile u16 *) (addr) = (b))
> +#define writel(b, addr) (*(volatile u32 *) (addr) = (b))

What's wrong with the existing types?

Even in ARM case they are using unsigned long long for 64-bit variant.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2018-04-06 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 19:17 [U-Boot] [PATCH v5 0/2] timer: Add High Precision Event Timers (HPET) support Ivan Gorinov
2018-04-06 19:17 ` [U-Boot] [PATCH v5 1/2] x86: Add 64-bit memory-mapped I/O functions Ivan Gorinov
2018-04-06 19:40   ` Andy Shevchenko [this message]
2018-04-06 19:18 ` [U-Boot] [PATCH v5 2/2] timer: Add High Precision Event Timers (HPET) support Ivan Gorinov
2018-04-06 19:39   ` Andy Shevchenko
2018-04-09  1:22   ` Bin Meng
2018-04-12 16:42     ` Simon Glass
2018-04-16  5:06       ` Bin Meng
2018-04-17 15:10         ` Simon Glass
2018-04-18 13:34           ` Bin Meng

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=1523043655.21176.406.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --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.