From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH v2 5/5] x86/hpet: debug keyhandlers Date: Thu, 7 Nov 2013 15:28:25 +0000 Message-ID: <1383838105-9775-6-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 List-Id: xen-devel@lists.xenproject.org Debug key for dumping HPET state. This patch is not intended for committing. --- xen/arch/x86/hpet.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index 6deb730..c96a283 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -694,6 +695,21 @@ int hpet_legacy_irq_tick(void) static u32 *hpet_boot_cfg; +static void do_hpet_dump_state(unsigned char key) +{ + unsigned i; + printk("'%c' pressed - dumping HPET state\n", key); + + for ( i = 0; i < num_hpets_used; ++i ) + dump_hpet_timer(i); +} + +static struct keyhandler hpet_dump_state = { + .irq_callback = 0, + .u.fn = do_hpet_dump_state, + .desc = "Dump hpet state" +}; + u64 __init hpet_setup(void) { static u64 __initdata hpet_rate; @@ -751,6 +767,8 @@ u64 __init hpet_setup(void) hpet_rate = 1000000000000000ULL; /* 10^15 */ (void)do_div(hpet_rate, hpet_period); + register_keyhandler('1', &hpet_dump_state); + return hpet_rate; } -- 1.7.10.4