From 5ef2daf4fe5a99d62b59422833ae728e6157b7e3 Mon Sep 17 00:00:00 2001 From: niklas Date: Sat, 27 Apr 1996 22:18:16 +0000 Subject: [PATCH] Extend the bus.h interface with endian conversion functions and use where relevant. --- sys/arch/i386/include/bus.h | 11 ++++++++++- sys/dev/isa/if_ed.c | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index 09947ebf54e..9be52434632 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.2 1996/04/21 22:16:46 deraadt Exp $ */ +/* $OpenBSD: bus.h,v 1.3 1996/04/27 22:18:16 niklas Exp $ */ /* $NetBSD: bus.h,v 1.2 1996/04/05 23:59:37 thorpej Exp $ */ /* @@ -114,4 +114,13 @@ void bus_mem_unmap __P((bus_chipset_tag_t t, bus_mem_handle_t memh, #define bus_mem_write_8(t, h, o, v) \ ((void)(*(volatile u_int64_t *)((h) + (o)) = (v))) +/* These are extensions to the general NetBSD bus interface. */ +#define bus_to_host_2(t, v) (v) +#define bus_to_host_4(t, v) (v) +#define bus_to_host_8(t, v) (v) + +#define bus_from_host_2(t, v) (v) +#define bus_from_host_4(t, v) (v) +#define bus_from_host_8(t, v) (v) + #endif /* _I386_BUS_H_ */ diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c index b385c61d95a..d770c80a73e 100644 --- a/sys/dev/isa/if_ed.c +++ b/sys/dev/isa/if_ed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ed.c,v 1.10 1996/04/21 22:23:41 deraadt Exp $ */ +/* $OpenBSD: if_ed.c,v 1.11 1996/04/27 22:19:59 niklas Exp $ */ /* $NetBSD: if_ed.c,v 1.93 1996/04/11 22:28:55 cgd Exp $ */ /* @@ -1855,8 +1855,8 @@ loop: sizeof(packet_hdr)); else ed_pio_readmem(sc, (long)packet_ptr, - (caddr_t) &packet_hdr, sizeof(packet_hdr)); - len = packet_hdr.count; + (caddr_t)&packet_hdr, sizeof(packet_hdr)); + len = bus_to_host_2(bc, packet_hdr.count); /* * Try do deal with old, buggy chips that sometimes duplicate -- 2.20.1