1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/syscons/scvtb.c 109623 2003-01-21 08:56:16Z alfred $
27 */
28
29#include "opt_syscons.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/fbio.h>
--- 21 unchanged lines hidden (view full) ---
56
57 switch (type) {
58 case VTB_MEMORY:
59 case VTB_RINGBUFFER:
60 if ((buf == NULL) && (cols*rows != 0)) {
61 vtb->vtb_buffer =
62 (vm_offset_t)malloc(cols*rows*sizeof(u_int16_t),
63 M_DEVBUF,
64 (wait) ? 0 : M_NOWAIT);
65 if (vtb->vtb_buffer != 0) {
66 bzero((void *)sc_vtb_pointer(vtb, 0),
67 cols*rows*sizeof(u_int16_t));
68 vtb->vtb_flags |= VTB_ALLOCED;
69 }
70 } else {
71 vtb->vtb_buffer = (vm_offset_t)buf;
72 }
--- 227 unchanged lines hidden ---
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/syscons/scvtb.c 109623 2003-01-21 08:56:16Z alfred $
27 */
28
29#include "opt_syscons.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/fbio.h>
--- 21 unchanged lines hidden (view full) ---
56
57 switch (type) {
58 case VTB_MEMORY:
59 case VTB_RINGBUFFER:
60 if ((buf == NULL) && (cols*rows != 0)) {
61 vtb->vtb_buffer =
62 (vm_offset_t)malloc(cols*rows*sizeof(u_int16_t),
63 M_DEVBUF,
64 (wait) ? 0 : M_NOWAIT);
65 if (vtb->vtb_buffer != 0) {
66 bzero((void *)sc_vtb_pointer(vtb, 0),
67 cols*rows*sizeof(u_int16_t));
68 vtb->vtb_flags |= VTB_ALLOCED;
69 }
70 } else {
71 vtb->vtb_buffer = (vm_offset_t)buf;
72 }
--- 227 unchanged lines hidden ---