summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-16 07:41:47 +0000
committerphk <phk@FreeBSD.org>2003-06-16 07:41:47 +0000
commit35bf27413a821adfc5330667d922672f4439071a (patch)
treedea10683659cde4cc6070fb1ef5f1b7b0b5400fd /sys
parent3b3b9689c1efb501dcd6940867f78a294b424e4b (diff)
downloadFreeBSD-src-35bf27413a821adfc5330667d922672f4439071a.zip
FreeBSD-src-35bf27413a821adfc5330667d922672f4439071a.tar.gz
Replace evil abuse of geteblk() with malloc(9).
Diffstat (limited to 'sys')
-rw-r--r--sys/pc98/cbus/olpt.c11
-rw-r--r--sys/pc98/pc98/olpt.c11
2 files changed, 10 insertions, 12 deletions
diff --git a/sys/pc98/cbus/olpt.c b/sys/pc98/cbus/olpt.c
index e54b143..e21e354 100644
--- a/sys/pc98/cbus/olpt.c
+++ b/sys/pc98/cbus/olpt.c
@@ -104,12 +104,11 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/uio.h>
#include <sys/syslog.h>
+#include <sys/malloc.h>
#include <machine/clock.h>
#include <machine/bus.h>
@@ -165,7 +164,7 @@ struct lpt_softc {
#define LP_PRIMEOPEN 0x20 /* prime on every open */
#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
#define LP_BYPASS 0x80 /* bypass printer ready checks */
- struct buf *sc_inbuf;
+ void *sc_inbuf;
short sc_xfercnt ;
char sc_primed;
char *sc_cp ;
@@ -551,7 +550,7 @@ lptopen (dev_t dev, int flags, int fmt, struct thread *td)
#endif
sc->sc_state = OPEN;
- sc->sc_inbuf = geteblk(BUFSIZE);
+ sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK);
sc->sc_xfercnt = 0;
splx(s);
@@ -633,7 +632,7 @@ lptclose(dev_t dev, int flags, int fmt, struct thread *td)
outb(sc->sc_port+lpt_control, LPC_NINIT);
#endif
- brelse(sc->sc_inbuf);
+ free(sc->sc_inbuf, M_DEVBUF);
end_close:
sc->sc_state = 0;
@@ -732,7 +731,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
sc->sc_state &= ~INTERRUPTED;
while ((n = min(BUFSIZE, uio->uio_resid)) != 0) {
- sc->sc_cp = sc->sc_inbuf->b_data ;
+ sc->sc_cp = sc->sc_inbuf;
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
diff --git a/sys/pc98/pc98/olpt.c b/sys/pc98/pc98/olpt.c
index e54b143..e21e354 100644
--- a/sys/pc98/pc98/olpt.c
+++ b/sys/pc98/pc98/olpt.c
@@ -104,12 +104,11 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/uio.h>
#include <sys/syslog.h>
+#include <sys/malloc.h>
#include <machine/clock.h>
#include <machine/bus.h>
@@ -165,7 +164,7 @@ struct lpt_softc {
#define LP_PRIMEOPEN 0x20 /* prime on every open */
#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
#define LP_BYPASS 0x80 /* bypass printer ready checks */
- struct buf *sc_inbuf;
+ void *sc_inbuf;
short sc_xfercnt ;
char sc_primed;
char *sc_cp ;
@@ -551,7 +550,7 @@ lptopen (dev_t dev, int flags, int fmt, struct thread *td)
#endif
sc->sc_state = OPEN;
- sc->sc_inbuf = geteblk(BUFSIZE);
+ sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK);
sc->sc_xfercnt = 0;
splx(s);
@@ -633,7 +632,7 @@ lptclose(dev_t dev, int flags, int fmt, struct thread *td)
outb(sc->sc_port+lpt_control, LPC_NINIT);
#endif
- brelse(sc->sc_inbuf);
+ free(sc->sc_inbuf, M_DEVBUF);
end_close:
sc->sc_state = 0;
@@ -732,7 +731,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
sc->sc_state &= ~INTERRUPTED;
while ((n = min(BUFSIZE, uio->uio_resid)) != 0) {
- sc->sc_cp = sc->sc_inbuf->b_data ;
+ sc->sc_cp = sc->sc_inbuf;
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
OpenPOWER on IntegriCloud