From a1ddfabe35e7e4f63df5d89b275f08e21e7f6c8f Mon Sep 17 00:00:00 2001 From: ad Date: Tue, 29 Apr 2008 14:06:31 +0000 Subject: [PATCH] Mirror sparc and provide sparc_softintr stuff. There is no functional change, beyond renaming a function and putting back disestablish/schedule. PR kern/37540. --- sys/arch/sparc64/include/cpu.h | 6 ++++-- sys/arch/sparc64/sparc64/clock.c | 8 ++++---- sys/arch/sparc64/sparc64/intr.c | 23 +++++++++++++++++++---- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index cb2c0bdabb22..8389dbd96ed0 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -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; diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index 6013943acf79..5723dc45637a 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -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 -__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) diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c index 8e158299f2f1..f762e1eac3ad 100644 --- a/sys/arch/sparc64/sparc64/intr.c +++ b/sys/arch/sparc64/sparc64/intr.c @@ -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 -__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); +}