don't clobber bus_space_{,un}map macros

This commit is contained in:
mikel 1997-08-06 04:52:29 +00:00
parent 611f2c3b46
commit d3174941cd
2 changed files with 13 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: isapnp.c,v 1.7 1997/08/03 08:12:21 mikel Exp $ */
/* $NetBSD: isapnp.c,v 1.8 1997/08/06 04:52:31 mikel Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@ -185,7 +185,9 @@ isapnp_free_region(t, r)
bus_space_tag_t t;
struct isapnp_region *r;
{
#ifdef _KERNEL
bus_space_unmap(t, r->h, r->length);
#endif
}
@ -199,8 +201,11 @@ isapnp_alloc_region(t, r)
{
int error = 0;
for (r->base = r->minbase; r->base <= r->maxbase; r->base += r->align) {
for (r->base = r->minbase; r->base <= r->maxbase;
r->base += r->align) {
#ifdef _KERNEL
error = bus_space_map(t, r->base, r->length, 0, &r->h);
#endif
if (error == 0)
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: isapnpvar.h,v 1.4 1997/08/03 08:12:26 mikel Exp $ */
/* $NetBSD: isapnpvar.h,v 1.5 1997/08/06 04:52:29 mikel Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@ -51,9 +51,9 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
#ifndef _KERNEL
# include <stdlib.h>
# include <string.h>
# include <unistd.h>
# include <stdlib.h>
# define ISAPNP_WRITE_ADDR(sc, v) outb(ISAPNP_ADDR, v)
# define ISAPNP_WRITE_DATA(sc, v) outb(ISAPNP_WRDATA, v)
@ -63,10 +63,6 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
# define ISAPNP_MALLOC(a) malloc(a)
# define ISAPNP_FREE(a) free(a)
# undef bus_space_map
# define bus_space_map(a, b, c, d, e) 0
# undef bus_space_unmap
# define bus_space_unmap(a, b, c)
# define panic printf
#else
@ -76,13 +72,13 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
# define ISAPNP_WRITE_ADDR(sc, v) \
bus_space_write_1(sc->sc_iot, sc->sc_addr_ioh, 0, v)
#define ISAPNP_WRITE_DATA(sc, v) \
# define ISAPNP_WRITE_DATA(sc, v) \
bus_space_write_1(sc->sc_iot, sc->sc_wrdata_ioh, 0, v)
#define ISAPNP_READ_DATA(sc) \
# define ISAPNP_READ_DATA(sc) \
bus_space_read_1(sc->sc_iot, sc->sc_read_ioh, 0)
#define ISAPNP_MALLOC(a) malloc(a, M_DEVBUF, M_WAITOK)
#define ISAPNP_FREE(a) free(a, M_DEVBUF)
# define ISAPNP_MALLOC(a) malloc(a, M_DEVBUF, M_WAITOK)
# define ISAPNP_FREE(a) free(a, M_DEVBUF)
#endif