Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/powerpc/pic/pic_mpcsoc.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/powerpc/pic/pic_mpcsoc.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -p -r1.2 -r1.2.2.1 --- src/sys/arch/powerpc/pic/pic_mpcsoc.c 2011/06/20 06:21:45 1.2 +++ src/sys/arch/powerpc/pic/pic_mpcsoc.c 2012/04/17 00:06:48 1.2.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_mpcsoc.c,v 1.2 2011/06/20 06:21:45 matt Exp $ */ +/* $NetBSD: pic_mpcsoc.c,v 1.2.2.1 2012/04/17 00:06:48 yamt Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,10 +27,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_mpcsoc.c,v 1.2 2011/06/20 06:21:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_mpcsoc.c,v 1.2.2.1 2012/04/17 00:06:48 yamt Exp $"); #include -#include +#include #include #include @@ -89,7 +89,7 @@ setup_mpcpic(void *addr) u_int x; openpic_base = addr; - ops = malloc(sizeof(struct openpic_ops), M_DEVBUF, M_NOWAIT); + ops = kmem_alloc(sizeof(*ops), KM_SLEEP); KASSERT(ops != NULL); self = &ops->pic; @@ -143,7 +143,7 @@ setup_mpcpic(void *addr) } void -mpcpic_reserv16() +mpcpic_reserv16(void) { extern int max_base; /* intr.c */ @@ -161,9 +161,18 @@ mpcpic_establish_irq(struct pic_ops *pic x = irq; x |= OPENPIC_IMASK; - x |= (i8259iswired && irq == 0) ? - OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE; - x |= (type == IST_EDGE) ? OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL; + + if ((i8259iswired && irq == 0) || + type == IST_EDGE_RISING || type == IST_LEVEL_HIGH) + x |= OPENPIC_POLARITY_POSITIVE; + else + x |= OPENPIC_POLARITY_NEGATIVE; + + if (type == IST_EDGE_FALLING || type == IST_EDGE_RISING) + x |= OPENPIC_SENSE_EDGE; + else + x |= OPENPIC_SENSE_LEVEL; + x |= realpri << OPENPIC_PRIORITY_SHIFT; openpic_write(MPCPIC_IVEC(irq), x);