Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/macppc - read IRQs from state, not level reg...



details:   https://anonhg.NetBSD.org/src/rev/1dcc425ac664
branches:  trunk
changeset: 354437:1dcc425ac664
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Jun 16 18:48:22 2017 +0000

description:
- read IRQs from state, not level register in *_reenable_irq() so we get
  edge triggered ones too
- kmem_alloc() -> kmem_zalloc() for paranoia

diffstat:

 sys/arch/macppc/macppc/pic_heathrow.c |  10 +++++-----
 sys/arch/macppc/macppc/pic_ohare.c    |   8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r 6c79af0b754b -r 1dcc425ac664 sys/arch/macppc/macppc/pic_heathrow.c
--- a/sys/arch/macppc/macppc/pic_heathrow.c     Fri Jun 16 18:17:41 2017 +0000
+++ b/sys/arch/macppc/macppc/pic_heathrow.c     Fri Jun 16 18:48:22 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic_heathrow.c,v 1.10 2017/06/01 02:45:06 chs Exp $ */
+/*     $NetBSD: pic_heathrow.c,v 1.11 2017/06/16 18:48:22 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_heathrow.c,v 1.10 2017/06/01 02:45:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_heathrow.c,v 1.11 2017/06/16 18:48:22 macallan Exp $");
 
 #include "opt_interrupt.h"
 
@@ -107,7 +107,7 @@
        struct heathrow_ops *heathrow;
        struct pic_ops *pic;
 
-       heathrow = kmem_alloc(sizeof(struct heathrow_ops), KM_SLEEP);
+       heathrow = kmem_zalloc(sizeof(struct heathrow_ops), KM_SLEEP);
        pic = &heathrow->pic;
 
        pic->pic_numintrs = 64;
@@ -160,7 +160,7 @@
        if (irq & 0x20) {
                heathrow->enable_mask_h |= mask;
                out32rb(INT_ENABLE_REG_H, heathrow->enable_mask_h);
-               levels = in32rb(INT_LEVEL_REG_H);
+               levels = in32rb(INT_STATE_REG_H);
                if (levels & mask) {
                        pic_mark_pending(pic->pic_intrbase + irq);
                        out32rb(INT_CLEAR_REG_H, mask);
@@ -168,7 +168,7 @@
        } else {
                heathrow->enable_mask_l |= mask;
                out32rb(INT_ENABLE_REG_L, heathrow->enable_mask_l);
-               levels = in32rb(INT_LEVEL_REG_L);
+               levels = in32rb(INT_STATE_REG_L);
                if (levels & mask) {
                        pic_mark_pending(pic->pic_intrbase + irq);
                        out32rb(INT_CLEAR_REG_L, mask);
diff -r 6c79af0b754b -r 1dcc425ac664 sys/arch/macppc/macppc/pic_ohare.c
--- a/sys/arch/macppc/macppc/pic_ohare.c        Fri Jun 16 18:17:41 2017 +0000
+++ b/sys/arch/macppc/macppc/pic_ohare.c        Fri Jun 16 18:48:22 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic_ohare.c,v 1.14 2017/06/01 02:45:06 chs Exp $ */
+/*     $NetBSD: pic_ohare.c,v 1.15 2017/06/16 18:48:22 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_ohare.c,v 1.14 2017/06/01 02:45:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_ohare.c,v 1.15 2017/06/16 18:48:22 macallan Exp $");
 
 #include "opt_interrupt.h"
 
@@ -116,7 +116,7 @@
        struct pic_ops *pic;
        int i;
 
-       ohare = kmem_alloc(sizeof(struct ohare_ops), KM_SLEEP);
+       ohare = kmem_zalloc(sizeof(struct ohare_ops), KM_SLEEP);
        pic = &ohare->pic;
 
        pic->pic_numintrs = OHARE_NIRQ;
@@ -179,7 +179,7 @@
 
        ohare->enable_mask |= mask;
        out32rb(INT_ENABLE_REG, ohare->enable_mask);
-       levels = in32rb(INT_LEVEL_REG);
+       levels = in32rb(INT_STATE_REG);
        if (levels & mask) {
                pic_mark_pending(pic->pic_intrbase + irq);
                out32rb(INT_CLEAR_REG, mask);



Home | Main Index | Thread Index | Old Index