From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH v2 3/5] x86/hpet: Post cleanup Date: Thu, 7 Nov 2013 15:28:23 +0000 Message-ID: <1383838105-9775-4-git-send-email-andrew.cooper3@citrix.com> References: <1383838105-9775-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383838105-9775-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich , Tim Deegan List-Id: xen-devel@lists.xenproject.org These changes are ones which were able to be pulled out of the previous patch. They are all misc cleanup without functional implications * Shift HPET_EVT_* definitions up now that USED has moved out * Shuffle struct hpet_event_channel ** Reflow horizontally and comment current use ** Promote 'shift' to unsigned. It is the constant 32 but can be more easily optimised. ** Move 'flags' up to fill 4 byte hole ** Move 'cpumask' and 'lock' into second cache line as they are diried from other cpus Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich CC: Tim Deegan --- xen/arch/x86/hpet.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index 47d643c..e467a78 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -19,22 +19,22 @@ #define MAX_DELTA_NS MILLISECS(10*1000) #define MIN_DELTA_NS MICROSECS(20) -#define HPET_EVT_DISABLE_BIT 1 +#define HPET_EVT_DISABLE_BIT 0 #define HPET_EVT_DISABLE (1 << HPET_EVT_DISABLE_BIT) -#define HPET_EVT_LEGACY_BIT 2 +#define HPET_EVT_LEGACY_BIT 1 #define HPET_EVT_LEGACY (1 << HPET_EVT_LEGACY_BIT) struct hpet_event_channel { - unsigned long mult; - int shift; - s_time_t next_event; - cpumask_var_t cpumask; - spinlock_t lock; - unsigned int idx; /* physical channel idx */ - unsigned int cpu; /* msi target */ - struct msi_desc msi;/* msi state */ - unsigned int flags; /* HPET_EVT_x */ + unsigned long mult; /* tick <-> time conversion */ + unsigned int shift; /* tick <-> time conversion */ + unsigned int flags; /* HPET_EVT_x */ + s_time_t next_event; /* expected time of next interrupt */ + unsigned int idx; /* HPET counter index */ + unsigned int cpu; /* owner of channel (or -1) */ + struct msi_desc msi; /* msi state */ + cpumask_var_t cpumask; /* cpus wishing to be woken */ + spinlock_t lock; } __cacheline_aligned; static struct hpet_event_channel *__read_mostly hpet_events; -- 1.7.10.4