diff options
| author | 2003-02-17 01:29:19 +0000 | |
|---|---|---|
| committer | 2003-02-17 01:29:19 +0000 | |
| commit | eb79e960df2d323f47be3c916d19f2570b9aacad (patch) | |
| tree | c56e5883e53ec2ca6418a6e570d16e872915ab1c /sys/dev/sbus/lebuffer.c | |
| parent | sync (diff) | |
| download | wireguard-openbsd-eb79e960df2d323f47be3c916d19f2570b9aacad.tar.xz wireguard-openbsd-eb79e960df2d323f47be3c916d19f2570b9aacad.zip | |
Add support for the Sun Enterprise 450
Reduce the size of a GENERIC kernel by ~190k
Remove the nasty pointer/bus_space_handle_t casts
Adds debug bus_space code including the ability to trace
bus operations (it actually works now).
The following rules are now followed (and verfified by the debug
code):
1. A "bus_space_handle_t" may only be used with the
"bus_space_tag_t" that created it.
2. Only "bus_space_map()" may create "bus_space_handle_t"s.
3. A "bus_space_handle_t" may not be modified after it has
been created (other than being destroyed by "bus_space_unmap()").
Thanks to help from mcbride, marc, jason, drahn, to anyone that might
have slipped my mind at the moment.
ok jason@, deraadt@
Diffstat (limited to 'sys/dev/sbus/lebuffer.c')
| -rw-r--r-- | sys/dev/sbus/lebuffer.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/sbus/lebuffer.c b/sys/dev/sbus/lebuffer.c index a73dd9bf5b5..6a8618914b5 100644 --- a/sys/dev/sbus/lebuffer.c +++ b/sys/dev/sbus/lebuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lebuffer.c,v 1.2 2002/05/13 18:16:38 jason Exp $ */ +/* $OpenBSD: lebuffer.c,v 1.3 2003/02/17 01:29:21 henric Exp $ */ /* $NetBSD: lebuffer.c,v 1.12 2002/03/11 16:00:57 pk Exp $ */ /*- @@ -99,7 +99,7 @@ lebufattach(parent, self, aux) struct lebuf_softc *sc = (void *)self; int node; int sbusburst; - bus_space_tag_t sbt; + struct sparc_bus_space_tag *sbt; bus_space_handle_t bh; sc->sc_bustag = sa->sa_bustag; @@ -140,13 +140,12 @@ lebufattach(parent, self, aux) sbus_establish(&sc->sc_sd, &sc->sc_dev); /* Allocate a bus tag */ - sbt = (bus_space_tag_t) malloc(sizeof(struct sparc_bus_space_tag), - M_DEVBUF, M_NOWAIT); + sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT); if (sbt == NULL) { printf("%s: attach: out of memory\n", self->dv_xname); return; } - bzero(sbt, sizeof(struct sparc_bus_space_tag)); + bzero(sbt, sizeof(*sbt)); printf(": %dK memory\n", sc->sc_bufsiz / 1024); |
