Module Name: src
Committed By: macallan
Date: Tue Mar 13 18:24:54 UTC 2012
Modified Files:
src/sys/arch/macppc/macppc: pic_heathrow.c pic_ohare.c
Log Message:
malloc() -> kmem_alloc()
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/macppc/pic_heathrow.c
cvs rdiff -u -r1.10 -r1.11 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.7 src/sys/arch/macppc/macppc/pic_heathrow.c:1.8
--- src/sys/arch/macppc/macppc/pic_heathrow.c:1.7 Thu Jul 7 01:26:37 2011
+++ src/sys/arch/macppc/macppc/pic_heathrow.c Tue Mar 13 18:24:54 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_heathrow.c,v 1.7 2011/07/07 01:26:37 mrg Exp $ */
+/* $NetBSD: pic_heathrow.c,v 1.8 2012/03/13 18:24:54 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,12 +27,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_heathrow.c,v 1.7 2011/07/07 01:26:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_heathrow.c,v 1.8 2012/03/13 18:24:54 macallan Exp $");
#include "opt_interrupt.h"
#include <sys/param.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/kernel.h>
#include <machine/pio.h>
@@ -108,7 +108,7 @@ setup_heathrow(uint32_t addr)
struct heathrow_ops *heathrow;
struct pic_ops *pic;
- heathrow = malloc(sizeof(struct heathrow_ops), M_DEVBUF, M_NOWAIT);
+ heathrow = kmem_alloc(sizeof(struct heathrow_ops), KM_SLEEP);
KASSERT(heathrow != NULL);
pic = &heathrow->pic;
Index: src/sys/arch/macppc/macppc/pic_ohare.c
diff -u src/sys/arch/macppc/macppc/pic_ohare.c:1.10 src/sys/arch/macppc/macppc/pic_ohare.c:1.11
--- src/sys/arch/macppc/macppc/pic_ohare.c:1.10 Thu Jul 7 01:26:37 2011
+++ src/sys/arch/macppc/macppc/pic_ohare.c Tue Mar 13 18:24:54 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_ohare.c,v 1.10 2011/07/07 01:26:37 mrg Exp $ */
+/* $NetBSD: pic_ohare.c,v 1.11 2012/03/13 18:24:54 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,12 +27,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_ohare.c,v 1.10 2011/07/07 01:26:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_ohare.c,v 1.11 2012/03/13 18:24:54 macallan Exp $");
#include "opt_interrupt.h"
#include <sys/param.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/kernel.h>
#include <machine/pio.h>
@@ -118,7 +118,7 @@ setup_ohare(uint32_t addr, int is_gc)
struct pic_ops *pic;
int i;
- ohare = malloc(sizeof(struct ohare_ops), M_DEVBUF, M_NOWAIT);
+ ohare = kmem_alloc(sizeof(struct ohare_ops), KM_SLEEP);
KASSERT(ohare != NULL);
pic = &ohare->pic;
@@ -238,6 +238,7 @@ ohare_get_irq(struct pic_ops *pic, int m
bit = 31 - __builtin_clz(ohare->pending_events);
mask = 1 << bit;
+
if ((ohare->pending_events & ~mask) == 0) {
ohare->pending_events = 0;
@@ -265,8 +266,14 @@ ohare_get_irq(struct pic_ops *pic, int m
evt = ohare->pending_events & ohare->irqs[lvl];
if (evt == 0) {
+#ifdef OHARE_DEBUG
aprint_verbose("%s: spurious interrupt\n",
ohare->pic.pic_name);
+ printf("levels: %08x\n", in32rb(INT_LEVEL_REG));
+ printf("states: %08x\n", in32rb(INT_STATE_REG));
+ printf("enable: %08x\n", in32rb(INT_ENABLE_REG));
+ printf("events: %08x\n", ohare->pending_events);
+#endif
evt = ohare->pending_events;
}