Module Name: src
Committed By: cherry
Date: Fri May 11 13:24:46 UTC 2018
Modified Files:
src/sys/arch/xen/xen: clock.c
Log Message:
Fixes port-xen/53267
re-educate xen_clock_handler() how to use the interrupt stackframe.
The current regs value passed in is *ci, and thus invalid.
Reported and tested by kre@. See PR 53267 for more details.
To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/xen/xen/clock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.65 src/sys/arch/xen/xen/clock.c:1.66
--- src/sys/arch/xen/xen/clock.c:1.65 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/clock.c Fri May 11 13:24:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $ */
+/* $NetBSD: clock.c,v 1.66 2018/05/11 13:24:46 cherry Exp $ */
/*
*
@@ -29,7 +29,7 @@
#include "opt_xen.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.66 2018/05/11 13:24:46 cherry Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -49,7 +49,8 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
#include <dev/clock_subr.h>
#include <x86/rtc.h>
-static int xen_timer_handler(void *);
+static int xen_timer_handler(void *, struct intrframe *);
+static int (*xen_timer_handler_stub)(void *) = (void *) xen_timer_handler;
static struct intrhand *ih;
/* A timecounter: Xen system_time extrapolated with a TSC. */
@@ -524,7 +525,7 @@ xen_resumeclocks(struct cpu_info *ci)
KASSERT(evtch != -1);
ih = intr_establish_xname(0, &xen_pic, evtch, IST_LEVEL, IPL_CLOCK,
- xen_timer_handler, ci, true, "clock");
+ xen_timer_handler_stub, ci, true, "clock");
KASSERT(ih != NULL);
@@ -535,11 +536,10 @@ xen_resumeclocks(struct cpu_info *ci)
/* ARGSUSED */
static int
-xen_timer_handler(void *arg)
+xen_timer_handler(void *arg, struct intrframe *regs)
{
int64_t delta;
struct cpu_info *ci = curcpu();
- struct intrframe *regs = arg;
int err;
again: