Deleted Added
full compact
vga.c (109623) vga.c (111119)
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * Copyright (c) 1992-1998 S�ren Schmidt
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * Copyright (c) 1992-1998 S�ren Schmidt
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/fb/vga.c 109623 2003-01-21 08:56:16Z alfred $
29 * $FreeBSD: head/sys/dev/fb/vga.c 111119 2003-02-19 05:47:46Z imp $
30 */
31
32#include "opt_vga.h"
33#include "opt_fb.h"
34#include "opt_syscons.h" /* should be removed in the future, XXX */
35
36#include <sys/param.h>
37#include <sys/systm.h>

--- 2805 unchanged lines hidden (view full) ---

2843{
2844 u_char *r;
2845 u_char *g;
2846 u_char *b;
2847
2848 if ((base < 0) || (base >= 256) || (base + count > 256))
2849 return EINVAL;
2850
30 */
31
32#include "opt_vga.h"
33#include "opt_fb.h"
34#include "opt_syscons.h" /* should be removed in the future, XXX */
35
36#include <sys/param.h>
37#include <sys/systm.h>

--- 2805 unchanged lines hidden (view full) ---

2843{
2844 u_char *r;
2845 u_char *g;
2846 u_char *b;
2847
2848 if ((base < 0) || (base >= 256) || (base + count > 256))
2849 return EINVAL;
2850
2851 r = malloc(count*3, M_DEVBUF, 0);
2851 r = malloc(count*3, M_DEVBUF, M_WAITOK);
2852 g = r + count;
2853 b = g + count;
2854 if (vga_save_palette2(adp, base, count, r, g, b)) {
2855 free(r, M_DEVBUF);
2856 return ENODEV;
2857 }
2858 copyout(r, red, count);
2859 copyout(g, green, count);

--- 14 unchanged lines hidden (view full) ---

2874 u_char *r;
2875 u_char *g;
2876 u_char *b;
2877 int err;
2878
2879 if ((base < 0) || (base >= 256) || (base + count > 256))
2880 return EINVAL;
2881
2852 g = r + count;
2853 b = g + count;
2854 if (vga_save_palette2(adp, base, count, r, g, b)) {
2855 free(r, M_DEVBUF);
2856 return ENODEV;
2857 }
2858 copyout(r, red, count);
2859 copyout(g, green, count);

--- 14 unchanged lines hidden (view full) ---

2874 u_char *r;
2875 u_char *g;
2876 u_char *b;
2877 int err;
2878
2879 if ((base < 0) || (base >= 256) || (base + count > 256))
2880 return EINVAL;
2881
2882 r = malloc(count*3, M_DEVBUF, 0);
2882 r = malloc(count*3, M_DEVBUF, M_WAITOK);
2883 g = r + count;
2884 b = g + count;
2885 copyin(red, r, count);
2886 copyin(green, g, count);
2887 copyin(blue, b, count);
2888 err = vga_load_palette2(adp, base, count, r, g, b);
2889 free(r, M_DEVBUF);
2890

--- 163 unchanged lines hidden ---
2883 g = r + count;
2884 b = g + count;
2885 copyin(red, r, count);
2886 copyin(green, g, count);
2887 copyin(blue, b, count);
2888 err = vga_load_palette2(adp, base, count, r, g, b);
2889 free(r, M_DEVBUF);
2890

--- 163 unchanged lines hidden ---