From owner-freebsd-alpha Fri Nov 27 03:45:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA11151 for freebsd-alpha-outgoing; Fri, 27 Nov 1998 03:45:28 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from mail.sat.t.u-tokyo.ac.jp (dryad.sat.t.u-tokyo.ac.jp [133.11.156.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA11144 for ; Fri, 27 Nov 1998 03:45:25 -0800 (PST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from ett.sat.t.u-tokyo.ac.jp (ett.sat.t.u-tokyo.ac.jp [133.11.156.43]) by mail.sat.t.u-tokyo.ac.jp (8.8.6/3.4Wbeta6-SAT1.0) with ESMTP id UAA03914 for ; Fri, 27 Nov 1998 20:45:18 +0900 (JST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from localhost by ett.sat.t.u-tokyo.ac.jp (8.8.8/sat-V0.6) id UAA29251; Fri, 27 Nov 1998 20:45:18 +0900 (JST) To: freebsd-alpha@FreeBSD.ORG Subject: vmstat -i X-Face: OE([KxWyJI0r[R~S/>7ia}SJ)i%a,$-9%7{*yihQk|]gl}2p#"oXmX/fT}Bn7:#j7i14gu$ jgR\S*&C3R/pJX Date: Fri, 27 Nov 1998 20:45:17 +0900 From: Hidetoshi Shimokawa X-Dispatcher: imput version 980905(IM100) Lines: 232 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, Here is a patch to make vmstat -i work correctly. It needs NetBSD's src/sys/arch/alpha/include/intrcnt.h in addtion. I don't know whether INTRCNT_EB164_IRQ is a good choice for cia. /\ Hidetoshi Shimokawa \/ simokawa@sat.t.u-tokyo.ac.jp PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp Index: alpha/interrupt.c =================================================================== RCS file: /pub/FreeBSD-CVS/src/sys/alpha/alpha/interrupt.c,v retrieving revision 1.7 diff -c -r1.7 interrupt.c *** interrupt.c 1998/11/18 23:51:40 1.7 --- interrupt.c 1998/11/25 12:33:18 *************** *** 50,63 **** #include #include - #if 0 #ifdef EVCNT_COUNTERS #include struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */ #else #include #endif - #endif volatile int mc_expected, mc_received; --- 50,61 ---- *************** *** 84,95 **** case ALPHA_INTR_CLOCK: /* clock interrupt */ cnt.v_intr++; - #if 0 #ifdef EVCNT_COUNTERS clock_intr_evcnt.ev_count++; #else intrcnt[INTRCNT_CLOCK]++; - #endif #endif if (platform.clockintr) (*platform.clockintr)(framep); --- 82,91 ---- Index: alpha/locore.s =================================================================== RCS file: /pub/FreeBSD-CVS/src/sys/alpha/alpha/locore.s,v retrieving revision 1.5 diff -c -r1.5 locore.s *** locore.s 1998/11/15 00:50:59 1.5 --- locore.s 1998/11/25 14:07:36 *************** *** 56,61 **** --- 56,66 ---- #include #include + #ifndef EVCNT_COUNTERS + #define _LOCORE + #include + #endif + /* * PTmap is recursive pagemap at top of virtual address space. * Within PTmap, the lev1 and lev0 page tables can be found. *************** *** 296,305 **** /* XXX: make systat/vmstat happy */ .data EXPORT(intrnames) ! ASCIZ "foobar" EXPORT(eintrnames) .align 3 EXPORT(intrcnt) ! .quad 0 EXPORT(eintrcnt) .text --- 301,314 ---- /* XXX: make systat/vmstat happy */ .data EXPORT(intrnames) ! #ifndef EVCNT_COUNTERS ! INTRNAMES_DEFINITION ! #endif EXPORT(eintrnames) .align 3 EXPORT(intrcnt) ! #ifndef EVCNT_COUNTERS ! INTRCNT_DEFINITION ! #endif EXPORT(eintrcnt) .text Index: isa/isa.c =================================================================== RCS file: /pub/FreeBSD-CVS/src/sys/alpha/isa/isa.c,v retrieving revision 1.7 diff -c -r1.7 isa.c *** isa.c 1998/11/18 23:53:11 1.7 --- isa.c 1998/11/27 08:50:04 *************** *** 37,42 **** --- 37,43 ---- #include #include #include + #include #include MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device"); *************** *** 627,632 **** --- 628,634 ---- struct isa_intr *ii = arg; int irq = ii->irq; + intrcnt[INTRCNT_ISA_IRQ + irq] ++; ii->intr(ii->arg); if (ii->irq > 7) Index: pci/cia.c =================================================================== RCS file: /pub/FreeBSD-CVS/src/sys/alpha/pci/cia.c,v retrieving revision 1.11 diff -c -r1.11 cia.c *** cia.c 1998/11/15 18:25:16 1.11 --- cia.c 1998/11/27 11:22:55 *************** *** 96,101 **** --- 96,102 ---- #include #include #include + #include #include #include *************** *** 104,109 **** --- 105,111 ---- #include #include #include + #include #include #include #include *************** *** 820,841 **** return 0; } static int cia_setup_intr(device_t dev, device_t child, struct resource *irq, driver_intr_t *intr, void *arg, void **cookiep) { ! struct alpha_intr *i; int error; error = rman_activate_resource(irq); if (error) return error; error = alpha_setup_intr(0x900 + (irq->r_start << 4), ! intr, arg, cookiep); ! if (error) return error; /* Enable PCI interrupt */ platform.pci_intr_enable(irq->r_start); --- 822,876 ---- return 0; } + struct pci_intr { + #if 0 + void *ih; + #endif + driver_intr_t *intr; + void *arg; + int irq; + }; + + /* + * Wrap PCI interrupt just for counting + */ + + static void + pci_handle_intr(void *arg) + { + struct pci_intr *pi = arg; + int irq = pi->irq; + + intrcnt[INTRCNT_EB164_IRQ + irq] ++; + pi->intr(pi->arg); + } + + static int cia_setup_intr(device_t dev, device_t child, struct resource *irq, driver_intr_t *intr, void *arg, void **cookiep) { ! struct pci_intr *pi; int error; error = rman_activate_resource(irq); if (error) return error; + pi = malloc(sizeof(struct pci_intr), M_DEVBUF, M_NOWAIT); + if (!pi) + return ENOMEM; + pi->intr = intr; + pi->arg = arg; + pi->irq = irq->r_start; + error = alpha_setup_intr(0x900 + (irq->r_start << 4), ! pci_handle_intr, pi, cookiep); ! if (error) { ! free(pi, M_DEVBUF); return error; + } /* Enable PCI interrupt */ platform.pci_intr_enable(irq->r_start); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message