-/* $OpenBSD: bus.h,v 1.1 1997/02/26 05:38:12 gene Exp $ */
+/* $OpenBSD: bus.h,v 1.2 1997/04/05 16:22:06 briggs Exp $ */
/* $NetBSD: bus.h,v 1.6 1997/02/24 05:55:14 scottr Exp $ */
/*
typedef int bus_space_tag_t;
typedef u_long bus_space_handle_t;
+/* in machdep.c */
int bus_space_map __P((bus_space_tag_t, bus_addr_t, bus_size_t,
int, bus_space_handle_t *));
void bus_space_unmap __P((bus_space_tag_t, bus_space_handle_t,
bus_space_handle_t *bshp));
void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
bus_size_t size));
+int bus_space_bad_addr __P((bus_space_tag_t tag, bus_space_handle_t hand,
+ bus_size_t offset, int byte_size));
/*
* u_intN_t bus_space_read_N __P((bus_space_tag_t tag,
-/* $OpenBSD: machdep.c,v 1.35 1997/04/05 15:29:10 briggs Exp $ */
+/* $OpenBSD: machdep.c,v 1.36 1997/04/05 16:22:07 briggs Exp $ */
/* $NetBSD: machdep.c,v 1.134 1997/02/14 06:15:30 scottr Exp $ */
/*
int badaddr __P((caddr_t));
+int
+bus_space_bad_addr(t, h, o, sz)
+ bus_space_tag_t t;
+ bus_space_handle_t h;
+ bus_size_t o;
+ int sz;
+{
+ register int i;
+ label_t faultbuf;
+
+#ifdef lint
+ i = *addr;
+ if (i)
+ return (0);
+#endif
+ nofault = (int *) &faultbuf;
+ if (setjmp((label_t *) nofault)) {
+ nofault = (int *) 0;
+ return (1);
+ }
+ switch (sz) {
+ default:
+ case 1:
+ i = bus_space_read_1(t, h, o);
+ break;
+ case 2:
+ i = bus_space_read_2(t, h, o);
+ break;
+ case 4:
+ i = bus_space_read_4(t, h, o);
+ break;
+ }
+ nofault = (int *) 0;
+ return (0);
+}
+
int
badaddr(addr)
register caddr_t addr;