Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / fbutil.h
blob4205eb917f7d70e2165dcf1828d1f4a3d7f457a8
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2006,2007 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 /* NOTE: This header is private header for vbe driver and should not be used
20 in other parts of the code. */
22 #ifndef GRUB_VBEUTIL_MACHINE_HEADER
23 #define GRUB_VBEUTIL_MACHINE_HEADER 1
25 #include <grub/types.h>
26 #include <grub/video.h>
28 struct grub_video_fbblit_info
30 struct grub_video_mode_info *mode_info;
31 grub_uint8_t *data;
34 /* Don't use for 1-bit bitmaps, addressing needs to be done at the bit level
35 and it doesn't make sense, in general, to ask for a pointer
36 to a particular pixel's data. */
37 static inline void *
38 grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
39 unsigned int x, unsigned int y)
41 return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
44 /* Advance pointer by VAL bytes. If there is no unaligned access available,
45 VAL has to be divisible by size of pointed type.
47 #ifdef GRUB_HAVE_UNALIGNED_ACCESS
48 #define GRUB_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) = (typeof (ptr)) ((char *) ptr + val))
49 #else
50 #define GRUB_VIDEO_FB_ADVANCE_POINTER(ptr, val) ((ptr) += (val) / sizeof (*(ptr)))
51 #endif
53 grub_video_color_t get_pixel (struct grub_video_fbblit_info *source,
54 unsigned int x, unsigned int y);
56 void set_pixel (struct grub_video_fbblit_info *source,
57 unsigned int x, unsigned int y, grub_video_color_t color);
59 #endif /* ! GRUB_VBEUTIL_MACHINE_HEADER */