Module Name:    src
Committed By:   macallan
Date:           Fri Jun 16 18:48:22 UTC 2017

Modified Files:
        src/sys/arch/macppc/macppc: pic_heathrow.c pic_ohare.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/macppc/macppc/pic_heathrow.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/macppc/pic_ohare.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/macppc/macppc/pic_heathrow.c
diff -u src/sys/arch/macppc/macppc/pic_heathrow.c:1.10 src/sys/arch/macppc/macppc/pic_heathrow.c:1.11
--- src/sys/arch/macppc/macppc/pic_heathrow.c:1.10	Thu Jun  1 02:45:06 2017
+++ src/sys/arch/macppc/macppc/pic_heathrow.c	Fri Jun 16 18:48:22 2017
@@ -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 @@ setup_heathrow(uint32_t addr)
 	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 @@ heathrow_reenable_irq(struct pic_ops *pi
 	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 @@ heathrow_reenable_irq(struct pic_ops *pi
 	} 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);

Index: src/sys/arch/macppc/macppc/pic_ohare.c
diff -u src/sys/arch/macppc/macppc/pic_ohare.c:1.14 src/sys/arch/macppc/macppc/pic_ohare.c:1.15
--- src/sys/arch/macppc/macppc/pic_ohare.c:1.14	Thu Jun  1 02:45:06 2017
+++ src/sys/arch/macppc/macppc/pic_ohare.c	Fri Jun 16 18:48:22 2017
@@ -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 @@ setup_ohare(uint32_t addr, int is_gc)
 	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_reenable_irq(struct pic_ops *pic, 
 
 	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);

Reply via email to