Mirror sparc and provide sparc_softintr stuff. There is no functional

change, beyond renaming a function and putting back disestablish/schedule.
PR kern/37540.
This commit is contained in:
ad 2008-04-29 14:06:31 +00:00
parent 254bed5bd3
commit a1ddfabe35
3 changed files with 27 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.79 2008/04/09 14:58:23 nakayama Exp $ */
/* $NetBSD: cpu.h,v 1.80 2008/04/29 14:06:31 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -316,7 +316,9 @@ extern struct intrhand *intrhand[];
extern struct intrhand *intrlev[MAXINTNUM];
void intr_establish(int level, struct intrhand *);
struct intrhand *init_softint(int, int (*)(void *));
void *sparc_softintr_establish(int, int (*)(void *), void *);
void sparc_softintr_schedule(void *);
void sparc_softintr_disestablish(void *);
/* disksubr.c */
struct dkbad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.95 2008/04/14 17:43:02 nakayama Exp $ */
/* $NetBSD: clock.c,v 1.96 2008/04/29 14:06:31 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.95 2008/04/14 17:43:02 nakayama Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.96 2008/04/29 14:06:31 ad Exp $");
#include "opt_multiprocessor.h"
@ -319,7 +319,7 @@ tickintr_establish(int pil, int (*fun)(void *))
struct intrhand *ih;
struct cpu_info *ci = curcpu();
ih = init_softint(pil, fun);
ih = sparc_softintr_establish(pil, fun, NULL);
ih->ih_number = 1;
if (CPU_IS_PRIMARY(ci))
intr_establish(pil, ih);
@ -427,7 +427,7 @@ cpu_initclocks()
/*
* Establish scheduler softint.
*/
schedint = init_softint(PIL_SCHED, schedintr);
schedint = sparc_softintr_establish(PIL_SCHED, schedintr, NULL);
schedhz = 16; /* 16Hz is best according to kern/kern_clock.c */
statscheddiv = stathz / schedhz;
if (statscheddiv <= 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.57 2008/03/17 04:04:00 nakayama Exp $ */
/* $NetBSD: intr.c,v 1.58 2008/04/29 14:06:31 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.57 2008/03/17 04:04:00 nakayama Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.58 2008/04/29 14:06:31 ad Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -243,8 +243,8 @@ intr_establish(int level, struct intrhand *ih)
/*
* Prepare an interrupt handler used for send_softint.
*/
struct intrhand *
init_softint(int pil, int (*fun)(void *))
void *
sparc_softintr_establish(int pil, int (*fun)(void *), void *arg)
{
struct intrhand *ih;
@ -256,3 +256,18 @@ init_softint(int pil, int (*fun)(void *))
ih->ih_pil = pil;
return ih;
}
void
sparc_softintr_disestablish(void *cookie)
{
free(cookie, M_DEVBUF);
}
void
sparc_softintr_schedule(void *cookie)
{
struct intrhand *ih = (struct intrhand *)cookie;
send_softint(-1, ih->ih_pil, ih);
}