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 malloc() -> kmem_alloc()
details: https://anonhg.NetBSD.org/src/rev/eb7178057ca2
branches: trunk
changeset: 778031:eb7178057ca2
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Mar 13 18:24:54 2012 +0000
description:
malloc() -> kmem_alloc()
diffstat:
sys/arch/macppc/macppc/pic_heathrow.c | 8 ++++----
sys/arch/macppc/macppc/pic_ohare.c | 15 +++++++++++----
2 files changed, 15 insertions(+), 8 deletions(-)
diffs (89 lines):
diff -r 0d079a6a248e -r eb7178057ca2 sys/arch/macppc/macppc/pic_heathrow.c
--- a/sys/arch/macppc/macppc/pic_heathrow.c Tue Mar 13 17:26:05 2012 +0000
+++ b/sys/arch/macppc/macppc/pic_heathrow.c Tue Mar 13 18:24:54 2012 +0000
@@ -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 @@
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;
diff -r 0d079a6a248e -r eb7178057ca2 sys/arch/macppc/macppc/pic_ohare.c
--- a/sys/arch/macppc/macppc/pic_ohare.c Tue Mar 13 17:26:05 2012 +0000
+++ b/sys/arch/macppc/macppc/pic_ohare.c Tue Mar 13 18:24:54 2012 +0000
@@ -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 @@
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 @@
bit = 31 - __builtin_clz(ohare->pending_events);
mask = 1 << bit;
+
if ((ohare->pending_events & ~mask) == 0) {
ohare->pending_events = 0;
@@ -265,8 +266,14 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index