Support BUS_SPACE_MAP_SHIFTED_EVEN for bus_space_map().

Now BUS_SPACE_MAP_SHIFTED means BUS_SPACE_MAP_SHIFTED_ODD.
It is needed for Nereid Ethernet.
This commit is contained in:
isaki 2001-11-11 01:38:00 +00:00
parent 6dda1d498c
commit 20d2e2f7e8
2 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: intio.c,v 1.9 2001/08/26 12:14:22 mrg Exp $ */ /* $NetBSD: intio.c,v 1.10 2001/11/11 01:38:01 isaki Exp $ */
/*- /*-
* Copyright (c) 1998 NetBSD Foundation, Inc. * Copyright (c) 1998 NetBSD Foundation, Inc.
@ -328,10 +328,12 @@ intio_bus_space_map(t, bpa, size, flags, bshp)
*bshp = (bus_space_handle_t) *bshp = (bus_space_handle_t)
((u_int) bpa - PHYS_INTIODEV + intiobase); ((u_int) bpa - PHYS_INTIODEV + intiobase);
/* /*
* Some devices are mapped on odd addresses only. * Some devices are mapped on odd or even addresses only.
*/ */
if (flags & BUS_SPACE_MAP_SHIFTED) if ((flags & BUS_SPACE_MAP_SHIFTED_MASK) == BUS_SPACE_MAP_SHIFTED_ODD)
*bshp += 0x80000001; *bshp += 0x80000001;
if ((flags & BUS_SPACE_MAP_SHIFTED_MASK) == BUS_SPACE_MAP_SHIFTED_EVEN)
*bshp += 0x80000000;
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus.h,v 1.8 2001/07/19 15:32:20 thorpej Exp $ */ /* $NetBSD: bus.h,v 1.9 2001/11/11 01:38:00 isaki Exp $ */
/*- /*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -137,7 +137,10 @@ void x68k_bus_space_free __P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
* For simpler hadware, many x68k devices are mapped with shifted address * For simpler hadware, many x68k devices are mapped with shifted address
* i.e. only on even or odd addresses. * i.e. only on even or odd addresses.
*/ */
#define BUS_SPACE_MAP_SHIFTED 0x1001 #define BUS_SPACE_MAP_SHIFTED_MASK 0x1001
#define BUS_SPACE_MAP_SHIFTED_ODD 0x1001
#define BUS_SPACE_MAP_SHIFTED_EVEN 0x1000
#define BUS_SPACE_MAP_SHIFTED BUS_SPACE_MAP_SHIFTED_ODD
#define bus_space_alloc(t,rs,re,s,a,b,f,r,h) \ #define bus_space_alloc(t,rs,re,s,a,b,f,r,h) \
((*((t)->x68k_bus_space_alloc)) ((t),(rs),(re),(s),(a),(b),(f),(r),(h))) ((*((t)->x68k_bus_space_alloc)) ((t),(rs),(re),(s),(a),(b),(f),(r),(h)))