From: Matthew Dillon Date: Fri, 10 Jun 2005 23:25:09 +0000 (+0000) Subject: spl->critical section conversion X-Git-Tag: v2.0.1~7054 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/052b6ffa0e67eb888700be647617d4ed10ea3648 spl->critical section conversion --- diff --git a/sys/dev/video/bktr/bktr_core.c b/sys/dev/video/bktr/bktr_core.c index e3e43f08aa..b00b8fe3bc 100644 --- a/sys/dev/video/bktr/bktr_core.c +++ b/sys/dev/video/bktr/bktr_core.c @@ -62,7 +62,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.138 2005/01/09 17:42:03 cognet Exp - * $DragonFly: src/sys/dev/video/bktr/bktr_core.c,v 1.14 2005/03/12 11:35:27 corecode Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_core.c,v 1.15 2005/06/10 23:25:05 dillon Exp $ */ /* @@ -114,6 +114,7 @@ #include /* for bus space */ #include #include +#include #include #include /* extensions to ioctl_meteor.h */ @@ -2375,11 +2376,10 @@ common_ioctl( bktr_ptr_t bktr, ioctl_cmd_t cmd, caddr_t arg ) #if defined( STATUS_SUM ) case BT848_GSTATUS: /* reap status */ { - DECLARE_INTR_MASK(s); - DISABLE_INTR(s); + crit_enter(); temp = status_sum; status_sum = 0; - ENABLE_INTR(s); + crit_exit(); *(u_int*)arg = temp; break; } diff --git a/sys/dev/video/bktr/bktr_os.c b/sys/dev/video/bktr/bktr_os.c index b09ce7f10a..769083d163 100644 --- a/sys/dev/video/bktr/bktr_os.c +++ b/sys/dev/video/bktr/bktr_os.c @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.45 2004/03/17 17:50:28 njl Exp $ - * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.11 2005/05/24 20:59:04 dillon Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.12 2005/06/10 23:25:05 dillon Exp $ */ /* @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -724,7 +725,6 @@ bktr_poll( dev_t dev, int events, struct thread *td) int unit; bktr_ptr_t bktr; int revents = 0; - DECLARE_INTR_MASK(s); unit = UNIT(minor(dev)); @@ -736,7 +736,7 @@ bktr_poll( dev_t dev, int events, struct thread *td) } LOCK_VBI(bktr); - DISABLE_INTR(s); + crit_enter(); if (events & (POLLIN | POLLRDNORM)) { @@ -750,7 +750,7 @@ bktr_poll( dev_t dev, int events, struct thread *td) } } - ENABLE_INTR(s); + crit_exit(); UNLOCK_VBI(bktr); return (revents); diff --git a/sys/dev/video/bktr/bktr_os.h b/sys/dev/video/bktr/bktr_os.h index 9f2e7c3b92..693c124ff4 100644 --- a/sys/dev/video/bktr/bktr_os.h +++ b/sys/dev/video/bktr/bktr_os.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/bktr/bktr_os.h,v 1.7 2003/12/01 19:03:50 truckman Exp $ */ -/* $DragonFly: src/sys/dev/video/bktr/bktr_os.h,v 1.4 2004/05/15 17:54:13 joerg Exp $ */ +/* $DragonFly: src/sys/dev/video/bktr/bktr_os.h,v 1.5 2005/06/10 23:25:05 dillon Exp $ */ /* * This is part of the Driver for Video Capture Cards (Frame grabbers) @@ -53,9 +53,6 @@ vm_offset_t get_bktr_mem( int unit, unsigned size ); /************************************/ /* *** Interrupt Enable/Disable *** */ /************************************/ -#define DECLARE_INTR_MASK(s) intrmask_t s -#define DISABLE_INTR(s) s=spltty() -#define ENABLE_INTR(s) splx(s) #ifdef USE_VBIMUTEX #define LOCK_VBI(bktr) mtx_lock(&bktr->vbimutex) diff --git a/sys/dev/video/fb/fb.c b/sys/dev/video/fb/fb.c index c923536a29..c1ec41e4cd 100644 --- a/sys/dev/video/fb/fb.c +++ b/sys/dev/video/fb/fb.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/fb.c,v 1.11.2.2 2000/08/02 22:35:22 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.10 2005/03/13 01:53:56 swildner Exp $ + * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.11 2005/06/10 23:25:06 dillon Exp $ */ #include "opt_fb.h" @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -80,12 +81,11 @@ vid_realloc_array(void) dev_t *new_cdevsw; #endif int newsize; - int s; if (!vid_malloc) return ENOMEM; - s = spltty(); + crit_enter(); newsize = ((adapters + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA; new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_WAITOK); new_vidsw = malloc(sizeof(*new_vidsw)*newsize, M_DEVBUF, M_WAITOK); @@ -113,7 +113,7 @@ vid_realloc_array(void) vidcdevsw = new_cdevsw; #endif adapters = newsize; - splx(s); + crit_exit(); if (bootverbose) printf("fb: new array size %d\n", adapters); @@ -236,18 +236,17 @@ int vid_allocate(char *driver, int unit, void *id) { int index; - int s; - s = spltty(); + crit_enter(); index = vid_find_adapter(driver, unit); if (index >= 0) { if (adapter[index]->va_token) { - splx(s); + crit_exit(); return -1; } adapter[index]->va_token = id; } - splx(s); + crit_exit(); return index; } @@ -255,9 +254,8 @@ int vid_release(video_adapter_t *adp, void *id) { int error; - int s; - s = spltty(); + crit_enter(); if (adp->va_token == NULL) { error = EINVAL; } else if (adp->va_token != id) { @@ -266,7 +264,7 @@ vid_release(video_adapter_t *adp, void *id) adp->va_token = NULL; error = 0; } - splx(s); + crit_exit(); return error; } @@ -401,18 +399,16 @@ PSEUDO_SET(vfbattach, fb); int fb_attach(dev_t dev, video_adapter_t *adp) { - int s; - if (adp->va_index >= adapters) return EINVAL; if (adapter[adp->va_index] != adp) return EINVAL; - s = spltty(); + crit_enter(); reference_dev(dev); adp->va_minor = minor(dev); vidcdevsw[adp->va_index] = dev; - splx(s); + crit_exit(); printf("fb%d at %s%d\n", adp->va_index, adp->va_name, adp->va_unit); return 0; @@ -424,8 +420,6 @@ fb_attach(dev_t dev, video_adapter_t *adp) int fb_detach(dev_t dev, video_adapter_t *adp) { - int s; - if (adp->va_index >= adapters) return EINVAL; if (adapter[adp->va_index] != adp) @@ -433,9 +427,9 @@ fb_detach(dev_t dev, video_adapter_t *adp) if (vidcdevsw[adp->va_index] != dev) return EINVAL; - s = spltty(); + crit_enter(); vidcdevsw[adp->va_index] = NULL; - splx(s); + crit_exit(); release_dev(dev); return 0; } @@ -527,23 +521,19 @@ DEV_DRIVER_MODULE(fb, ???, fb_driver, fb_devclass, fb_cdevsw, 0, 0); int genfbopen(genfb_softc_t *sc, video_adapter_t *adp, int flag, int mode, struct thread *td) { - int s; - - s = spltty(); + crit_enter(); if (!(sc->gfb_flags & FB_OPEN)) sc->gfb_flags |= FB_OPEN; - splx(s); + crit_exit(); return 0; } int genfbclose(genfb_softc_t *sc, video_adapter_t *adp, int flag, int mode, struct thread *td) { - int s; - - s = spltty(); + crit_enter(); sc->gfb_flags &= ~FB_OPEN; - splx(s); + crit_exit(); return 0; } @@ -700,12 +690,11 @@ int fb_commonioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) { int error; - int s; /* assert(adp != NULL) */ error = 0; - s = spltty(); + crit_enter(); switch (cmd) { @@ -826,6 +815,6 @@ fb_commonioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) break; } - splx(s); + crit_exit(); return error; } diff --git a/sys/dev/video/fb/tga.c b/sys/dev/video/fb/tga.c index 894a4fc7a6..dd8a5540e2 100644 --- a/sys/dev/video/fb/tga.c +++ b/sys/dev/video/fb/tga.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/tga.c,v 1.1.2.1 2001/11/01 08:33:14 obrien Exp $ - * $DragonFly: src/sys/dev/video/fb/Attic/tga.c,v 1.4 2003/11/09 02:22:35 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/Attic/tga.c,v 1.5 2005/06/10 23:25:06 dillon Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -65,6 +65,7 @@ #include #include #include +#include #include #include "vgareg.h" @@ -2229,11 +2230,11 @@ static int bt485_read_hw_cursor(video_adapter_t *adp, int *col, int *row) { struct gfb_softc *sc; - int error, s; + int error; error = 0; sc = gfb_device_softcs[adp->va_model][adp->va_unit]; - s = spltty(); + crit_enter(); *col = (sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_X_HIGH) & 0x0f) << 8; *col |= sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_X_LOW) & 0xff; *col /= adp->va_info.vi_cwidth; @@ -2242,7 +2243,7 @@ bt485_read_hw_cursor(video_adapter_t *adp, int *col, int *row) *row |= sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_Y_LOW) & 0xff; *row /= adp->va_info.vi_cheight; *row -= 4; - splx(s); + crit_exit(); return(error); } @@ -2269,7 +2270,7 @@ bt485_set_hw_cursor(video_adapter_t *adp, int col, int row) } else { /* Otherwise, just move the cursor as requested... */ sc = gfb_device_softcs[adp->va_model][adp->va_unit]; - s = spltty(); + crit_enter(); sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_X_LOW, ((col + 8) * adp->va_info.vi_cwidth) & 0xff); sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_X_HIGH, @@ -2278,7 +2279,7 @@ bt485_set_hw_cursor(video_adapter_t *adp, int col, int row) ((row + 4) * adp->va_info.vi_cheight) & 0xff); sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_Y_HIGH, (((row + 4) * adp->va_info.vi_cheight) >> 8) & 0x0f); - splx(s); + crit_exit(); } return(error); } diff --git a/sys/dev/video/fb/vga.c b/sys/dev/video/fb/vga.c index 945284d572..25a161bad2 100644 --- a/sys/dev/video/fb/vga.c +++ b/sys/dev/video/fb/vga.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/vga.c,v 1.9.2.1 2001/08/11 02:58:44 yokota Exp $ - * $DragonFly: src/sys/dev/video/fb/vga.c,v 1.11 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/dev/video/fb/vga.c,v 1.12 2005/06/10 23:25:06 dillon Exp $ */ #include "opt_vga.h" @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -1657,9 +1658,8 @@ static void set_font_mode(video_adapter_t *adp, u_char *buf) { u_char *mp; - int s; - s = splhigh(); + crit_enter(); /* save register values */ if (adp->va_type == KD_VGA) { @@ -1716,15 +1716,13 @@ set_font_mode(video_adapter_t *adp, u_char *buf) outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */ #endif /* VGA_SLOW_IOACCESS */ - splx(s); + crit_exit(); } static void set_normal_mode(video_adapter_t *adp, u_char *buf) { - int s; - - s = splhigh(); + crit_enter(); /* setup vga for normal operation mode again */ inb(adp->va_crtc_addr + 6); /* reset flip-flop */ @@ -1765,7 +1763,7 @@ set_normal_mode(video_adapter_t *adp, u_char *buf) outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8)); #endif /* VGA_SLOW_IOACCESS */ - splx(s); + crit_exit(); } #endif /* VGA_NO_FONT_LOADING */ @@ -1785,7 +1783,6 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data, u_int32_t segment; int c; #ifdef VGA_ALT_SEQACCESS - int s; u_char val = 0; #endif @@ -1812,12 +1809,12 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data, #ifdef VGA_ALT_SEQACCESS if (adp->va_type == KD_VGA) { /* what about EGA? XXX */ - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */ outb(TSIDX, 0x01); outb(TSREG, val | 0x20); outb(TSIDX, 0x00); outb(TSREG, 0x03); - splx(s); + crit_exit(); } #endif @@ -1834,11 +1831,11 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data, #ifdef VGA_ALT_SEQACCESS if (adp->va_type == KD_VGA) { - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */ outb(TSIDX, 0x00); outb(TSREG, 0x03); - splx(s); + crit_exit(); } #endif @@ -1865,7 +1862,6 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data, u_int32_t segment; int c; #ifdef VGA_ALT_SEQACCESS - int s; u_char val = 0; #endif @@ -1892,12 +1888,12 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data, #ifdef VGA_ALT_SEQACCESS if (adp->va_type == KD_VGA) { /* what about EGA? XXX */ - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */ outb(TSIDX, 0x01); outb(TSREG, val | 0x20); outb(TSIDX, 0x00); outb(TSREG, 0x03); - splx(s); + crit_exit(); } #endif @@ -1914,11 +1910,11 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data, #ifdef VGA_ALT_SEQACCESS if (adp->va_type == KD_VGA) { - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */ outb(TSIDX, 0x00); outb(TSREG, 0x03); - splx(s); + crit_exit(); } #endif @@ -1941,15 +1937,14 @@ vga_show_font(video_adapter_t *adp, int page) { #ifndef VGA_NO_FONT_LOADING static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f, 0x30, 0x35, 0x3a, 0x3f }; - int s; prologue(adp, V_ADP_FONT, ENODEV); if (page < 0 || page >= 8) return EINVAL; - s = splhigh(); + crit_enter(); outb(TSIDX, 0x03); outb(TSREG, cg[page]); - splx(s); + crit_exit(); return 0; #else /* VGA_NO_FONT_LOADING */ @@ -2084,7 +2079,6 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size) u_char *buf; int crtc_addr; int i, j; - int s; if (size == 0) { /* return the required buffer size */ @@ -2101,7 +2095,7 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size) bzero(buf, V_MODE_PARAM_SIZE); crtc_addr = adp->va_crtc_addr; - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ for (i = 0, j = 5; i < 4; i++) { @@ -2127,7 +2121,7 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size) inb(crtc_addr + 6); /* reset flip-flop */ outb(ATC, 0x20); /* enable palette */ - splx(s); + crit_exit(); #if 1 if (vga_get_info(adp, adp->va_mode, &info) == 0) { @@ -2168,7 +2162,6 @@ vga_load_state(video_adapter_t *adp, void *p) { u_char *buf; int crtc_addr; - int s; int i; prologue(adp, V_ADP_STATELOAD, ENODEV); @@ -2182,7 +2175,7 @@ vga_load_state(video_adapter_t *adp, void *p) dump_buffer(buf, V_MODE_PARAM_SIZE); #endif - s = splhigh(); + crit_enter(); outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ for (i = 0; i < 4; ++i) { /* program sequencer */ @@ -2223,7 +2216,7 @@ vga_load_state(video_adapter_t *adp, void *p) #endif /* VGA_NO_BIOS */ #endif /* notyet */ - splx(s); + crit_exit(); return 0; } @@ -2251,7 +2244,6 @@ static int vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row) { u_int16_t off; - int s; if (!vga_init_done) return ENXIO; @@ -2259,12 +2251,12 @@ vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row) if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return ENODEV; - s = spltty(); + crit_enter(); outb(adp->va_crtc_addr, 14); off = inb(adp->va_crtc_addr + 1); outb(adp->va_crtc_addr, 15); off = (off << 8) | inb(adp->va_crtc_addr + 1); - splx(s); + crit_exit(); *row = off / adp->va_info.vi_width; *col = off % adp->va_info.vi_width; @@ -2283,7 +2275,6 @@ static int vga_set_hw_cursor(video_adapter_t *adp, int col, int row) { u_int16_t off; - int s; if (!vga_init_done) return ENXIO; @@ -2296,12 +2287,12 @@ vga_set_hw_cursor(video_adapter_t *adp, int col, int row) off = row*adp->va_info.vi_width + col; } - s = spltty(); + crit_enter(); outb(adp->va_crtc_addr, 14); outb(adp->va_crtc_addr + 1, off >> 8); outb(adp->va_crtc_addr, 15); outb(adp->va_crtc_addr + 1, off & 0x00ff); - splx(s); + crit_exit(); return 0; } @@ -2317,12 +2308,10 @@ static int vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, int celsize, int blink) { - int s; - if (!vga_init_done) return ENXIO; - s = spltty(); + crit_enter(); switch (adp->va_type) { case KD_VGA: case KD_CGA: @@ -2357,7 +2346,7 @@ vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, } break; } - splx(s); + crit_exit(); return 0; } @@ -2372,9 +2361,8 @@ static int vga_blank_display(video_adapter_t *adp, int mode) { u_char val; - int s; - s = splhigh(); + crit_enter(); switch (adp->va_type) { case KD_VGA: switch (mode) { @@ -2408,7 +2396,7 @@ vga_blank_display(video_adapter_t *adp, int mode) case KD_EGA: /* no support yet */ - splx(s); + crit_exit(); return ENODEV; case KD_CGA: @@ -2440,7 +2428,7 @@ vga_blank_display(video_adapter_t *adp, int mode) default: break; } - splx(s); + crit_exit(); return 0; } diff --git a/sys/dev/video/gfb/gfb_pci.c b/sys/dev/video/gfb/gfb_pci.c index 38e85f79a3..83223a665d 100644 --- a/sys/dev/video/gfb/gfb_pci.c +++ b/sys/dev/video/gfb/gfb_pci.c @@ -27,7 +27,7 @@ * Copyright (c) 2000 Andrew Miklic, Andrew Gallatin, and Thomas V. Crimi * * $FreeBSD: src/sys/dev/gfb/gfb_pci.c,v 1.1.2.1 2001/11/01 08:33:15 obrien Exp $ - * $DragonFly: src/sys/dev/video/gfb/Attic/gfb_pci.c,v 1.6 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/dev/video/gfb/Attic/gfb_pci.c,v 1.7 2005/06/10 23:25:07 dillon Exp $ */ #include @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -71,12 +72,11 @@ extern struct gfb_softc *gfb_device_softcs[2][16]; int pcigfb_attach(device_t dev) { - int s; gfb_softc_t sc; video_adapter_t *adp; int unit, flags, error, rid, va_index; - s = splimp(); + crit_enter(); error = 0; unit = device_get_unit(dev); flags = device_get_flags(dev); @@ -212,7 +212,7 @@ fail: } error = ENXIO; done: - splx(s); + crit_exit(); return(error); } diff --git a/sys/dev/video/gsc/gsc.c b/sys/dev/video/gsc/gsc.c index 92fb92e4b1..9505887305 100644 --- a/sys/dev/video/gsc/gsc.c +++ b/sys/dev/video/gsc/gsc.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/gsc.c,v 1.35.2.1 2000/08/08 19:49:53 peter Exp $ - * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.9 2004/05/19 22:52:54 dillon Exp $ + * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.10 2005/06/10 23:25:08 dillon Exp $ * */ @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -310,7 +311,6 @@ buffer_read(struct gsc_unit *scu) int res = SUCCESS; int chan_bit; char *p; - int sps; int delay; lprintf(("gsc.buffer_read: begin\n")); @@ -321,7 +321,7 @@ buffer_read(struct gsc_unit *scu) return EIO; } - sps=splbio(); + crit_enter(); outb( scu->ctrl, scu->ctrl_byte | GSC_POWER_ON ); outb( scu->clrp, 0 ); @@ -335,7 +335,7 @@ buffer_read(struct gsc_unit *scu) { if(delay >= scu->btime) { - splx(sps); + crit_exit(); lprintf(("gsc.buffer_read: timeout\n")); res = EWOULDBLOCK; break; @@ -346,7 +346,7 @@ buffer_read(struct gsc_unit *scu) else break; } - splx(sps); + crit_exit(); isa_dmadone(ISADMA_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); outb( scu->clrp, 0 ); diff --git a/sys/dev/video/i386/vesa/vesa.c b/sys/dev/video/i386/vesa/vesa.c index 68110b437b..10ad3a1014 100644 --- a/sys/dev/video/i386/vesa/vesa.c +++ b/sys/dev/video/i386/vesa/vesa.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/vesa.c,v 1.32.2.1 2002/08/13 02:42:33 rwatson Exp $ - * $DragonFly: src/sys/dev/video/i386/vesa/vesa.c,v 1.9 2005/05/07 13:06:44 swildner Exp $ + * $DragonFly: src/sys/dev/video/i386/vesa/vesa.c,v 1.10 2005/06/10 23:25:09 dillon Exp $ */ #include "opt_vga.h" @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -1585,16 +1586,15 @@ static int vesa_load(void) { int error; - int s; if (vesa_init_done) return 0; /* locate a VGA adapter */ - s = spltty(); + crit_enter(); vesa_adp = NULL; error = vesa_configure(0); - splx(s); + crit_exit(); if (error == 0) vesa_bios_info(bootverbose); @@ -1608,7 +1608,6 @@ vesa_unload(void) u_char palette[256*3]; int error; int bits; - int s; /* if the adapter is currently in a VESA mode, don't unload */ if ((vesa_adp != NULL) && VESA_MODE(vesa_adp->va_mode)) @@ -1618,7 +1617,7 @@ vesa_unload(void) * we shouldn't be unloading! XXX */ - s = spltty(); + crit_enter(); if ((error = vesa_unload_ioctl()) == 0) { if (vesa_adp != NULL) { if (vesa_adp_info->v_flags & V_DAC8) { @@ -1635,7 +1634,7 @@ vesa_unload(void) vidsw[vesa_adp->va_index] = prevvidsw; } } - splx(s); + crit_exit(); return error; }