From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>
Subject: [Patch 1/4] x86/hpet: Basic cleanup
Date: Mon, 7 Oct 2013 14:26:18 +0100 [thread overview]
Message-ID: <1381152381-19744-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1381152381-19744-1-git-send-email-andrew.cooper3@citrix.com>
* Strip trailing whitespace
* Remove redundant definitions
* Update stale documentation links
* Move hpet_address into __initdata
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
xen/arch/x86/hpet.c | 6 +++---
xen/arch/x86/hvm/hpet.c | 18 +++++++++---------
xen/include/asm-x86/hpet.h | 6 ++----
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 7e0d332..99882b1 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -1,6 +1,6 @@
/******************************************************************************
* arch/x86/hpet.c
- *
+ *
* HPET management.
*/
@@ -50,7 +50,7 @@ static unsigned int __read_mostly num_hpets_used;
DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
-unsigned long __read_mostly hpet_address;
+unsigned long __initdata hpet_address;
u8 __initdata hpet_blockid;
/*
@@ -540,7 +540,7 @@ static void handle_rtc_once(uint8_t index, uint8_t value)
{
if ( index != RTC_REG_B )
return;
-
+
/* RTC Reg B, contain PIE/AIE/UIE */
if ( value & (RTC_PIE | RTC_AIE | RTC_UIE ) )
{
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4b4b905..4324b52 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -47,7 +47,7 @@
/* can be routed to IOAPIC.redirect_table[23..20] */
#define HPET_TN_INT_ROUTE_CAP (0x00f00000ULL \
- << HPET_TN_INT_ROUTE_CAP_SHIFT)
+ << HPET_TN_INT_ROUTE_CAP_SHIFT)
#define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
<< HPET_TN_INT_ROUTE_CAP_SHIFT)
@@ -79,7 +79,7 @@ static inline uint64_t hpet_read_maincounter(HPETState *h)
if ( hpet_enabled(h) )
return guest_time_hpet(h) + h->mc_offset;
- else
+ else
return h->hpet.mc64;
}
@@ -100,7 +100,7 @@ static uint64_t hpet_get_comparator(HPETState *h, unsigned int tn)
h->hpet.comparator64[tn] = comparator;
}
}
-
+
/* truncate if timer is in 32 bit mode */
if ( timer_is_32bit(h, tn) )
comparator = (uint32_t)comparator;
@@ -249,7 +249,7 @@ static void hpet_set_timer(HPETState *h, unsigned int tn)
irq = timer_int_route(h, tn);
/*
- * diff is the time from now when the timer should fire, for a periodic
+ * diff is the time from now when the timer should fire, for a periodic
* timer we also need the period which may be different because time may
* have elapsed between the time the comparator was written and the timer
* being enabled (now).
@@ -331,7 +331,7 @@ static int hpet_write(
h->hpet.mc64 = new_val;
if ( hpet_enabled(h) )
{
- gdprintk(XENLOG_WARNING,
+ gdprintk(XENLOG_WARNING,
"HPET: writing main counter but it's not halted!\n");
for ( i = 0; i < HPET_TIMER_NUM; i++ )
if ( timer_enabled(h, i) )
@@ -396,7 +396,7 @@ static int hpet_write(
* timer's accumulator." That is, set the comparator without
* adjusting the period. Much the same as just setting the
* comparator on an enabled one-shot timer.
- *
+ *
* This configuration bit clears when the comparator is written.
*/
h->hpet.timers[tn].config &= ~HPET_TN_SETVAL;
@@ -553,7 +553,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
hp->hpet.timers[i].cmp = cmp;
}
#undef C
-
+
/* Recalculate the offset between the main counter and guest time */
hp->mc_offset = hp->hpet.mc64 - guest_time_hpet(hp);
@@ -563,7 +563,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
for ( i = 0; i < HPET_TIMER_NUM; i++ )
if ( timer_enabled(hp, i) )
hpet_set_timer(hp, i);
-
+
spin_unlock(&hp->lock);
return 0;
@@ -595,7 +595,7 @@ void hpet_init(struct vcpu *v)
for ( i = 0; i < HPET_TIMER_NUM; i++ )
{
- h->hpet.timers[i].config =
+ h->hpet.timers[i].config =
HPET_TN_INT_ROUTE_CAP | HPET_TN_64BIT_CAP | HPET_TN_PERIODIC_CAP;
h->hpet.timers[i].cmp = ~0ULL;
h->pt[i].source = PTSRC_isa;
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 98c1237..875f1de 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -3,8 +3,8 @@
/*
* Documentation on HPET can be found at:
- * http://www.intel.com/ial/home/sp/pcmmspec.htm
- * ftp://download.intel.com/ial/home/sp/mmts098.pdf
+ * http://www.intel.com/content/dam/www/public/us/en/documents/
+ * technical-specifications/software-developers-hpet-spec-1-0a.pdf
*/
#define HPET_MMAP_SIZE 1024
@@ -24,9 +24,7 @@
#define HPET_ID_NUMBER 0x00001f00
#define HPET_ID_REV 0x000000ff
#define HPET_ID_NUMBER_SHIFT 8
-
#define HPET_ID_VENDOR_SHIFT 16
-#define HPET_ID_VENDOR_8086 0x8086
#define HPET_CFG_ENABLE 0x001
#define HPET_CFG_LEGACY 0x002
--
1.7.10.4
next prev parent reply other threads:[~2013-10-07 13:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 13:26 [Patch 0/4] HPET general fixes Andrew Cooper
2013-10-07 13:26 ` Andrew Cooper [this message]
2013-10-07 13:26 ` [Patch 2/4] x86/hpet: Sanitise HPET ACPI table and warn about multiple tables Andrew Cooper
2013-10-07 13:45 ` Jan Beulich
2013-10-07 13:55 ` Andrew Cooper
2013-10-07 14:26 ` Jan Beulich
2013-10-07 13:26 ` [Patch 3/4] x86/hpet: Fix ambiguity in broadcast info message Andrew Cooper
2013-10-07 13:48 ` Jan Beulich
2013-10-07 13:26 ` [Patch 4/4] x86/hpet: Don't clear reserved bits in the General Configuration Register Andrew Cooper
2013-10-07 13:55 ` Jan Beulich
2013-10-07 14:02 ` Andrew Cooper
2013-10-07 14:28 ` Jan Beulich
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=1381152381-19744-2-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.org \
/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 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).