Module Name: src Committed By: dyoung Date: Mon Mar 22 23:00:08 UTC 2010
Modified Files: src/sys/dev/ic: com.c Log Message: MI code should not compare bus_space_tag_t! Introduce tags_are_equal() for "comparing" two bus_space_tag_t's. It is always true. Everywhere that com(4) compares two tags, it compares to I/O base addresses, too; comparing the base addresses should suffice. TBD Clean this up more thoroughly. To generate a diff of this commit: cvs rdiff -u -r1.295 -r1.296 src/sys/dev/ic/com.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/dev/ic/com.c diff -u src/sys/dev/ic/com.c:1.295 src/sys/dev/ic/com.c:1.296 --- src/sys/dev/ic/com.c:1.295 Wed Feb 24 22:37:58 2010 +++ src/sys/dev/ic/com.c Mon Mar 22 23:00:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.295 2010/02/24 22:37:58 dyoung Exp $ */ +/* $NetBSD: com.c,v 1.296 2010/03/22 23:00:08 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.295 2010/02/24 22:37:58 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.296 2010/03/22 23:00:08 dyoung Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -263,6 +263,13 @@ #define COM_BARRIER(r, f) \ bus_space_barrier((r)->cr_iot, (r)->cr_ioh, 0, (r)->cr_nports, (f)) +/* XXX Comparing bus_space_tag_t's is not allowed! */ +static bool +tags_are_equal(const bus_space_tag_t lt, const bus_space_tag_t rt) +{ + return true; +} + /*ARGSUSED*/ int comspeed(long speed, long frequency, int type) @@ -392,7 +399,7 @@ CSR_WRITE_1(regsp, COM_REG_IER, sc->sc_ier); - if (regsp->cr_iot == comcons_info.regs.cr_iot && + if (tags_are_equal(regsp->cr_iot, comcons_info.regs.cr_iot) && regsp->cr_iobase == comcons_info.regs.cr_iobase) { comconsattached = 1; @@ -541,7 +548,7 @@ * exclusive use. If it's the console _and_ the * kgdb device, it doesn't. */ - if (regsp->cr_iot == comkgdbregs.cr_iot && + if (tags_are_equal(regsp->cr_iot, comkgdbregs.cr_iot) && regsp->cr_iobase == comkgdbregs.cr_iobase) { if (!ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) { com_kgdb_attached = 1; @@ -2302,7 +2309,7 @@ { int res; - if (regsp->cr_iot == comcons_info.regs.cr_iot && + if (tags_are_equal(regsp->cr_iot, comcons_info.regs.cr_iot) && regsp->cr_iobase == comcons_info.regs.cr_iobase) { #if !defined(DDB) return (EBUSY); /* cannot share with console */ @@ -2371,12 +2378,12 @@ bus_space_handle_t help; if (!comconsattached && - iot == comcons_info.regs.cr_iot && + tags_are_equal(iot, comcons_info.regs.cr_iot) && iobase == comcons_info.regs.cr_iobase) help = comcons_info.regs.cr_ioh; #ifdef KGDB else if (!com_kgdb_attached && - iot == comkgdbregs.cr_iot && iobase == comkgdbregs.cr_iobase) + tags_are_equal(iot, comkgdbregs.cr_iot) && iobase == comkgdbregs.cr_iobase) help = comkgdbregs.cr_ioh; #endif else