Merge mainline into arm
This commit is contained in:
commit
ae27e4d323
111 changed files with 5383 additions and 3002 deletions
63
include/grub/archelp.h
Normal file
63
include/grub/archelp.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
/* archelp.h -- Archive helper functions */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_ARCHELP_HEADER
|
||||
#define GRUB_ARCHELP_HEADER 1
|
||||
|
||||
#include <grub/fs.h>
|
||||
#include <grub/file.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GRUB_ARCHELP_ATTR_TYPE = 0160000,
|
||||
GRUB_ARCHELP_ATTR_FILE = 0100000,
|
||||
GRUB_ARCHELP_ATTR_DIR = 0040000,
|
||||
GRUB_ARCHELP_ATTR_LNK = 0120000,
|
||||
GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
|
||||
GRUB_ARCHELP_ATTR_END = 0xffffffff
|
||||
} grub_archelp_mode_t;
|
||||
|
||||
struct grub_archelp_data;
|
||||
|
||||
struct grub_archelp_ops
|
||||
{
|
||||
grub_err_t
|
||||
(*find_file) (struct grub_archelp_data *data, char **name,
|
||||
grub_int32_t *mtime,
|
||||
grub_archelp_mode_t *mode);
|
||||
|
||||
char *
|
||||
(*get_link_target) (struct grub_archelp_data *data);
|
||||
|
||||
void
|
||||
(*rewind) (struct grub_archelp_data *data);
|
||||
};
|
||||
|
||||
grub_err_t
|
||||
grub_archelp_dir (struct grub_archelp_data *data,
|
||||
struct grub_archelp_ops *ops,
|
||||
const char *path_in,
|
||||
grub_fs_dir_hook_t hook, void *hook_data);
|
||||
|
||||
grub_err_t
|
||||
grub_archelp_open (struct grub_archelp_data *data,
|
||||
struct grub_archelp_ops *ops,
|
||||
const char *name_in);
|
||||
|
||||
#endif
|
|
@ -59,8 +59,25 @@ grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bi
|
|||
grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
|
||||
const char *filename);
|
||||
|
||||
unsigned int EXPORT_FUNC (grub_video_bitmap_get_width) (struct grub_video_bitmap *bitmap);
|
||||
unsigned int EXPORT_FUNC (grub_video_bitmap_get_height) (struct grub_video_bitmap *bitmap);
|
||||
/* Return bitmap width. */
|
||||
static inline unsigned int
|
||||
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
|
||||
{
|
||||
if (!bitmap)
|
||||
return 0;
|
||||
|
||||
return bitmap->mode_info.width;
|
||||
}
|
||||
|
||||
/* Return bitmap height. */
|
||||
static inline unsigned int
|
||||
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
|
||||
{
|
||||
if (!bitmap)
|
||||
return 0;
|
||||
|
||||
return bitmap->mode_info.height;
|
||||
}
|
||||
|
||||
void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
|
||||
struct grub_video_mode_info *mode_info);
|
||||
|
|
178
include/grub/cbfs_core.h
Normal file
178
include/grub/cbfs_core.h
Normal file
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
* Copyright (C) 2013 The Chromium OS Authors. All rights reserved.
|
||||
*
|
||||
* This file is dual-licensed. You can choose between:
|
||||
* - The GNU GPL, version 2, as published by the Free Software Foundation
|
||||
* - The revised BSD license (without advertising clause)
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
|
||||
* ---------------------------------------------------------------------------
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _CBFS_CORE_H_
|
||||
#define _CBFS_CORE_H_
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
/** These are standard values for the known compression
|
||||
alogrithms that coreboot knows about for stages and
|
||||
payloads. Of course, other CBFS users can use whatever
|
||||
values they want, as long as they understand them. */
|
||||
|
||||
#define CBFS_COMPRESS_NONE 0
|
||||
#define CBFS_COMPRESS_LZMA 1
|
||||
|
||||
/** These are standard component types for well known
|
||||
components (i.e - those that coreboot needs to consume.
|
||||
Users are welcome to use any other value for their
|
||||
components */
|
||||
|
||||
#define CBFS_TYPE_STAGE 0x10
|
||||
#define CBFS_TYPE_PAYLOAD 0x20
|
||||
#define CBFS_TYPE_OPTIONROM 0x30
|
||||
#define CBFS_TYPE_BOOTSPLASH 0x40
|
||||
#define CBFS_TYPE_RAW 0x50
|
||||
#define CBFS_TYPE_VSA 0x51
|
||||
#define CBFS_TYPE_MBI 0x52
|
||||
#define CBFS_TYPE_MICROCODE 0x53
|
||||
#define CBFS_COMPONENT_CMOS_DEFAULT 0xaa
|
||||
#define CBFS_COMPONENT_CMOS_LAYOUT 0x01aa
|
||||
|
||||
#define CBFS_HEADER_MAGIC 0x4F524243
|
||||
#define CBFS_HEADER_VERSION1 0x31313131
|
||||
#define CBFS_HEADER_VERSION2 0x31313132
|
||||
#define CBFS_HEADER_VERSION CBFS_HEADER_VERSION2
|
||||
|
||||
#define CBFS_HEADER_INVALID_ADDRESS ((void*)(0xffffffff))
|
||||
|
||||
/** this is the master cbfs header - it need to be located somewhere available
|
||||
to bootblock (to load romstage). Where it actually lives is up to coreboot.
|
||||
On x86, a pointer to this header will live at 0xFFFFFFFC.
|
||||
For other platforms, you need to define CONFIG_CBFS_HEADER_ROM_OFFSET */
|
||||
|
||||
struct cbfs_header {
|
||||
grub_uint32_t magic;
|
||||
grub_uint32_t version;
|
||||
grub_uint32_t romsize;
|
||||
grub_uint32_t bootblocksize;
|
||||
grub_uint32_t align;
|
||||
grub_uint32_t offset;
|
||||
grub_uint32_t architecture;
|
||||
grub_uint32_t pad[1];
|
||||
} __attribute__((packed));
|
||||
|
||||
/* "Unknown" refers to CBFS headers version 1,
|
||||
* before the architecture was defined (i.e., x86 only).
|
||||
*/
|
||||
#define CBFS_ARCHITECTURE_UNKNOWN 0xFFFFFFFF
|
||||
#define CBFS_ARCHITECTURE_X86 0x00000001
|
||||
#define CBFS_ARCHITECTURE_ARMV7 0x00000010
|
||||
|
||||
/** This is a component header - every entry in the CBFS
|
||||
will have this header.
|
||||
|
||||
This is how the component is arranged in the ROM:
|
||||
|
||||
-------------- <- 0
|
||||
component header
|
||||
-------------- <- sizeof(struct component)
|
||||
component name
|
||||
-------------- <- offset
|
||||
data
|
||||
...
|
||||
-------------- <- offset + len
|
||||
*/
|
||||
|
||||
#define CBFS_FILE_MAGIC "LARCHIVE"
|
||||
|
||||
struct cbfs_file {
|
||||
char magic[8];
|
||||
grub_uint32_t len;
|
||||
grub_uint32_t type;
|
||||
grub_uint32_t checksum;
|
||||
grub_uint32_t offset;
|
||||
} __attribute__((packed));
|
||||
|
||||
/*** Component sub-headers ***/
|
||||
|
||||
/* Following are component sub-headers for the "standard"
|
||||
component types */
|
||||
|
||||
/** This is the sub-header for stage components. Stages are
|
||||
loaded by coreboot during the normal boot process */
|
||||
|
||||
struct cbfs_stage {
|
||||
grub_uint32_t compression; /** Compression type */
|
||||
grub_uint64_t entry; /** entry point */
|
||||
grub_uint64_t load; /** Where to load in memory */
|
||||
grub_uint32_t len; /** length of data to load */
|
||||
grub_uint32_t memlen; /** total length of object in memory */
|
||||
} __attribute__((packed));
|
||||
|
||||
/** this is the sub-header for payload components. Payloads
|
||||
are loaded by coreboot at the end of the boot process */
|
||||
|
||||
struct cbfs_payload_segment {
|
||||
grub_uint32_t type;
|
||||
grub_uint32_t compression;
|
||||
grub_uint32_t offset;
|
||||
grub_uint64_t load_addr;
|
||||
grub_uint32_t len;
|
||||
grub_uint32_t mem_len;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct cbfs_payload {
|
||||
struct cbfs_payload_segment segments;
|
||||
};
|
||||
|
||||
#define PAYLOAD_SEGMENT_CODE 0x45444F43
|
||||
#define PAYLOAD_SEGMENT_DATA 0x41544144
|
||||
#define PAYLOAD_SEGMENT_BSS 0x20535342
|
||||
#define PAYLOAD_SEGMENT_PARAMS 0x41524150
|
||||
#define PAYLOAD_SEGMENT_ENTRY 0x52544E45
|
||||
|
||||
struct cbfs_optionrom {
|
||||
grub_uint32_t compression;
|
||||
grub_uint32_t len;
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
30
include/grub/color.h
Normal file
30
include/grub/color.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_VIDEO_COLOR_HEADER
|
||||
#define GRUB_VIDEO_COLOR_HEADER 1
|
||||
|
||||
#include <grub/video.h>
|
||||
|
||||
int grub_video_get_named_color (const char *name,
|
||||
grub_video_rgba_color_t *color);
|
||||
|
||||
grub_err_t grub_video_parse_color (const char *s,
|
||||
grub_video_rgba_color_t *color);
|
||||
|
||||
#endif
|
|
@ -46,6 +46,7 @@ enum grub_disk_dev_id
|
|||
GRUB_DISK_DEVICE_ARCDISK_ID,
|
||||
GRUB_DISK_DEVICE_HOSTDISK_ID,
|
||||
GRUB_DISK_DEVICE_PROCFS_ID,
|
||||
GRUB_DISK_DEVICE_CBFSDISK_ID,
|
||||
GRUB_DISK_DEVICE_UBOOTDISK_ID,
|
||||
};
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ typedef enum
|
|||
GRUB_ERR_NET_ROUTE_LOOP,
|
||||
GRUB_ERR_NET_NO_ROUTE,
|
||||
GRUB_ERR_NET_NO_ANSWER,
|
||||
GRUB_ERR_NET_NO_CARD,
|
||||
GRUB_ERR_WAIT,
|
||||
GRUB_ERR_BUG,
|
||||
GRUB_ERR_NET_PORT_CLOSED,
|
||||
|
|
|
@ -29,13 +29,18 @@ struct grub_fat_bpb
|
|||
grub_uint8_t sectors_per_cluster;
|
||||
grub_uint16_t num_reserved_sectors;
|
||||
grub_uint8_t num_fats;
|
||||
/* 0x10 */
|
||||
grub_uint16_t num_root_entries;
|
||||
grub_uint16_t num_total_sectors_16;
|
||||
grub_uint8_t media;
|
||||
/*0 x15 */
|
||||
grub_uint16_t sectors_per_fat_16;
|
||||
grub_uint16_t sectors_per_track;
|
||||
/*0 x19 */
|
||||
grub_uint16_t num_heads;
|
||||
/*0 x1b */
|
||||
grub_uint32_t num_hidden_sectors;
|
||||
/* 0x1f */
|
||||
grub_uint32_t num_total_sectors_32;
|
||||
union
|
||||
{
|
||||
|
|
|
@ -24,159 +24,13 @@
|
|||
|
||||
struct grub_video_fbblit_info;
|
||||
|
||||
/* NOTE: This function assumes that given coordinates are within bounds of
|
||||
handled data. */
|
||||
void
|
||||
grub_video_fbblit_replace (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target,
|
||||
struct grub_video_fbblit_info *source,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y,
|
||||
unsigned int width, unsigned int height,
|
||||
int offset_x, int offset_y);
|
||||
#endif /* ! GRUB_FBBLIT_HEADER */
|
||||
|
|
|
@ -48,28 +48,8 @@ struct grub_video_fbrender_target
|
|||
};
|
||||
|
||||
void
|
||||
grub_video_fbfill (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target,
|
||||
grub_video_color_t color, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
#endif /* ! GRUB_FBFILL_HEADER */
|
||||
|
|
|
@ -31,8 +31,15 @@ struct grub_video_fbblit_info
|
|||
grub_uint8_t *data;
|
||||
};
|
||||
|
||||
void *grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
|
||||
unsigned int x, unsigned int y);
|
||||
/* Don't use for 1-bit bitmaps, addressing needs to be done at the bit level
|
||||
and it doesn't make sense, in general, to ask for a pointer
|
||||
to a particular pixel's data. */
|
||||
static inline void *
|
||||
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
|
||||
unsigned int x, unsigned int y)
|
||||
{
|
||||
return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
|
||||
}
|
||||
|
||||
/* Advance pointer by VAL bytes. If there is no unaligned access available,
|
||||
VAL has to be divisible by size of pointed type.
|
||||
|
|
|
@ -27,7 +27,25 @@
|
|||
/* Forward declaration of opaque structure grub_font.
|
||||
Users only pass struct grub_font pointers to the font module functions,
|
||||
and do not have knowledge of the structure contents. */
|
||||
struct grub_font;
|
||||
/* Full structure was moved here for inline function but still
|
||||
shouldn't be used directly.
|
||||
*/
|
||||
struct grub_font
|
||||
{
|
||||
char *name;
|
||||
grub_file_t file;
|
||||
char *family;
|
||||
short point_size;
|
||||
short weight;
|
||||
short max_char_width;
|
||||
short max_char_height;
|
||||
short ascent;
|
||||
short descent;
|
||||
short leading;
|
||||
grub_uint32_t num_chars;
|
||||
struct char_index_entry *char_index;
|
||||
grub_uint16_t *bmp_idx;
|
||||
};
|
||||
|
||||
/* Font type used to access font functions. */
|
||||
typedef struct grub_font *grub_font_t;
|
||||
|
@ -93,9 +111,19 @@ const char *EXPORT_FUNC (grub_font_get_name) (grub_font_t font);
|
|||
|
||||
int EXPORT_FUNC (grub_font_get_max_char_width) (grub_font_t font);
|
||||
|
||||
int EXPORT_FUNC (grub_font_get_max_char_height) (grub_font_t font);
|
||||
/* Get the maximum height of any character in the font in pixels. */
|
||||
static inline int
|
||||
grub_font_get_max_char_height (grub_font_t font)
|
||||
{
|
||||
return font->max_char_height;
|
||||
}
|
||||
|
||||
int EXPORT_FUNC (grub_font_get_ascent) (grub_font_t font);
|
||||
/* Get the distance in pixels from the top of characters to the baseline. */
|
||||
static inline int
|
||||
grub_font_get_ascent (grub_font_t font)
|
||||
{
|
||||
return font->ascent;
|
||||
}
|
||||
|
||||
int EXPORT_FUNC (grub_font_get_descent) (grub_font_t font);
|
||||
|
||||
|
|
|
@ -31,13 +31,21 @@ EXPORT_FUNC (grub_gfxterm_set_window) (struct grub_video_render_target *target,
|
|||
int double_repaint,
|
||||
grub_font_t font, int border_width);
|
||||
|
||||
typedef void (*grub_gfxterm_repaint_callback_t)(int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void grub_gfxterm_set_repaint_callback (grub_gfxterm_repaint_callback_t func);
|
||||
|
||||
void EXPORT_FUNC (grub_gfxterm_schedule_repaint) (void);
|
||||
|
||||
extern void (*EXPORT_VAR (grub_gfxterm_decorator_hook)) (void);
|
||||
|
||||
struct grub_gfxterm_background
|
||||
{
|
||||
struct grub_video_bitmap *bitmap;
|
||||
int blend_text_bg;
|
||||
grub_video_rgba_color_t default_bg_color;
|
||||
};
|
||||
|
||||
extern struct grub_gfxterm_background EXPORT_VAR (grub_gfxterm_background);
|
||||
|
||||
void EXPORT_FUNC (grub_gfxterm_video_update_color) (void);
|
||||
void
|
||||
EXPORT_FUNC (grub_gfxterm_get_dimensions) (unsigned *width, unsigned *height);
|
||||
|
||||
#endif /* ! GRUB_GFXTERM_HEADER */
|
||||
|
|
|
@ -22,4 +22,11 @@
|
|||
void grub_vga_text_init (void);
|
||||
void grub_vga_text_fini (void);
|
||||
|
||||
void grub_video_coreboot_fb_init (void);
|
||||
void grub_video_coreboot_fb_early_init (void);
|
||||
void grub_video_coreboot_fb_late_init (void);
|
||||
void grub_video_coreboot_fb_fini (void);
|
||||
|
||||
extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable;
|
||||
|
||||
#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */
|
||||
|
|
|
@ -48,9 +48,23 @@ extern int grub_normal_exit_level;
|
|||
/* Defined in `main.c'. */
|
||||
void grub_enter_normal_mode (const char *config);
|
||||
void grub_normal_execute (const char *config, int nested, int batch);
|
||||
void grub_menu_init_page (int nested, int edit, int *num_entries,
|
||||
struct grub_term_screen_geometry
|
||||
{
|
||||
/* The number of entries shown at a time. */
|
||||
int num_entries;
|
||||
int first_entry_y;
|
||||
int first_entry_x;
|
||||
int entry_width;
|
||||
int timeout_y;
|
||||
int timeout_lines;
|
||||
int border;
|
||||
int right_margin;
|
||||
};
|
||||
|
||||
void grub_menu_init_page (int nested, int edit,
|
||||
struct grub_term_screen_geometry *geo,
|
||||
struct grub_term_output *term);
|
||||
void grub_normal_init_page (struct grub_term_output *term);
|
||||
void grub_normal_init_page (struct grub_term_output *term, int y);
|
||||
char *grub_file_getline (grub_file_t file);
|
||||
void grub_cmdline_run (int nested);
|
||||
|
||||
|
|
|
@ -329,7 +329,8 @@ grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);
|
|||
|
||||
/* Execute any GRUB pre-parsed command or script. */
|
||||
grub_err_t grub_script_execute (struct grub_script *script);
|
||||
grub_err_t grub_script_execute_sourcecode (const char *source, int argc, char **args);
|
||||
grub_err_t grub_script_execute_sourcecode (const char *source);
|
||||
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);
|
||||
|
||||
/* Break command for loops. */
|
||||
grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);
|
||||
|
|
|
@ -124,25 +124,12 @@ grub_term_color_state;
|
|||
|
||||
/* Menu-related geometrical constants. */
|
||||
|
||||
/* The number of lines of "GRUB version..." at the top. */
|
||||
#define GRUB_TERM_INFO_HEIGHT 1
|
||||
|
||||
/* The number of columns/lines between messages/borders/etc. */
|
||||
#define GRUB_TERM_MARGIN 1
|
||||
|
||||
/* The number of columns of scroll information. */
|
||||
#define GRUB_TERM_SCROLL_WIDTH 1
|
||||
|
||||
/* The Y position of the top border. */
|
||||
#define GRUB_TERM_TOP_BORDER_Y (GRUB_TERM_MARGIN + GRUB_TERM_INFO_HEIGHT \
|
||||
+ GRUB_TERM_MARGIN)
|
||||
|
||||
/* The X position of the left border. */
|
||||
#define GRUB_TERM_LEFT_BORDER_X GRUB_TERM_MARGIN
|
||||
|
||||
/* The Y position of the first entry. */
|
||||
#define GRUB_TERM_FIRST_ENTRY_Y (GRUB_TERM_TOP_BORDER_Y + 1)
|
||||
|
||||
struct grub_term_input
|
||||
{
|
||||
/* The next terminal. */
|
||||
|
@ -340,13 +327,6 @@ static inline unsigned grub_term_height (struct grub_term_output *term)
|
|||
return (term->getwh(term)&0xFF);
|
||||
}
|
||||
|
||||
/* The width of the border. */
|
||||
static inline unsigned
|
||||
grub_term_border_width (struct grub_term_output *term)
|
||||
{
|
||||
return grub_term_width (term) - GRUB_TERM_MARGIN * 2;
|
||||
}
|
||||
|
||||
static inline grub_uint16_t
|
||||
grub_term_getxy (struct grub_term_output *term)
|
||||
{
|
||||
|
|
|
@ -210,6 +210,7 @@ enum
|
|||
GRUB_UNICODE_UPARROW = 0x2191,
|
||||
GRUB_UNICODE_RIGHTARROW = 0x2192,
|
||||
GRUB_UNICODE_DOWNARROW = 0x2193,
|
||||
GRUB_UNICODE_UPDOWNARROW = 0x2195,
|
||||
GRUB_UNICODE_LIGHT_HLINE = 0x2500,
|
||||
GRUB_UNICODE_HLINE = 0x2501,
|
||||
GRUB_UNICODE_LIGHT_VLINE = 0x2502,
|
||||
|
|
|
@ -531,12 +531,6 @@ grub_video_map_rgba_color (grub_video_rgba_color_t c)
|
|||
return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
|
||||
}
|
||||
|
||||
int EXPORT_FUNC (grub_video_get_named_color) (const char *name,
|
||||
grub_video_rgba_color_t *color);
|
||||
|
||||
grub_err_t EXPORT_FUNC (grub_video_parse_color) (const char *s,
|
||||
grub_video_rgba_color_t *color);
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
extern void grub_font_init (void);
|
||||
extern void grub_font_fini (void);
|
||||
|
|
|
@ -118,72 +118,18 @@ EXPORT_FUNC(grub_video_fb_get_active_render_target) (struct grub_video_fbrender_
|
|||
grub_err_t
|
||||
EXPORT_FUNC(grub_video_fb_set_active_render_target) (struct grub_video_fbrender_target *target);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_32bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_24bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_16bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_8bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_32bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_24bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_16bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_8bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
typedef grub_err_t (*grub_video_fb_set_page_t) (int page);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
|
||||
EXPORT_FUNC (grub_video_fb_setup) (unsigned int mode_type, unsigned int mode_mask,
|
||||
struct grub_video_mode_info *mode_info,
|
||||
volatile void *page0_ptr,
|
||||
grub_video_fb_set_page_t set_page_in,
|
||||
volatile void *page1_ptr);
|
||||
grub_err_t
|
||||
grub_video_fb_swap_buffers (void);
|
||||
EXPORT_FUNC (grub_video_fb_swap_buffers) (void);
|
||||
grub_err_t
|
||||
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
|
||||
void **framebuf);
|
||||
EXPORT_FUNC (grub_video_fb_get_info_and_fini) (struct grub_video_mode_info *mode_info,
|
||||
void **framebuf);
|
||||
|
||||
#endif /* ! GRUB_VIDEO_FB_HEADER */
|
||||
|
|
|
@ -22,6 +22,39 @@
|
|||
|
||||
#ifndef _SYS_DMU_H
|
||||
#define _SYS_DMU_H
|
||||
#define B_FALSE 0
|
||||
#define B_TRUE 1
|
||||
|
||||
#define DMU_OT_NEWTYPE 0x80
|
||||
#define DMU_OT_METADATA 0x40
|
||||
#define DMU_OT_BYTESWAP_MASK 0x3f
|
||||
|
||||
#define DMU_OT(byteswap, metadata) \
|
||||
(DMU_OT_NEWTYPE | \
|
||||
((metadata) ? DMU_OT_METADATA : 0) | \
|
||||
((byteswap) & DMU_OT_BYTESWAP_MASK))
|
||||
|
||||
#define DMU_OT_IS_VALID(ot) (((ot) & DMU_OT_NEWTYPE) ? \
|
||||
((ot) & DMU_OT_BYTESWAP_MASK) < DMU_BSWAP_NUMFUNCS : \
|
||||
(ot) < DMU_OT_NUMTYPES)
|
||||
|
||||
#define DMU_OT_IS_METADATA(ot) (((ot) & DMU_OT_NEWTYPE) ? \
|
||||
((ot) & DMU_OT_METADATA) : \
|
||||
dmu_ot[(ot)].ot_metadata)
|
||||
|
||||
typedef enum dmu_object_byteswap {
|
||||
DMU_BSWAP_UINT8,
|
||||
DMU_BSWAP_UINT16,
|
||||
DMU_BSWAP_UINT32,
|
||||
DMU_BSWAP_UINT64,
|
||||
DMU_BSWAP_ZAP,
|
||||
DMU_BSWAP_DNODE,
|
||||
DMU_BSWAP_OBJSET,
|
||||
DMU_BSWAP_ZNODE,
|
||||
DMU_BSWAP_OLDACL,
|
||||
DMU_BSWAP_ACL,
|
||||
DMU_BSWAP_NUMFUNCS
|
||||
} dmu_object_byteswap_t;
|
||||
|
||||
/*
|
||||
* This file describes the interface that the DMU provides for its
|
||||
|
@ -89,7 +122,17 @@ typedef enum dmu_object_type {
|
|||
DMU_OT_SA_ATTR_REGISTRATION, /* ZAP */
|
||||
DMU_OT_SA_ATTR_LAYOUTS, /* ZAP */
|
||||
DMU_OT_DSL_KEYCHAIN = 54,
|
||||
DMU_OT_NUMTYPES
|
||||
DMU_OT_NUMTYPES,
|
||||
DMU_OTN_UINT8_DATA = DMU_OT(DMU_BSWAP_UINT8, B_FALSE),
|
||||
DMU_OTN_UINT8_METADATA = DMU_OT(DMU_BSWAP_UINT8, B_TRUE),
|
||||
DMU_OTN_UINT16_DATA = DMU_OT(DMU_BSWAP_UINT16, B_FALSE),
|
||||
DMU_OTN_UINT16_METADATA = DMU_OT(DMU_BSWAP_UINT16, B_TRUE),
|
||||
DMU_OTN_UINT32_DATA = DMU_OT(DMU_BSWAP_UINT32, B_FALSE),
|
||||
DMU_OTN_UINT32_METADATA = DMU_OT(DMU_BSWAP_UINT32, B_TRUE),
|
||||
DMU_OTN_UINT64_DATA = DMU_OT(DMU_BSWAP_UINT64, B_FALSE),
|
||||
DMU_OTN_UINT64_METADATA = DMU_OT(DMU_BSWAP_UINT64, B_TRUE),
|
||||
DMU_OTN_ZAP_DATA = DMU_OT(DMU_BSWAP_ZAP, B_FALSE),
|
||||
DMU_OTN_ZAP_METADATA = DMU_OT(DMU_BSWAP_ZAP, B_TRUE),
|
||||
} dmu_object_type_t;
|
||||
|
||||
typedef enum dmu_objset_type {
|
||||
|
@ -116,5 +159,6 @@ typedef enum dmu_objset_type {
|
|||
#define DMU_POOL_HISTORY "history"
|
||||
#define DMU_POOL_PROPS "pool_props"
|
||||
#define DMU_POOL_L2CACHE "l2cache"
|
||||
#define DMU_POOL_FEATURES_FOR_READ "features_for_read"
|
||||
|
||||
#endif /* _SYS_DMU_H */
|
||||
|
|
|
@ -36,8 +36,12 @@ typedef enum grub_zfs_endian
|
|||
/*
|
||||
* On-disk version number.
|
||||
*/
|
||||
#define SPA_VERSION 33ULL
|
||||
|
||||
#define SPA_VERSION_INITIAL 1ULL
|
||||
#define SPA_VERSION_BEFORE_FEATURES 33ULL
|
||||
#define SPA_VERSION_FEATURES 5000ULL
|
||||
#define SPA_VERSION_IS_SUPPORTED(v) \
|
||||
(((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
|
||||
((v) == SPA_VERSION_FEATURES))
|
||||
/*
|
||||
* The following are configuration names used in the nvlist describing a pool's
|
||||
* configuration.
|
||||
|
@ -76,6 +80,7 @@ typedef enum grub_zfs_endian
|
|||
#define ZPOOL_CONFIG_DDT_HISTOGRAM "ddt_histogram"
|
||||
#define ZPOOL_CONFIG_DDT_OBJ_STATS "ddt_object_stats"
|
||||
#define ZPOOL_CONFIG_DDT_STATS "ddt_stats"
|
||||
#define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read"
|
||||
/*
|
||||
* The persistent vdev state is stored as separate values rather than a single
|
||||
* 'vdev_state' entry. This is because a device can be in multiple states, such
|
||||
|
|
|
@ -88,6 +88,7 @@ enum zio_compress {
|
|||
ZIO_COMPRESS_GZIP8,
|
||||
ZIO_COMPRESS_GZIP9,
|
||||
ZIO_COMPRESS_ZLE,
|
||||
ZIO_COMPRESS_LZ4,
|
||||
ZIO_COMPRESS_FUNCTIONS
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue