All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gorinov <ivan.gorinov@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] timer: add High Precision Event Timers (HPET) support
Date: Tue, 3 Apr 2018 16:26:47 -0700	[thread overview]
Message-ID: <20180403232647.GA64065@intel.com> (raw)
In-Reply-To: <CAHp75Ve-o0snErfyRt=Z2-GSY8e-zAoPWe3S+D=+y0rmM0b5Lw@mail.gmail.com>

On Tue, Apr 03, 2018 at 06:17:42AM -0600, Andy Shevchenko wrote:
> >> > If readq() is defined as two read operations in 32-bit code, main counter
> >> > rollover (low part overflow, high part increment) can happen between them.
> >> And how this contradicts ther current code?
> > It just does not make the code simpler,
> ...b/c you misread what I suggested.
> > rollover check is
> > still required if U-Boot is compiled as 32-bit code.
> > Can we do something like the following?
> Yes, but... why?
> What's wrong with replacing two sequential 32-bit reads with one 64-bit?

Doesn't readX/writeX imply a single I/O operation?
It may be misleading to define it as two.

Assuming MMX or SSE2 to be supported by all x86 processors, 64-bit I/O
registers can be accessed as a single operation even in 32-bit code:

static inline u64 readq(void *addr)
{
	u64 value;

	asm volatile ("movq (%0), %%xmm0" : : "r" (addr));
	asm volatile ("movq %%xmm0, %0" : "=m" (value));

	return value;
}

I can add these definitions to "asm/io.h".

  reply	other threads:[~2018-04-03 23:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 22:29 [U-Boot] [PATCH v2] timer: add High Precision Event Timers (HPET) support Ivan Gorinov
2018-03-30  9:52 ` Bin Meng
2018-03-30 19:46 ` Andy Shevchenko
2018-03-31  1:03   ` Ivan Gorinov
2018-03-31 12:31     ` Andy Shevchenko
2018-04-02 23:00       ` Ivan Gorinov
2018-04-03 12:17         ` Andy Shevchenko
2018-04-03 23:26           ` Ivan Gorinov [this message]
2018-04-04  4:15             ` Bin Meng
2018-04-04  4:40               ` Ivan Gorinov
2018-04-06 13:56                 ` Andy Shevchenko
2018-04-06 13:55             ` Andy Shevchenko

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=20180403232647.GA64065@intel.com \
    --to=ivan.gorinov@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.