Module Name: src
Committed By: nakayama
Date: Fri May 13 21:23:30 UTC 2016
Modified Files:
src/sys/arch/sparc64/sparc64: clock.c
Log Message:
Allocate interrupt handlers for clockintr and statintr dynamically.
To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/clock.c
diff -u src/sys/arch/sparc64/sparc64/clock.c:1.118 src/sys/arch/sparc64/sparc64/clock.c:1.119
--- src/sys/arch/sparc64/sparc64/clock.c:1.118 Sun Dec 13 18:41:09 2015
+++ src/sys/arch/sparc64/sparc64/clock.c Fri May 13 21:23:30 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.118 2015/12/13 18:41:09 christos Exp $ */
+/* $NetBSD: clock.c,v 1.119 2016/05/13 21:23:30 nakayama Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.118 2015/12/13 18:41:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.119 2016/05/13 21:23:30 nakayama Exp $");
#include "opt_multiprocessor.h"
@@ -72,7 +72,6 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
-#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/timetc.h>
#ifdef GPROF
@@ -129,11 +128,6 @@ int statmin; /* statclock interval - 1
int timerok;
#ifndef MULTIPROCESSOR
static int statscheddiv;
-#endif
-
-static struct intrhand level10 = { .ih_fun = clockintr, .ih_pil = PIL_CLOCK };
-#ifndef MULTIPROCESSOR
-static struct intrhand level14 = { .ih_fun = statintr, .ih_pil = PIL_STATCLOCK };
static struct intrhand *schedint;
#endif
@@ -293,18 +287,24 @@ timerattach(device_t parent, device_t se
(CPU_UPAID << INTMAP_TID_SHIFT));
/* Install the appropriate interrupt vector here */
- level10.ih_number = INTVEC(ma->ma_interrupts[0]);
- level10.ih_clr = &timerreg_4u.t_clrintr[0];
- intr_establish(PIL_CLOCK, true, &level10);
- printf(" irq vectors %lx", (u_long)level10.ih_number);
+ struct intrhand *level10 = intrhand_alloc();
+ level10->ih_fun = clockintr;
+ level10->ih_pil = PIL_CLOCK;
+ level10->ih_number = INTVEC(ma->ma_interrupts[0]);
+ level10->ih_clr = &timerreg_4u.t_clrintr[0];
+ intr_establish(PIL_CLOCK, true, level10);
+ printf(" irq vectors %lx", (u_long)level10->ih_number);
#ifndef MULTIPROCESSOR
/*
* On SMP kernel, don't establish interrupt to use it as timecounter.
*/
- level14.ih_number = INTVEC(ma->ma_interrupts[1]);
- level14.ih_clr = &timerreg_4u.t_clrintr[1];
- intr_establish(PIL_STATCLOCK, true, &level14);
- printf(" and %lx", (u_long)level14.ih_number);
+ struct intrhand *level14 = intrhand_alloc();
+ level14->ih_fun = statintr;
+ level14->ih_pil = PIL_STATCLOCK;
+ level14->ih_number = INTVEC(ma->ma_interrupts[1]);
+ level14->ih_clr = &timerreg_4u.t_clrintr[1];
+ intr_establish(PIL_STATCLOCK, true, level14);
+ printf(" and %lx", (u_long)level14->ih_number);
#endif
#if 0