merge mainline into mbtag
This commit is contained in:
commit
3f5a90c616
309 changed files with 15762 additions and 2433 deletions
|
@ -16,6 +16,38 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* from: @(#)exec.h 8.1 (Berkeley) 6/11/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef GRUB_AOUT_HEADER
|
||||
#define GRUB_AOUT_HEADER 1
|
||||
|
||||
|
|
54
include/grub/at_keyboard.h
Normal file
54
include/grub/at_keyboard.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_AT_KEYBOARD_HEADER
|
||||
#define GRUB_AT_KEYBOARD_HEADER 1
|
||||
|
||||
#define SHIFT_L 0x2a
|
||||
#define SHIFT_R 0x36
|
||||
#define CTRL 0x1d
|
||||
#define ALT 0x38
|
||||
#define CAPS_LOCK 0x3a
|
||||
#define NUM_LOCK 0x45
|
||||
#define SCROLL_LOCK 0x46
|
||||
|
||||
/* Used for sending commands to the controller. */
|
||||
#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
|
||||
#define KEYBOARD_COMMAND_READ 0x20
|
||||
#define KEYBOARD_COMMAND_WRITE 0x60
|
||||
#define KEYBOARD_COMMAND_REBOOT 0xfe
|
||||
|
||||
#define KEYBOARD_SCANCODE_SET1 0x40
|
||||
|
||||
#define KEYBOARD_ISMAKE(x) !((x) & 0x80)
|
||||
#define KEYBOARD_ISREADY(x) ((x) & 0x01)
|
||||
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
|
||||
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define OLPC_UP GRUB_TERM_UP
|
||||
#define OLPC_DOWN GRUB_TERM_DOWN
|
||||
#define OLPC_LEFT GRUB_TERM_LEFT
|
||||
#define OLPC_RIGHT GRUB_TERM_RIGHT
|
||||
#else
|
||||
#define OLPC_UP '\0'
|
||||
#define OLPC_DOWN '\0'
|
||||
#define OLPC_LEFT '\0'
|
||||
#define OLPC_RIGHT '\0'
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -98,8 +98,8 @@ struct grub_ata_device
|
|||
|
||||
/* IO addresses on which the registers for this device can be
|
||||
found. */
|
||||
int ioaddress;
|
||||
int ioaddress2;
|
||||
grub_port_t ioaddress;
|
||||
grub_port_t ioaddress2;
|
||||
|
||||
/* Two devices can be connected to a single cable. Use this field
|
||||
to select device 0 (commonly known as "master") or device 1
|
||||
|
|
|
@ -47,24 +47,24 @@ struct grub_video_bitmap_reader
|
|||
};
|
||||
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;
|
||||
|
||||
void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
|
||||
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);
|
||||
void EXPORT_FUNC (grub_video_bitmap_reader_register) (grub_video_bitmap_reader_t reader);
|
||||
void EXPORT_FUNC (grub_video_bitmap_reader_unregister) (grub_video_bitmap_reader_t reader);
|
||||
|
||||
grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
|
||||
unsigned int width, unsigned int height,
|
||||
enum grub_video_blit_format blit_format);
|
||||
grub_err_t EXPORT_FUNC (grub_video_bitmap_create) (struct grub_video_bitmap **bitmap,
|
||||
unsigned int width, unsigned int height,
|
||||
enum grub_video_blit_format blit_format);
|
||||
|
||||
grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);
|
||||
grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bitmap);
|
||||
|
||||
grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
|
||||
const char *filename);
|
||||
grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
|
||||
const char *filename);
|
||||
|
||||
unsigned int grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap);
|
||||
unsigned int grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap);
|
||||
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);
|
||||
|
||||
void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
|
||||
struct grub_video_mode_info *mode_info);
|
||||
void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
|
||||
struct grub_video_mode_info *mode_info);
|
||||
|
||||
void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
|
||||
void *EXPORT_FUNC (grub_video_bitmap_get_data) (struct grub_video_bitmap *bitmap);
|
||||
|
||||
#endif /* ! GRUB_BITMAP_HEADER */
|
||||
|
|
49
include/grub/bitmap_scale.h
Normal file
49
include/grub/bitmap_scale.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* bitmap_scale.h - Bitmap scaling functions. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_BITMAP_SCALE_HEADER
|
||||
#define GRUB_BITMAP_SCALE_HEADER 1
|
||||
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/bitmap_scale.h>
|
||||
|
||||
enum grub_video_bitmap_scale_method
|
||||
{
|
||||
/* Choose the fastest interpolation algorithm. */
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST,
|
||||
/* Choose the highest quality interpolation algorithm. */
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST,
|
||||
|
||||
/* Specific algorithms: */
|
||||
/* Nearest neighbor interpolation. */
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST,
|
||||
/* Bilinear interpolation. */
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR
|
||||
};
|
||||
|
||||
grub_err_t
|
||||
EXPORT_FUNC (grub_video_bitmap_create_scaled) (struct grub_video_bitmap **dst,
|
||||
int dst_width, int dst_height,
|
||||
struct grub_video_bitmap *src,
|
||||
enum
|
||||
grub_video_bitmap_scale_method
|
||||
scale_method);
|
||||
|
||||
#endif /* ! GRUB_BITMAP_SCALE_HEADER */
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <grub/file.h>
|
||||
|
||||
grub_file_t grub_bufio_open (grub_file_t io, int size);
|
||||
grub_file_t grub_buffile_open (const char *name, int size);
|
||||
grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size);
|
||||
grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size);
|
||||
|
||||
#endif /* ! GRUB_BUFIO_H */
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
static inline void
|
||||
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||
grub_size_t len __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
#else
|
||||
void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len);
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_CACHE_HEADER */
|
||||
|
|
72
include/grub/cmos.h
Normal file
72
include/grub/cmos.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_CMOS_H
|
||||
#define GRUB_CMOS_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/cpu/cmos.h>
|
||||
|
||||
#define GRUB_CMOS_INDEX_SECOND 0
|
||||
#define GRUB_CMOS_INDEX_SECOND_ALARM 1
|
||||
#define GRUB_CMOS_INDEX_MINUTE 2
|
||||
#define GRUB_CMOS_INDEX_MINUTE_ALARM 3
|
||||
#define GRUB_CMOS_INDEX_HOUR 4
|
||||
#define GRUB_CMOS_INDEX_HOUR_ALARM 5
|
||||
#define GRUB_CMOS_INDEX_DAY_OF_WEEK 6
|
||||
#define GRUB_CMOS_INDEX_DAY_OF_MONTH 7
|
||||
#define GRUB_CMOS_INDEX_MONTH 8
|
||||
#define GRUB_CMOS_INDEX_YEAR 9
|
||||
|
||||
#define GRUB_CMOS_INDEX_STATUS_A 0xA
|
||||
#define GRUB_CMOS_INDEX_STATUS_B 0xB
|
||||
#define GRUB_CMOS_INDEX_STATUS_C 0xC
|
||||
#define GRUB_CMOS_INDEX_STATUS_D 0xD
|
||||
|
||||
#define GRUB_CMOS_STATUS_B_DAYLIGHT 1
|
||||
#define GRUB_CMOS_STATUS_B_24HOUR 2
|
||||
#define GRUB_CMOS_STATUS_B_BINARY 4
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_bcd_to_num (grub_uint8_t a)
|
||||
{
|
||||
return ((a >> 4) * 10 + (a & 0xF));
|
||||
}
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_num_to_bcd (grub_uint8_t a)
|
||||
{
|
||||
return (((a / 10) << 4) + (a % 10));
|
||||
}
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_cmos_read (grub_uint8_t index)
|
||||
{
|
||||
grub_outb (index, GRUB_CMOS_ADDR_REG);
|
||||
return grub_inb (GRUB_CMOS_DATA_REG);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_cmos_write (grub_uint8_t index, grub_uint8_t value)
|
||||
{
|
||||
grub_outb (index, GRUB_CMOS_ADDR_REG);
|
||||
grub_outb (value, GRUB_CMOS_DATA_REG);
|
||||
}
|
||||
|
||||
#endif /* GRUB_CMOS_H */
|
|
@ -110,10 +110,15 @@ int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
|
|||
#endif
|
||||
void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod));
|
||||
grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name);
|
||||
grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr,
|
||||
grub_dl_t mod);
|
||||
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
|
||||
grub_dl_t mod);
|
||||
|
||||
grub_err_t grub_arch_dl_check_header (void *ehdr);
|
||||
grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr);
|
||||
|
||||
#if defined (_mips) && ! defined (GRUB_UTIL)
|
||||
#define GRUB_LINKER_HAVE_INIT 1
|
||||
void grub_arch_dl_init_linker (void);
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_DL_H */
|
||||
|
|
|
@ -46,12 +46,12 @@ grub_elf_t grub_elf_file (grub_file_t);
|
|||
grub_err_t grub_elf_close (grub_elf_t);
|
||||
|
||||
int grub_elf_is_elf32 (grub_elf_t);
|
||||
grub_size_t grub_elf32_size (grub_elf_t);
|
||||
grub_size_t grub_elf32_size (grub_elf_t, Elf32_Addr *);
|
||||
grub_err_t grub_elf32_load (grub_elf_t, grub_elf32_load_hook_t, grub_addr_t *,
|
||||
grub_size_t *);
|
||||
|
||||
int grub_elf_is_elf64 (grub_elf_t);
|
||||
grub_size_t grub_elf64_size (grub_elf_t);
|
||||
grub_size_t grub_elf64_size (grub_elf_t, Elf64_Addr *);
|
||||
grub_err_t grub_elf64_load (grub_elf_t, grub_elf64_load_hook_t, grub_addr_t *,
|
||||
grub_size_t *);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/menu.h>
|
||||
|
||||
struct grub_env_var;
|
||||
|
||||
|
@ -30,18 +31,6 @@ typedef char *(*grub_env_read_hook_t) (struct grub_env_var *var,
|
|||
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
|
||||
const char *val);
|
||||
|
||||
enum grub_env_var_type
|
||||
{
|
||||
/* The default variable type which is local in current context. */
|
||||
GRUB_ENV_VAR_LOCAL,
|
||||
|
||||
/* The exported type, which is passed to new contexts. */
|
||||
GRUB_ENV_VAR_GLOBAL,
|
||||
|
||||
/* The data slot type, which is used to store arbitrary data. */
|
||||
GRUB_ENV_VAR_DATA
|
||||
};
|
||||
|
||||
struct grub_env_var
|
||||
{
|
||||
char *name;
|
||||
|
@ -50,23 +39,24 @@ struct grub_env_var
|
|||
grub_env_write_hook_t write_hook;
|
||||
struct grub_env_var *next;
|
||||
struct grub_env_var **prevp;
|
||||
enum grub_env_var_type type;
|
||||
int global;
|
||||
};
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_env_set) (const char *name, const char *val);
|
||||
char *EXPORT_FUNC(grub_env_get) (const char *name);
|
||||
void EXPORT_FUNC(grub_env_unset) (const char *name);
|
||||
void EXPORT_FUNC(grub_env_iterate) (int (*func) (struct grub_env_var *var));
|
||||
struct grub_env_var *EXPORT_FUNC(grub_env_find) (const char *name);
|
||||
grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name,
|
||||
grub_env_read_hook_t read_hook,
|
||||
grub_env_write_hook_t write_hook);
|
||||
grub_err_t EXPORT_FUNC(grub_env_context_open) (int export);
|
||||
grub_err_t EXPORT_FUNC(grub_env_context_close) (void);
|
||||
grub_err_t EXPORT_FUNC(grub_env_export) (const char *name);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_env_set_data_slot) (const char *name,
|
||||
const void *ptr);
|
||||
void *EXPORT_FUNC(grub_env_get_data_slot) (const char *name);
|
||||
void EXPORT_FUNC(grub_env_unset_data_slot) (const char *name);
|
||||
grub_err_t grub_env_context_open (int export);
|
||||
grub_err_t grub_env_context_close (void);
|
||||
grub_err_t grub_env_export (const char *name);
|
||||
|
||||
void grub_env_unset_menu (void);
|
||||
grub_menu_t grub_env_get_menu (void);
|
||||
void grub_env_set_menu (grub_menu_t nmenu);
|
||||
|
||||
#endif /* ! GRUB_ENV_HEADER */
|
||||
|
|
46
include/grub/env_private.h
Normal file
46
include/grub/env_private.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2005,2006,2007,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_ENV_PRIVATE_HEADER
|
||||
#define GRUB_ENV_PRIVATE_HEADER 1
|
||||
|
||||
#include <grub/env.h>
|
||||
|
||||
/* The size of the hash table. */
|
||||
#define HASHSZ 13
|
||||
|
||||
/* A hashtable for quick lookup of variables. */
|
||||
struct grub_env_context
|
||||
{
|
||||
/* A hash table for variables. */
|
||||
struct grub_env_var *vars[HASHSZ];
|
||||
|
||||
/* One level deeper on the stack. */
|
||||
struct grub_env_context *prev;
|
||||
};
|
||||
|
||||
/* This is used for sorting only. */
|
||||
struct grub_env_sorted_var
|
||||
{
|
||||
struct grub_env_var *var;
|
||||
struct grub_env_sorted_var *next;
|
||||
};
|
||||
|
||||
extern struct grub_env_context *EXPORT_VAR(grub_current_context);
|
||||
|
||||
#endif /* ! GRUB_ENV_PRIVATE_HEADER */
|
|
@ -66,7 +66,7 @@ void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn));
|
|||
void EXPORT_FUNC(grub_error_push) (void);
|
||||
int EXPORT_FUNC(grub_error_pop) (void);
|
||||
void EXPORT_FUNC(grub_print_error) (void);
|
||||
int EXPORT_FUNC(grub_err_printf) (const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
int grub_err_printf (const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
#endif /* ! GRUB_ERR_HEADER */
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/file.h>
|
||||
|
||||
/* Forward declaration of opaque structure grub_font.
|
||||
Users only pass struct grub_font pointers to the font module functions,
|
||||
|
@ -80,36 +81,38 @@ int grub_font_load (const char *filename);
|
|||
"Family Name Bold Italic 14", where Bold and Italic are optional.
|
||||
If no font matches the name specified, the most recently loaded font
|
||||
is returned as a fallback. */
|
||||
grub_font_t grub_font_get (const char *font_name);
|
||||
grub_font_t EXPORT_FUNC (grub_font_get) (const char *font_name);
|
||||
|
||||
const char *grub_font_get_name (grub_font_t font);
|
||||
const char *EXPORT_FUNC (grub_font_get_name) (grub_font_t font);
|
||||
|
||||
int grub_font_get_max_char_width (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_max_char_width) (grub_font_t font);
|
||||
|
||||
int grub_font_get_max_char_height (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_max_char_height) (grub_font_t font);
|
||||
|
||||
int grub_font_get_ascent (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_ascent) (grub_font_t font);
|
||||
|
||||
int grub_font_get_descent (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_descent) (grub_font_t font);
|
||||
|
||||
int grub_font_get_leading (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_leading) (grub_font_t font);
|
||||
|
||||
int grub_font_get_height (grub_font_t font);
|
||||
int EXPORT_FUNC (grub_font_get_height) (grub_font_t font);
|
||||
|
||||
int grub_font_get_string_width (grub_font_t font, const char *str);
|
||||
int EXPORT_FUNC (grub_font_get_string_width) (grub_font_t font,
|
||||
const char *str);
|
||||
|
||||
struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,
|
||||
grub_uint32_t code);
|
||||
struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph) (grub_font_t font,
|
||||
grub_uint32_t code);
|
||||
|
||||
struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font,
|
||||
grub_uint32_t code);
|
||||
struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph_with_fallback) (grub_font_t font,
|
||||
grub_uint32_t code);
|
||||
|
||||
grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph,
|
||||
grub_video_color_t color,
|
||||
int left_x, int baseline_y);
|
||||
grub_err_t EXPORT_FUNC (grub_font_draw_glyph) (struct grub_font_glyph *glyph,
|
||||
grub_video_color_t color,
|
||||
int left_x, int baseline_y);
|
||||
|
||||
grub_err_t grub_font_draw_string (const char *str, grub_font_t font,
|
||||
grub_video_color_t color,
|
||||
int left_x, int baseline_y);
|
||||
grub_err_t EXPORT_FUNC (grub_font_draw_string) (const char *str,
|
||||
grub_font_t font,
|
||||
grub_video_color_t color,
|
||||
int left_x, int baseline_y);
|
||||
|
||||
#endif /* ! GRUB_FONT_HEADER */
|
||||
|
|
38
include/grub/fontformat.h
Normal file
38
include/grub/fontformat.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2010 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_FONT_FORMAT_HEADER
|
||||
#define GRUB_FONT_FORMAT_HEADER 1
|
||||
|
||||
/* FONT_FORMAT_PFF2_MAGIC use only 4 relevants bytes and the \0. */
|
||||
#define FONT_FORMAT_PFF2_MAGIC "PFF2"
|
||||
#define FONT_FORMAT_SECTION_NAMES_FILE "FILE"
|
||||
#define FONT_FORMAT_SECTION_NAMES_FONT_NAME "NAME"
|
||||
#define FONT_FORMAT_SECTION_NAMES_POINT_SIZE "PTSZ"
|
||||
#define FONT_FORMAT_SECTION_NAMES_WEIGHT "WEIG"
|
||||
#define FONT_FORMAT_SECTION_NAMES_MAX_CHAR_WIDTH "MAXW"
|
||||
#define FONT_FORMAT_SECTION_NAMES_MAX_CHAR_HEIGHT "MAXH"
|
||||
#define FONT_FORMAT_SECTION_NAMES_ASCENT "ASCE"
|
||||
#define FONT_FORMAT_SECTION_NAMES_DESCENT "DESC"
|
||||
#define FONT_FORMAT_SECTION_NAMES_CHAR_INDEX "CHIX"
|
||||
#define FONT_FORMAT_SECTION_NAMES_DATA "DATA"
|
||||
#define FONT_FORMAT_SECTION_NAMES_FAMILY "FAMI"
|
||||
#define FONT_FORMAT_SECTION_NAMES_SLAN "SLAN"
|
||||
|
||||
#endif /* ! GRUB_FONT_FORMAT_HEADER */
|
||||
|
1
include/grub/gfxmenu_model.h
Normal file
1
include/grub/gfxmenu_model.h
Normal file
|
@ -0,0 +1 @@
|
|||
|
107
include/grub/gfxmenu_view.h
Normal file
107
include/grub/gfxmenu_view.h
Normal file
|
@ -0,0 +1,107 @@
|
|||
/* gfxmenu_view.h - gfxmenu view interface. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_GFXMENU_VIEW_HEADER
|
||||
#define GRUB_GFXMENU_VIEW_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/menu.h>
|
||||
#include <grub/font.h>
|
||||
#include <grub/gfxwidgets.h>
|
||||
|
||||
struct grub_gfxmenu_view; /* Forward declaration of opaque type. */
|
||||
typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t;
|
||||
|
||||
|
||||
grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path,
|
||||
int width, int height);
|
||||
|
||||
void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view);
|
||||
|
||||
/* Set properties on the view based on settings from the specified
|
||||
theme file. */
|
||||
grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view,
|
||||
const char *theme_path);
|
||||
|
||||
grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr,
|
||||
const char *pattern, const char *theme_dir);
|
||||
|
||||
void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view);
|
||||
|
||||
void
|
||||
grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view);
|
||||
|
||||
void
|
||||
grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view);
|
||||
|
||||
void
|
||||
grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
|
||||
const grub_video_rect_t *region);
|
||||
|
||||
void
|
||||
grub_gfxmenu_clear_timeout (void *data);
|
||||
void
|
||||
grub_gfxmenu_print_timeout (int timeout, void *data);
|
||||
void
|
||||
grub_gfxmenu_set_chosen_entry (int entry, void *data);
|
||||
|
||||
/* Implementation details -- this should not be used outside of the
|
||||
view itself. */
|
||||
|
||||
#include <grub/video.h>
|
||||
#include <grub/bitmap.h>
|
||||
#include <grub/gui.h>
|
||||
#include <grub/gfxwidgets.h>
|
||||
#include <grub/icon_manager.h>
|
||||
|
||||
/* Definition of the private representation of the view. */
|
||||
struct grub_gfxmenu_view
|
||||
{
|
||||
grub_video_rect_t screen;
|
||||
|
||||
grub_font_t title_font;
|
||||
grub_font_t message_font;
|
||||
char *terminal_font_name;
|
||||
grub_gui_color_t title_color;
|
||||
grub_gui_color_t message_color;
|
||||
grub_gui_color_t message_bg_color;
|
||||
struct grub_video_bitmap *desktop_image;
|
||||
grub_gui_color_t desktop_color;
|
||||
grub_gfxmenu_box_t terminal_box;
|
||||
char *title_text;
|
||||
char *progress_message_text;
|
||||
char *theme_path;
|
||||
|
||||
grub_gui_container_t canvas;
|
||||
|
||||
int double_repaint;
|
||||
|
||||
int selected;
|
||||
|
||||
grub_video_rect_t progress_message_frame;
|
||||
|
||||
grub_menu_t menu;
|
||||
|
||||
int nested;
|
||||
|
||||
int first_timeout;
|
||||
};
|
||||
|
||||
#endif /* ! GRUB_GFXMENU_VIEW_HEADER */
|
44
include/grub/gfxterm.h
Normal file
44
include/grub/gfxterm.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006,2007,2008 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_GFXTERM_HEADER
|
||||
#define GRUB_GFXTERM_HEADER 1
|
||||
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/video.h>
|
||||
|
||||
grub_err_t
|
||||
EXPORT_FUNC (grub_gfxterm_set_window) (struct grub_video_render_target *target,
|
||||
int x, int y, int width, int height,
|
||||
int double_repaint,
|
||||
const char *font_name, 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);
|
||||
|
||||
grub_err_t EXPORT_FUNC (grub_gfxterm_fullscreen) (void);
|
||||
|
||||
extern void (*EXPORT_VAR (grub_gfxterm_decorator_hook)) (void);
|
||||
|
||||
#endif /* ! GRUB_GFXTERM_HEADER */
|
49
include/grub/gfxwidgets.h
Normal file
49
include/grub/gfxwidgets.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* gfxwidgets.h - Widgets for the graphical menu (gfxmenu). */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 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_GFXWIDGETS_HEADER
|
||||
#define GRUB_GFXWIDGETS_HEADER 1
|
||||
|
||||
#include <grub/video.h>
|
||||
|
||||
typedef struct grub_gfxmenu_box *grub_gfxmenu_box_t;
|
||||
|
||||
struct grub_gfxmenu_box
|
||||
{
|
||||
/* The size of the content. */
|
||||
int content_width;
|
||||
int content_height;
|
||||
|
||||
struct grub_video_bitmap **raw_pixmaps;
|
||||
struct grub_video_bitmap **scaled_pixmaps;
|
||||
|
||||
void (*draw) (grub_gfxmenu_box_t self, int x, int y);
|
||||
void (*set_content_size) (grub_gfxmenu_box_t self,
|
||||
int width, int height);
|
||||
int (*get_left_pad) (grub_gfxmenu_box_t self);
|
||||
int (*get_top_pad) (grub_gfxmenu_box_t self);
|
||||
int (*get_right_pad) (grub_gfxmenu_box_t self);
|
||||
int (*get_bottom_pad) (grub_gfxmenu_box_t self);
|
||||
void (*destroy) (grub_gfxmenu_box_t self);
|
||||
};
|
||||
|
||||
grub_gfxmenu_box_t grub_gfxmenu_create_box (const char *pixmaps_prefix,
|
||||
const char *pixmaps_suffix);
|
||||
|
||||
#endif /* ! GRUB_GFXWIDGETS_HEADER */
|
230
include/grub/gui.h
Normal file
230
include/grub/gui.h
Normal file
|
@ -0,0 +1,230 @@
|
|||
/* gui.h - GUI components header file. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/bitmap.h>
|
||||
#include <grub/gfxmenu_view.h>
|
||||
|
||||
#ifndef GRUB_GUI_H
|
||||
#define GRUB_GUI_H 1
|
||||
|
||||
/* A representation of a color. Unlike grub_video_color_t, this
|
||||
representation is independent of any video mode specifics. */
|
||||
typedef struct grub_gui_color
|
||||
{
|
||||
grub_uint8_t red;
|
||||
grub_uint8_t green;
|
||||
grub_uint8_t blue;
|
||||
grub_uint8_t alpha;
|
||||
} grub_gui_color_t;
|
||||
|
||||
typedef struct grub_gui_component *grub_gui_component_t;
|
||||
typedef struct grub_gui_container *grub_gui_container_t;
|
||||
typedef struct grub_gui_list *grub_gui_list_t;
|
||||
|
||||
typedef void (*grub_gui_component_callback) (grub_gui_component_t component,
|
||||
void *userdata);
|
||||
|
||||
/* Component interface. */
|
||||
|
||||
struct grub_gui_component_ops
|
||||
{
|
||||
void (*destroy) (void *self);
|
||||
const char * (*get_id) (void *self);
|
||||
int (*is_instance) (void *self, const char *type);
|
||||
void (*paint) (void *self, const grub_video_rect_t *bounds);
|
||||
void (*set_parent) (void *self, grub_gui_container_t parent);
|
||||
grub_gui_container_t (*get_parent) (void *self);
|
||||
void (*set_bounds) (void *self, const grub_video_rect_t *bounds);
|
||||
void (*get_bounds) (void *self, grub_video_rect_t *bounds);
|
||||
void (*get_minimal_size) (void *self, unsigned *width, unsigned *height);
|
||||
grub_err_t (*set_property) (void *self, const char *name, const char *value);
|
||||
void (*repaint) (void *self, int second_pass);
|
||||
};
|
||||
|
||||
struct grub_gui_container_ops
|
||||
{
|
||||
void (*add) (void *self, grub_gui_component_t comp);
|
||||
void (*remove) (void *self, grub_gui_component_t comp);
|
||||
void (*iterate_children) (void *self,
|
||||
grub_gui_component_callback cb, void *userdata);
|
||||
};
|
||||
|
||||
struct grub_gui_list_ops
|
||||
{
|
||||
void (*set_view_info) (void *self,
|
||||
grub_gfxmenu_view_t view);
|
||||
};
|
||||
|
||||
struct grub_gui_progress_ops
|
||||
{
|
||||
void (*set_state) (void *self, int visible, int start, int current, int end);
|
||||
};
|
||||
|
||||
typedef signed grub_fixed_signed_t;
|
||||
#define GRUB_FIXED_1 0x10000
|
||||
|
||||
static inline signed
|
||||
grub_fixed_sfs_divide (signed a, grub_fixed_signed_t b)
|
||||
{
|
||||
return (a * GRUB_FIXED_1) / b;
|
||||
}
|
||||
|
||||
static inline grub_fixed_signed_t
|
||||
grub_fixed_fsf_divide (grub_fixed_signed_t a, signed b)
|
||||
{
|
||||
return a / b;
|
||||
}
|
||||
|
||||
static inline signed
|
||||
grub_fixed_sfs_multiply (signed a, grub_fixed_signed_t b)
|
||||
{
|
||||
return (a * b) / GRUB_FIXED_1;
|
||||
}
|
||||
|
||||
static inline signed
|
||||
grub_fixed_to_signed (grub_fixed_signed_t in)
|
||||
{
|
||||
return in / GRUB_FIXED_1;
|
||||
}
|
||||
|
||||
static inline grub_fixed_signed_t
|
||||
grub_signed_to_fixed (signed in)
|
||||
{
|
||||
return in * GRUB_FIXED_1;
|
||||
}
|
||||
|
||||
struct grub_gui_component
|
||||
{
|
||||
struct grub_gui_component_ops *ops;
|
||||
signed x;
|
||||
grub_fixed_signed_t xfrac;
|
||||
signed y;
|
||||
grub_fixed_signed_t yfrac;
|
||||
signed w;
|
||||
grub_fixed_signed_t wfrac;
|
||||
signed h;
|
||||
grub_fixed_signed_t hfrac;
|
||||
};
|
||||
|
||||
struct grub_gui_progress
|
||||
{
|
||||
struct grub_gui_component component;
|
||||
struct grub_gui_progress_ops *ops;
|
||||
};
|
||||
|
||||
struct grub_gui_container
|
||||
{
|
||||
struct grub_gui_component component;
|
||||
struct grub_gui_container_ops *ops;
|
||||
};
|
||||
|
||||
struct grub_gui_list
|
||||
{
|
||||
struct grub_gui_component component;
|
||||
struct grub_gui_list_ops *ops;
|
||||
};
|
||||
|
||||
|
||||
/* Interfaces to concrete component classes. */
|
||||
|
||||
grub_gui_container_t grub_gui_canvas_new (void);
|
||||
grub_gui_container_t grub_gui_vbox_new (void);
|
||||
grub_gui_container_t grub_gui_hbox_new (void);
|
||||
grub_gui_component_t grub_gui_label_new (void);
|
||||
grub_gui_component_t grub_gui_image_new (void);
|
||||
grub_gui_component_t grub_gui_progress_bar_new (void);
|
||||
grub_gui_component_t grub_gui_list_new (void);
|
||||
grub_gui_component_t grub_gui_circular_progress_new (void);
|
||||
|
||||
/* Manipulation functions. */
|
||||
|
||||
/* Visit all components with the specified ID. */
|
||||
void grub_gui_find_by_id (grub_gui_component_t root,
|
||||
const char *id,
|
||||
grub_gui_component_callback cb,
|
||||
void *userdata);
|
||||
|
||||
/* Visit all components. */
|
||||
void grub_gui_iterate_recursively (grub_gui_component_t root,
|
||||
grub_gui_component_callback cb,
|
||||
void *userdata);
|
||||
|
||||
/* Helper functions. */
|
||||
|
||||
static __inline void
|
||||
grub_gui_save_viewport (grub_video_rect_t *r)
|
||||
{
|
||||
grub_video_get_viewport ((unsigned *) &r->x,
|
||||
(unsigned *) &r->y,
|
||||
(unsigned *) &r->width,
|
||||
(unsigned *) &r->height);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_gui_restore_viewport (const grub_video_rect_t *r)
|
||||
{
|
||||
grub_video_set_viewport (r->x, r->y, r->width, r->height);
|
||||
}
|
||||
|
||||
/* Set a new viewport relative the the current one, saving the current
|
||||
viewport in OLD so it can be later restored. */
|
||||
static __inline void
|
||||
grub_gui_set_viewport (const grub_video_rect_t *r, grub_video_rect_t *old)
|
||||
{
|
||||
grub_gui_save_viewport (old);
|
||||
grub_video_set_viewport (old->x + r->x,
|
||||
old->y + r->y,
|
||||
r->width,
|
||||
r->height);
|
||||
}
|
||||
|
||||
static __inline grub_gui_color_t
|
||||
grub_gui_color_rgb (int r, int g, int b)
|
||||
{
|
||||
grub_gui_color_t c;
|
||||
c.red = r;
|
||||
c.green = g;
|
||||
c.blue = b;
|
||||
c.alpha = 255;
|
||||
return c;
|
||||
}
|
||||
|
||||
static __inline grub_video_color_t
|
||||
grub_gui_map_color (grub_gui_color_t c)
|
||||
{
|
||||
return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_video_have_common_points (const grub_video_rect_t *a,
|
||||
const grub_video_rect_t *b)
|
||||
{
|
||||
if (!((a->x <= b->x && b->x <= a->x + a->width)
|
||||
|| (b->x <= a->x && a->x <= b->x + b->width)))
|
||||
return 0;
|
||||
if (!((a->y <= b->y && b->y <= a->y + a->height)
|
||||
|| (b->y <= a->y && a->y <= b->y + b->height)))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_GUI_H */
|
37
include/grub/gui_string_util.h
Normal file
37
include/grub/gui_string_util.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* gui_string_util.h - String utilities for the graphical menu interface. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_GUI_STRING_UTIL_HEADER
|
||||
#define GRUB_GUI_STRING_UTIL_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/gui.h>
|
||||
|
||||
char *grub_new_substring (const char *buf,
|
||||
grub_size_t start, grub_size_t end);
|
||||
|
||||
char *grub_resolve_relative_path (const char *base, const char *path);
|
||||
|
||||
char *grub_get_dirname (const char *file_path);
|
||||
|
||||
int grub_gui_get_named_color (const char *name, grub_gui_color_t *color);
|
||||
|
||||
grub_err_t grub_gui_parse_color (const char *s, grub_gui_color_t *color);
|
||||
|
||||
#endif /* GRUB_GUI_STRING_UTIL_HEADER */
|
|
@ -22,7 +22,6 @@
|
|||
#include <config.h>
|
||||
#include <grub/symbol.h>
|
||||
|
||||
const char *EXPORT_FUNC(grub_gettext_dummy) (const char *s);
|
||||
extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
|
|
|
@ -19,40 +19,7 @@
|
|||
#ifndef GRUB_CPU_AT_KEYBOARD_HEADER
|
||||
#define GRUB_CPU_AT_KEYBOARD_HEADER 1
|
||||
|
||||
|
||||
#define SHIFT_L 0x2a
|
||||
#define SHIFT_R 0x36
|
||||
#define CTRL 0x1d
|
||||
#define ALT 0x38
|
||||
#define CAPS_LOCK 0x3a
|
||||
#define NUM_LOCK 0x45
|
||||
#define SCROLL_LOCK 0x46
|
||||
|
||||
#define KEYBOARD_REG_DATA 0x60
|
||||
#define KEYBOARD_REG_STATUS 0x64
|
||||
|
||||
/* Used for sending commands to the controller. */
|
||||
#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
|
||||
#define KEYBOARD_COMMAND_READ 0x20
|
||||
#define KEYBOARD_COMMAND_WRITE 0x60
|
||||
#define KEYBOARD_COMMAND_REBOOT 0xfe
|
||||
|
||||
#define KEYBOARD_SCANCODE_SET1 0x40
|
||||
|
||||
#define KEYBOARD_ISMAKE(x) !((x) & 0x80)
|
||||
#define KEYBOARD_ISREADY(x) ((x) & 0x01)
|
||||
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
|
||||
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define OLPC_UP GRUB_TERM_UP
|
||||
#define OLPC_DOWN GRUB_TERM_DOWN
|
||||
#define OLPC_LEFT GRUB_TERM_LEFT
|
||||
#define OLPC_RIGHT GRUB_TERM_RIGHT
|
||||
#else
|
||||
#define OLPC_UP '\0'
|
||||
#define OLPC_DOWN '\0'
|
||||
#define OLPC_LEFT '\0'
|
||||
#define OLPC_RIGHT '\0'
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,13 @@
|
|||
#define GRUB_BSD_CPU_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/i386/freebsd_reboot.h>
|
||||
#include <grub/i386/netbsd_reboot.h>
|
||||
#include <grub/i386/openbsd_reboot.h>
|
||||
#include <grub/i386/freebsd_linker.h>
|
||||
#include <grub/i386/netbsd_bootinfo.h>
|
||||
#include <grub/i386/openbsd_bootarg.h>
|
||||
|
||||
|
||||
enum bsd_kernel_types
|
||||
{
|
||||
|
@ -31,61 +38,11 @@ enum bsd_kernel_types
|
|||
|
||||
#define GRUB_BSD_TEMP_BUFFER 0x80000
|
||||
|
||||
#define FREEBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define FREEBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define FREEBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define FREEBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define FREEBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */
|
||||
#define FREEBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define FREEBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define FREEBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define FREEBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define FREEBSD_RB_CONFIG (1 << 10) /* invoke user configuration routing */
|
||||
#define FREEBSD_RB_VERBOSE (1 << 11) /* print all potentially useful info */
|
||||
#define FREEBSD_RB_SERIAL (1 << 12) /* user serial port as console */
|
||||
#define FREEBSD_RB_CDROM (1 << 13) /* use cdrom as root */
|
||||
#define FREEBSD_RB_GDB (1 << 15) /* use GDB remote debugger instead of DDB */
|
||||
#define FREEBSD_RB_MUTE (1 << 16) /* Come up with the console muted */
|
||||
#define FREEBSD_RB_PAUSE (1 << 20)
|
||||
#define FREEBSD_RB_QUIET (1 << 21)
|
||||
#define FREEBSD_RB_NOINTR (1 << 28)
|
||||
#define FREENSD_RB_MULTIPLE (1 << 29) /* Use multiple consoles */
|
||||
#define FREEBSD_RB_DUAL FREENSD_RB_MULTIPLE
|
||||
#define FREEBSD_RB_BOOTINFO (1 << 31) /* have `struct bootinfo *' arg */
|
||||
|
||||
#define FREEBSD_B_DEVMAGIC 0xa0000000
|
||||
#define FREEBSD_B_SLICESHIFT 20
|
||||
#define FREEBSD_B_UNITSHIFT 16
|
||||
#define FREEBSD_B_PARTSHIFT 8
|
||||
#define FREEBSD_B_TYPESHIFT 0
|
||||
|
||||
#define FREEBSD_BOOTINFO_VERSION 1
|
||||
#define FREEBSD_N_BIOS_GEOM 8
|
||||
|
||||
#define FREEBSD_MODINFO_END 0x0000 /* End of list */
|
||||
#define FREEBSD_MODINFO_NAME 0x0001 /* Name of module (string) */
|
||||
#define FREEBSD_MODINFO_TYPE 0x0002 /* Type of module (string) */
|
||||
#define FREEBSD_MODINFO_ADDR 0x0003 /* Loaded address */
|
||||
#define FREEBSD_MODINFO_SIZE 0x0004 /* Size of module */
|
||||
#define FREEBSD_MODINFO_EMPTY 0x0005 /* Has been deleted */
|
||||
#define FREEBSD_MODINFO_ARGS 0x0006 /* Parameters string */
|
||||
#define FREEBSD_MODINFO_METADATA 0x8000 /* Module-specfic */
|
||||
|
||||
#define FREEBSD_MODINFOMD_AOUTEXEC 0x0001 /* a.out exec header */
|
||||
#define FREEBSD_MODINFOMD_ELFHDR 0x0002 /* ELF header */
|
||||
#define FREEBSD_MODINFOMD_SSYM 0x0003 /* start of symbols */
|
||||
#define FREEBSD_MODINFOMD_ESYM 0x0004 /* end of symbols */
|
||||
#define FREEBSD_MODINFOMD_DYNAMIC 0x0005 /* _DYNAMIC pointer */
|
||||
#define FREEBSD_MODINFOMD_ENVP 0x0006 /* envp[] */
|
||||
#define FREEBSD_MODINFOMD_HOWTO 0x0007 /* boothowto */
|
||||
#define FREEBSD_MODINFOMD_KERNEND 0x0008 /* kernend */
|
||||
#define FREEBSD_MODINFOMD_SHDR 0x0009 /* section header table */
|
||||
#define FREEBSD_MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */
|
||||
|
||||
#define FREEBSD_MODINFOMD_SMAP 0x1001
|
||||
|
||||
#define FREEBSD_MODINFOMD_DEPLIST (0x4001 | FREEBSD_MODINFOMD_NOCOPY) /* depends on */
|
||||
#define FREEBSD_B_DEVMAGIC OPENBSD_B_DEVMAGIC
|
||||
#define FREEBSD_B_SLICESHIFT OPENBSD_B_CTRLSHIFT
|
||||
#define FREEBSD_B_UNITSHIFT OPENBSD_B_UNITSHIFT
|
||||
#define FREEBSD_B_PARTSHIFT OPENBSD_B_PARTSHIFT
|
||||
#define FREEBSD_B_TYPESHIFT OPENBSD_B_TYPESHIFT
|
||||
|
||||
#define FREEBSD_MODTYPE_KERNEL "elf kernel"
|
||||
#define FREEBSD_MODTYPE_KERNEL64 "elf64 kernel"
|
||||
|
@ -93,64 +50,21 @@ enum bsd_kernel_types
|
|||
#define FREEBSD_MODTYPE_ELF_MODULE_OBJ "elf obj module"
|
||||
#define FREEBSD_MODTYPE_RAW "raw"
|
||||
|
||||
#define FREEBSD_BOOTINFO_VERSION 1
|
||||
|
||||
struct grub_freebsd_bootinfo
|
||||
{
|
||||
grub_uint32_t bi_version;
|
||||
grub_uint8_t *bi_kernelname;
|
||||
struct nfs_diskless *bi_nfs_diskless;
|
||||
grub_uint32_t bi_n_bios_used;
|
||||
grub_uint32_t bi_bios_geom[FREEBSD_N_BIOS_GEOM];
|
||||
grub_uint32_t bi_size;
|
||||
grub_uint8_t bi_memsizes_valid;
|
||||
grub_uint8_t bi_bios_dev;
|
||||
grub_uint8_t bi_pad[2];
|
||||
grub_uint32_t bi_basemem;
|
||||
grub_uint32_t bi_extmem;
|
||||
grub_uint32_t bi_symtab;
|
||||
grub_uint32_t bi_esymtab;
|
||||
grub_uint32_t bi_kernend;
|
||||
grub_uint32_t bi_envp;
|
||||
grub_uint32_t bi_modulep;
|
||||
grub_uint32_t version;
|
||||
grub_uint8_t unused1[44];
|
||||
grub_uint32_t length;
|
||||
grub_uint8_t unused2;
|
||||
grub_uint8_t boot_device;
|
||||
grub_uint8_t unused3[18];
|
||||
grub_uint32_t kern_end;
|
||||
grub_uint32_t environment;
|
||||
grub_uint32_t tags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define OPENBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define OPENBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define OPENBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define OPENBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define OPENBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define OPENBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */
|
||||
#define OPENBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define OPENBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define OPENBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define OPENBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define OPENBSD_RB_CONFIG (1 << 10) /* change configured devices */
|
||||
#define OPENBSD_RB_TIMEBAD (1 << 11) /* don't call resettodr() in boot() */
|
||||
#define OPENBSD_RB_POWERDOWN (1 << 12) /* attempt to power down machine */
|
||||
#define OPENBSD_RB_SERCONS (1 << 13) /* use serial console if available */
|
||||
#define OPENBSD_RB_USERREQ (1 << 14) /* boot() called at user request (e.g. ddb) */
|
||||
|
||||
#define OPENBSD_B_DEVMAGIC 0xa0000000
|
||||
#define OPENBSD_B_ADAPTORSHIFT 24
|
||||
#define OPENBSD_B_CTRLSHIFT 20
|
||||
#define OPENBSD_B_UNITSHIFT 16
|
||||
#define OPENBSD_B_PARTSHIFT 8
|
||||
#define OPENBSD_B_TYPESHIFT 0
|
||||
|
||||
#define OPENBSD_BOOTARG_APIVER (OPENBSD_BAPIV_VECTOR | \
|
||||
OPENBSD_BAPIV_ENV | \
|
||||
OPENBSD_BAPIV_BMEMMAP)
|
||||
|
||||
#define OPENBSD_BAPIV_ANCIENT 0x0 /* MD old i386 bootblocks */
|
||||
#define OPENBSD_BAPIV_VARS 0x1 /* MD structure w/ add info passed */
|
||||
#define OPENBSD_BAPIV_VECTOR 0x2 /* MI vector of MD structures passed */
|
||||
#define OPENBSD_BAPIV_ENV 0x4 /* MI environment vars vector */
|
||||
#define OPENBSD_BAPIV_BMEMMAP 0x8 /* MI memory map passed is in bytes */
|
||||
|
||||
#define OPENBSD_BOOTARG_ENV 0x1000
|
||||
#define OPENBSD_BOOTARG_END -1
|
||||
|
||||
#define OPENBSD_BOOTARG_MMAP 0
|
||||
|
||||
struct grub_openbsd_bios_mmap
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
|
@ -162,97 +76,6 @@ struct grub_openbsd_bios_mmap
|
|||
grub_uint32_t type;
|
||||
};
|
||||
|
||||
struct grub_openbsd_bootargs
|
||||
{
|
||||
int ba_type;
|
||||
int ba_size;
|
||||
struct grub_openbsd_bootargs *ba_next;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define NETBSD_RB_AUTOBOOT 0 /* flags for system auto-booting itself */
|
||||
|
||||
#define NETBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define NETBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define NETBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define NETBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define NETBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define NETBSD_RB_UNUSED1 (1 << 5) /* was RB_DFLTROOT, obsolete */
|
||||
#define NETBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define NETBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define NETBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define NETBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define NETBSD_RB_STRING (1 << 10) /* use provided bootstr */
|
||||
#define NETBSD_RB_POWERDOWN ((1 << 11) | RB_HALT) /* turn power off (or at least halt) */
|
||||
#define NETBSD_RB_USERCONFIG (1 << 12) /* change configured devices */
|
||||
|
||||
#define NETBSD_AB_NORMAL 0 /* boot normally (default) */
|
||||
|
||||
#define NETBSD_AB_QUIET (1 << 16) /* boot quietly */
|
||||
#define NETBSD_AB_VERBOSE (1 << 17) /* boot verbosely */
|
||||
#define NETBSD_AB_SILENT (1 << 18) /* boot silently */
|
||||
#define NETBSD_AB_DEBUG (1 << 19) /* boot with debug messages */
|
||||
#define NETBSD_AB_NOSMP (1 << 28) /* Boot without SMP support. */
|
||||
#define NETBSD_AB_NOACPI (1 << 29) /* Boot without ACPI support. */
|
||||
|
||||
struct grub_netbsd_bootinfo
|
||||
{
|
||||
grub_uint32_t bi_count;
|
||||
void *bi_data[1];
|
||||
};
|
||||
|
||||
#define NETBSD_BTINFO_BOOTPATH 0
|
||||
#define NETBSD_BTINFO_ROOTDEVICE 1
|
||||
#define NETBSD_BTINFO_BOOTDISK 3
|
||||
#define NETBSD_BTINFO_MEMMAP 9
|
||||
|
||||
struct grub_netbsd_btinfo_common
|
||||
{
|
||||
int len;
|
||||
int type;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_mmap_header
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
grub_uint32_t count;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_mmap_entry
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t len;
|
||||
#define NETBSD_MMAP_AVAILABLE 1
|
||||
#define NETBSD_MMAP_RESERVED 2
|
||||
#define NETBSD_MMAP_ACPI 3
|
||||
#define NETBSD_MMAP_NVS 4
|
||||
grub_uint32_t type;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_bootpath
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
char bootpath[80];
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_rootdevice
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
char devname[16];
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_bootdisk
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
int labelsector; /* label valid if != -1 */
|
||||
struct
|
||||
{
|
||||
grub_uint16_t type, checksum;
|
||||
char packname[16];
|
||||
} label;
|
||||
int biosdev;
|
||||
int partition;
|
||||
};
|
||||
|
||||
void grub_unix_real_boot (grub_addr_t entry, ...)
|
||||
__attribute__ ((cdecl,noreturn));
|
||||
grub_err_t grub_freebsd_load_elfmodule32 (grub_file_t file, int argc,
|
||||
|
|
|
@ -20,55 +20,9 @@
|
|||
#define GRUB_CPU_CMOS_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/i386/io.h>
|
||||
#include <grub/cpu/io.h>
|
||||
|
||||
#define GRUB_CMOS_ADDR_REG 0x70
|
||||
#define GRUB_CMOS_DATA_REG 0x71
|
||||
|
||||
#define GRUB_CMOS_INDEX_SECOND 0
|
||||
#define GRUB_CMOS_INDEX_SECOND_ALARM 1
|
||||
#define GRUB_CMOS_INDEX_MINUTE 2
|
||||
#define GRUB_CMOS_INDEX_MINUTE_ALARM 3
|
||||
#define GRUB_CMOS_INDEX_HOUR 4
|
||||
#define GRUB_CMOS_INDEX_HOUR_ALARM 5
|
||||
#define GRUB_CMOS_INDEX_DAY_OF_WEEK 6
|
||||
#define GRUB_CMOS_INDEX_DAY_OF_MONTH 7
|
||||
#define GRUB_CMOS_INDEX_MONTH 8
|
||||
#define GRUB_CMOS_INDEX_YEAR 9
|
||||
|
||||
#define GRUB_CMOS_INDEX_STATUS_A 0xA
|
||||
#define GRUB_CMOS_INDEX_STATUS_B 0xB
|
||||
#define GRUB_CMOS_INDEX_STATUS_C 0xC
|
||||
#define GRUB_CMOS_INDEX_STATUS_D 0xD
|
||||
|
||||
#define GRUB_CMOS_STATUS_B_DAYLIGHT 1
|
||||
#define GRUB_CMOS_STATUS_B_24HOUR 2
|
||||
#define GRUB_CMOS_STATUS_B_BINARY 4
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_bcd_to_num (grub_uint8_t a)
|
||||
{
|
||||
return ((a >> 4) * 10 + (a & 0xF));
|
||||
}
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_num_to_bcd (grub_uint8_t a)
|
||||
{
|
||||
return (((a / 10) << 4) + (a % 10));
|
||||
}
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_cmos_read (grub_uint8_t index)
|
||||
{
|
||||
grub_outb (index, GRUB_CMOS_ADDR_REG);
|
||||
return grub_inb (GRUB_CMOS_DATA_REG);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_cmos_write (grub_uint8_t index, grub_uint8_t value)
|
||||
{
|
||||
grub_outb (index, GRUB_CMOS_ADDR_REG);
|
||||
grub_outb (value, GRUB_CMOS_DATA_REG);
|
||||
}
|
||||
|
||||
#endif /* GRUB_CPU_CMOS_H */
|
||||
|
|
|
@ -1 +1,24 @@
|
|||
#include <grub/i386/pc/serial.h>
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MACHINE_SERIAL_HEADER
|
||||
#define GRUB_MACHINE_SERIAL_HEADER 1
|
||||
|
||||
#define GRUB_MACHINE_SERIAL_PORTS { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }
|
||||
|
||||
#endif
|
||||
|
|
74
include/grub/i386/freebsd_linker.h
Normal file
74
include/grub/i386/freebsd_linker.h
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2000 Doug Rabson
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD: stable/8/sys/sys/linker.h 199583 2009-11-20 15:27:52Z jhb $
|
||||
*/
|
||||
|
||||
#ifndef GRUB_FREEBSD_LINKER_CPU_HEADER
|
||||
#define GRUB_FREEBSD_LINKER_CPU_HEADER 1
|
||||
|
||||
#define FREEBSD_MODINFO_END 0x0000 /* End of list */
|
||||
#define FREEBSD_MODINFO_NAME 0x0001 /* Name of module (string) */
|
||||
#define FREEBSD_MODINFO_TYPE 0x0002 /* Type of module (string) */
|
||||
#define FREEBSD_MODINFO_ADDR 0x0003 /* Loaded address */
|
||||
#define FREEBSD_MODINFO_SIZE 0x0004 /* Size of module */
|
||||
#define FREEBSD_MODINFO_EMPTY 0x0005 /* Has been deleted */
|
||||
#define FREEBSD_MODINFO_ARGS 0x0006 /* Parameters string */
|
||||
#define FREEBSD_MODINFO_METADATA 0x8000 /* Module-specfic */
|
||||
|
||||
#define FREEBSD_MODINFOMD_AOUTEXEC 0x0001 /* a.out exec header */
|
||||
#define FREEBSD_MODINFOMD_ELFHDR 0x0002 /* ELF header */
|
||||
#define FREEBSD_MODINFOMD_SSYM 0x0003 /* start of symbols */
|
||||
#define FREEBSD_MODINFOMD_ESYM 0x0004 /* end of symbols */
|
||||
#define FREEBSD_MODINFOMD_DYNAMIC 0x0005 /* _DYNAMIC pointer */
|
||||
#define FREEBSD_MODINFOMD_ENVP 0x0006 /* envp[] */
|
||||
#define FREEBSD_MODINFOMD_HOWTO 0x0007 /* boothowto */
|
||||
#define FREEBSD_MODINFOMD_KERNEND 0x0008 /* kernend */
|
||||
#define FREEBSD_MODINFOMD_SHDR 0x0009 /* section header table */
|
||||
#define FREEBSD_MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */
|
||||
|
||||
#define FREEBSD_MODINFOMD_SMAP 0x1001
|
||||
|
||||
#define FREEBSD_MODINFOMD_DEPLIST (0x4001 | FREEBSD_MODINFOMD_NOCOPY) /* depends on */
|
||||
|
||||
#endif
|
77
include/grub/i386/freebsd_reboot.h
Normal file
77
include/grub/i386/freebsd_reboot.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1988, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* @(#)reboot.h 8.3 (Berkeley) 12/13/94
|
||||
* $FreeBSD: stable/8/sys/sys/reboot.h 199583 2009-11-20 15:27:52Z jhb $
|
||||
*/
|
||||
|
||||
#ifndef GRUB_FREEBSD_REBOOT_CPU_HEADER
|
||||
#define GRUB_FREEBSD_REBOOT_CPU_HEADER 1
|
||||
|
||||
#define FREEBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define FREEBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define FREEBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define FREEBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define FREEBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */
|
||||
#define FREEBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define FREEBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define FREEBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define FREEBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define FREEBSD_RB_CONFIG (1 << 10) /* invoke user configuration routing */
|
||||
#define FREEBSD_RB_VERBOSE (1 << 11) /* print all potentially useful info */
|
||||
#define FREEBSD_RB_SERIAL (1 << 12) /* user serial port as console */
|
||||
#define FREEBSD_RB_CDROM (1 << 13) /* use cdrom as root */
|
||||
#define FREEBSD_RB_GDB (1 << 15) /* use GDB remote debugger instead of DDB */
|
||||
#define FREEBSD_RB_MUTE (1 << 16) /* Come up with the console muted */
|
||||
#define FREEBSD_RB_PAUSE (1 << 20)
|
||||
#define FREEBSD_RB_QUIET (1 << 21)
|
||||
#define FREEBSD_RB_NOINTR (1 << 28)
|
||||
#define FREENSD_RB_MULTIPLE (1 << 29) /* Use multiple consoles */
|
||||
#define FREEBSD_RB_DUAL FREENSD_RB_MULTIPLE
|
||||
#define FREEBSD_RB_BOOTINFO (1 << 31) /* have `struct bootinfo *' arg */
|
||||
|
||||
#endif
|
|
@ -1 +1 @@
|
|||
#include <grub/i386/pc/serial.h>
|
||||
#include <grub/i386/coreboot/serial.h>
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef GRUB_IO_H
|
||||
#define GRUB_IO_H 1
|
||||
|
||||
typedef unsigned short int grub_port_t;
|
||||
|
||||
static __inline unsigned char
|
||||
grub_inb (unsigned short int port)
|
||||
{
|
||||
|
|
|
@ -79,9 +79,9 @@ struct grub_e820_mmap
|
|||
grub_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define GRUB_VIDEO_TYPE_TEXT 0x01
|
||||
#define GRUB_VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
|
||||
#define GRUB_VIDEO_TYPE_EFI 0x70
|
||||
#define GRUB_VIDEO_LINUX_TYPE_TEXT 0x01
|
||||
#define GRUB_VIDEO_LINUX_TYPE_VESA 0x23 /* VESA VGA in graphic mode. */
|
||||
#define GRUB_VIDEO_LINUX_TYPE_SIMPLE 0x70 /* Linear framebuffer without any additional functions. */
|
||||
|
||||
/* For the Linux/i386 boot protocol version 2.03. */
|
||||
struct linux_kernel_header
|
||||
|
|
112
include/grub/i386/netbsd_bootinfo.h
Normal file
112
include/grub/i386/netbsd_bootinfo.h
Normal file
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/* $NetBSD: bootinfo.h,v 1.16 2009/08/24 02:15:46 jmcneill Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Matthias Drochner. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 GRUB_NETBSD_BOOTINFO_CPU_HEADER
|
||||
#define GRUB_NETBSD_BOOTINFO_CPU_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
|
||||
#define NETBSD_BTINFO_BOOTPATH 0
|
||||
#define NETBSD_BTINFO_ROOTDEVICE 1
|
||||
#define NETBSD_BTINFO_BOOTDISK 3
|
||||
#define NETBSD_BTINFO_MEMMAP 9
|
||||
|
||||
struct grub_netbsd_btinfo_common
|
||||
{
|
||||
int len;
|
||||
int type;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_mmap_header
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
grub_uint32_t count;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_mmap_entry
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t len;
|
||||
#define NETBSD_MMAP_AVAILABLE 1
|
||||
#define NETBSD_MMAP_RESERVED 2
|
||||
#define NETBSD_MMAP_ACPI 3
|
||||
#define NETBSD_MMAP_NVS 4
|
||||
grub_uint32_t type;
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_bootpath
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
char bootpath[80];
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_rootdevice
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
char devname[16];
|
||||
};
|
||||
|
||||
struct grub_netbsd_btinfo_bootdisk
|
||||
{
|
||||
struct grub_netbsd_btinfo_common common;
|
||||
int labelsector; /* label valid if != -1 */
|
||||
struct
|
||||
{
|
||||
grub_uint16_t type, checksum;
|
||||
char packname[16];
|
||||
} label;
|
||||
int biosdev;
|
||||
int partition;
|
||||
};
|
||||
|
||||
struct grub_netbsd_bootinfo
|
||||
{
|
||||
grub_uint32_t bi_count;
|
||||
void *bi_data[1];
|
||||
};
|
||||
|
||||
#endif
|
81
include/grub/i386/netbsd_reboot.h
Normal file
81
include/grub/i386/netbsd_reboot.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/* $NetBSD: reboot.h,v 1.25 2007/12/25 18:33:48 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* 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. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* @(#)reboot.h 8.3 (Berkeley) 12/13/94
|
||||
*/
|
||||
|
||||
#ifndef GRUB_NETBSD_REBOOT_CPU_HEADER
|
||||
#define GRUB_NETBSD_REBOOT_CPU_HEADER 1
|
||||
|
||||
#define NETBSD_RB_AUTOBOOT 0 /* flags for system auto-booting itself */
|
||||
|
||||
#define NETBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define NETBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define NETBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define NETBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define NETBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define NETBSD_RB_UNUSED1 (1 << 5) /* was RB_DFLTROOT, obsolete */
|
||||
#define NETBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define NETBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define NETBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define NETBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define NETBSD_RB_STRING (1 << 10) /* use provided bootstr */
|
||||
#define NETBSD_RB_POWERDOWN ((1 << 11) | RB_HALT) /* turn power off (or at least halt) */
|
||||
#define NETBSD_RB_USERCONFIG (1 << 12) /* change configured devices */
|
||||
|
||||
#define NETBSD_AB_NORMAL 0 /* boot normally (default) */
|
||||
|
||||
#define NETBSD_AB_QUIET (1 << 16) /* boot quietly */
|
||||
#define NETBSD_AB_VERBOSE (1 << 17) /* boot verbosely */
|
||||
#define NETBSD_AB_SILENT (1 << 18) /* boot silently */
|
||||
#define NETBSD_AB_DEBUG (1 << 19) /* boot with debug messages */
|
||||
#define NETBSD_AB_NOSMP (1 << 28) /* Boot without SMP support. */
|
||||
#define NETBSD_AB_NOACPI (1 << 29) /* Boot without ACPI support. */
|
||||
|
||||
|
||||
#endif
|
72
include/grub/i386/openbsd_bootarg.h
Normal file
72
include/grub/i386/openbsd_bootarg.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/* $OpenBSD: bootarg.h,v 1.11 2003/06/02 20:20:54 mickey Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996-1999 Michael Shalayeff
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 HIS RELATIVES 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 MIND, 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 GRUB_OPENBSD_BOOTARG_CPU_HEADER
|
||||
#define GRUB_OPENBSD_BOOTARG_CPU_HEADER 1
|
||||
|
||||
#define OPENBSD_BOOTARG_APIVER (OPENBSD_BAPIV_VECTOR | \
|
||||
OPENBSD_BAPIV_ENV | \
|
||||
OPENBSD_BAPIV_BMEMMAP)
|
||||
|
||||
#define OPENBSD_BAPIV_ANCIENT 0x0 /* MD old i386 bootblocks */
|
||||
#define OPENBSD_BAPIV_VARS 0x1 /* MD structure w/ add info passed */
|
||||
#define OPENBSD_BAPIV_VECTOR 0x2 /* MI vector of MD structures passed */
|
||||
#define OPENBSD_BAPIV_ENV 0x4 /* MI environment vars vector */
|
||||
#define OPENBSD_BAPIV_BMEMMAP 0x8 /* MI memory map passed is in bytes */
|
||||
|
||||
#define OPENBSD_BOOTARG_ENV 0x1000
|
||||
#define OPENBSD_BOOTARG_END -1
|
||||
|
||||
#define OPENBSD_BOOTARG_MMAP 0
|
||||
|
||||
struct grub_openbsd_bootargs
|
||||
{
|
||||
int ba_type;
|
||||
int ba_size;
|
||||
struct grub_openbsd_bootargs *ba_next;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif
|
79
include/grub/i386/openbsd_reboot.h
Normal file
79
include/grub/i386/openbsd_reboot.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
/* $OpenBSD: reboot.h,v 1.13 2004/03/10 23:02:53 tom Exp $ */
|
||||
/* $NetBSD: reboot.h,v 1.9 1996/04/22 01:23:25 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* 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. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* @(#)reboot.h 8.2 (Berkeley) 7/10/94
|
||||
*/
|
||||
|
||||
#ifndef GRUB_OPENBSD_REBOOT_CPU_HEADER
|
||||
#define GRUB_OPENBSD_REBOOT_CPU_HEADER 1
|
||||
|
||||
#define OPENBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||
#define OPENBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||
#define OPENBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */
|
||||
#define OPENBSD_RB_HALT (1 << 3) /* don't reboot, just halt */
|
||||
#define OPENBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */
|
||||
#define OPENBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */
|
||||
#define OPENBSD_RB_KDB (1 << 6) /* give control to kernel debugger */
|
||||
#define OPENBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */
|
||||
#define OPENBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */
|
||||
#define OPENBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */
|
||||
#define OPENBSD_RB_CONFIG (1 << 10) /* change configured devices */
|
||||
#define OPENBSD_RB_TIMEBAD (1 << 11) /* don't call resettodr() in boot() */
|
||||
#define OPENBSD_RB_POWERDOWN (1 << 12) /* attempt to power down machine */
|
||||
#define OPENBSD_RB_SERCONS (1 << 13) /* use serial console if available */
|
||||
#define OPENBSD_RB_USERREQ (1 << 14) /* boot() called at user request (e.g. ddb) */
|
||||
|
||||
#define OPENBSD_B_DEVMAGIC 0xa0000000
|
||||
#define OPENBSD_B_ADAPTORSHIFT 24
|
||||
#define OPENBSD_B_CTRLSHIFT 20
|
||||
#define OPENBSD_B_UNITSHIFT 16
|
||||
#define OPENBSD_B_PARTSHIFT 8
|
||||
#define OPENBSD_B_TYPESHIFT 0
|
||||
|
||||
#endif
|
|
@ -66,6 +66,8 @@
|
|||
/* The size of a block list used in the kernel startup code. */
|
||||
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
|
||||
|
||||
#define GRUB_BOOT_MACHINE_PXE_DL 0x7f
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
/* This is the blocklist used in the diskboot image. */
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#ifndef GRUB_VBE_MACHINE_HEADER
|
||||
#define GRUB_VBE_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/video_fb.h>
|
||||
|
||||
/* Default video mode to be used. */
|
||||
#define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101
|
||||
|
||||
|
|
|
@ -22,8 +22,11 @@
|
|||
#include <grub/types.h>
|
||||
#include <grub/i386/io.h>
|
||||
|
||||
#define GRUB_MACHINE_PCI_IO_BASE 0
|
||||
#define GRUB_PCI_ADDR_REG 0xcf8
|
||||
#define GRUB_PCI_DATA_REG 0xcfc
|
||||
#define GRUB_PCI_NUM_BUS 256
|
||||
#define GRUB_PCI_NUM_DEVICES 32
|
||||
|
||||
static inline grub_uint32_t
|
||||
grub_pci_read (grub_pci_address_t addr)
|
||||
|
@ -67,12 +70,12 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data)
|
|||
grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
static inline volatile void *
|
||||
grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)),
|
||||
grub_addr_t base,
|
||||
grub_size_t size __attribute__ ((unused)))
|
||||
{
|
||||
return (void *) base;
|
||||
return (volatile void *) base;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
41
include/grub/icon_manager.h
Normal file
41
include/grub/icon_manager.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* icon_manager.h - gfxmenu icon manager. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 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_ICON_MANAGER_HEADER
|
||||
#define GRUB_ICON_MANAGER_HEADER 1
|
||||
|
||||
#include <grub/menu.h>
|
||||
#include <grub/bitmap.h>
|
||||
|
||||
/* Forward declaration of opaque structure handle type. */
|
||||
typedef struct grub_gfxmenu_icon_manager *grub_gfxmenu_icon_manager_t;
|
||||
|
||||
grub_gfxmenu_icon_manager_t grub_gfxmenu_icon_manager_new (void);
|
||||
void grub_gfxmenu_icon_manager_destroy (grub_gfxmenu_icon_manager_t mgr);
|
||||
void grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr);
|
||||
void grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr,
|
||||
const char *path);
|
||||
void grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr,
|
||||
int width, int height);
|
||||
struct grub_video_bitmap *
|
||||
grub_gfxmenu_icon_manager_get_icon (grub_gfxmenu_icon_manager_t mgr,
|
||||
grub_menu_entry_t entry);
|
||||
|
||||
#endif /* GRUB_ICON_MANAGER_HEADER */
|
||||
|
|
@ -138,7 +138,7 @@ int EXPORT_FUNC(grub_ieee1275_read) (grub_ieee1275_ihandle_t ihandle,
|
|||
void *buffer, grub_size_t len,
|
||||
grub_ssize_t *actualp);
|
||||
int EXPORT_FUNC(grub_ieee1275_seek) (grub_ieee1275_ihandle_t ihandle,
|
||||
int pos_hi, int pos_lo,
|
||||
grub_disk_addr_t pos,
|
||||
grub_ssize_t *result);
|
||||
int EXPORT_FUNC(grub_ieee1275_peer) (grub_ieee1275_phandle_t node,
|
||||
grub_ieee1275_phandle_t *result);
|
||||
|
@ -173,6 +173,10 @@ grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
|
|||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size);
|
||||
|
||||
int
|
||||
EXPORT_FUNC(grub_ieee1275_map) (grub_addr_t phys, grub_addr_t virt,
|
||||
grub_size_t size, grub_uint32_t mode);
|
||||
|
||||
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
|
||||
char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path);
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ enum
|
|||
{
|
||||
OBJ_TYPE_ELF,
|
||||
OBJ_TYPE_MEMDISK,
|
||||
OBJ_TYPE_CONFIG
|
||||
OBJ_TYPE_CONFIG,
|
||||
OBJ_TYPE_FONT
|
||||
};
|
||||
|
||||
/* The module header. */
|
||||
|
|
|
@ -83,7 +83,6 @@ typedef struct grub_menu_execute_callback
|
|||
}
|
||||
*grub_menu_execute_callback_t;
|
||||
|
||||
|
||||
grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
|
||||
int grub_menu_get_timeout (void);
|
||||
void grub_menu_set_timeout (int timeout);
|
||||
|
@ -93,5 +92,6 @@ void grub_menu_execute_with_fallback (grub_menu_t menu,
|
|||
grub_menu_execute_callback_t callback,
|
||||
void *callback_data);
|
||||
void grub_menu_entry_run (grub_menu_entry_t entry);
|
||||
int grub_menu_get_default_entry_index (grub_menu_t menu);
|
||||
|
||||
#endif /* GRUB_MENU_HEADER */
|
||||
|
|
1
include/grub/mips/at_keyboard.h
Normal file
1
include/grub/mips/at_keyboard.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/machine/at_keyboard.h>
|
27
include/grub/mips/cache.h
Normal file
27
include/grub/mips/cache.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* cache.h - Flush the processor's cache. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2004,2007 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_CPU_CACHE_H
|
||||
#define GRUB_CPU_CACHE_H 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
void EXPORT_FUNC(grub_cpu_flush_cache) (void *start, grub_size_t size, int type);
|
||||
#endif
|
1
include/grub/mips/cmos.h
Normal file
1
include/grub/mips/cmos.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/machine/cmos.h>
|
62
include/grub/mips/io.h
Normal file
62
include/grub/mips/io.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_IO_H
|
||||
#define GRUB_IO_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
typedef grub_addr_t grub_port_t;
|
||||
|
||||
static __inline unsigned char
|
||||
grub_inb (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint8_t *) port;
|
||||
}
|
||||
|
||||
static __inline unsigned short int
|
||||
grub_inw (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint16_t *) port;
|
||||
}
|
||||
|
||||
static __inline unsigned int
|
||||
grub_inl (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint32_t *) port;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outb (unsigned char value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint8_t *) port = value;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outw (unsigned short int value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint16_t *) port = value;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outl (unsigned int value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint32_t *) port = value;
|
||||
}
|
||||
|
||||
#endif /* _SYS_IO_H */
|
65
include/grub/mips/kernel.h
Normal file
65
include/grub/mips/kernel.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008 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_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
#define GRUB_MOD_ALIGN 0x1
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_MOD_GAP 0x0
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_LINK_ALIGN 32
|
||||
|
||||
#define GRUB_KERNEL_CPU_RAW_SIZE 0x200
|
||||
#define GRUB_KERNEL_CPU_COMPRESSED_SIZE 0x8
|
||||
#define GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE 0xc
|
||||
#define GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE 0x10
|
||||
|
||||
#define GRUB_KERNEL_CPU_PREFIX GRUB_KERNEL_CPU_RAW_SIZE
|
||||
#define GRUB_KERNEL_CPU_DATA_END GRUB_KERNEL_CPU_RAW_SIZE + 0x48
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_KERNEL_CPU_RAW_SIZE
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX GRUB_KERNEL_CPU_PREFIX
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END GRUB_KERNEL_CPU_DATA_END
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_KERNEL_CPU_COMPRESSED_SIZE
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, elf"
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef enum {
|
||||
GRUB_PLATFORM_IMAGE_RAW,
|
||||
GRUB_PLATFORM_IMAGE_ELF
|
||||
}
|
||||
grub_platform_image_format_t;
|
||||
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
|
||||
#define GRUB_PLATFORM_IMAGE_ELF GRUB_PLATFORM_IMAGE_ELF
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
38
include/grub/mips/libgcc.h
Normal file
38
include/grub/mips/libgcc.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2004,2007,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/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE___ASHLDI3
|
||||
void EXPORT_FUNC (__ashldi3) (void);
|
||||
#endif
|
||||
#ifdef HAVE___ASHRDI3
|
||||
void EXPORT_FUNC (__ashrdi3) (void);
|
||||
#endif
|
||||
#ifdef HAVE___LSHRDI3
|
||||
void EXPORT_FUNC (__lshrdi3) (void);
|
||||
#endif
|
||||
#ifdef HAVE___UCMPDI2
|
||||
void EXPORT_FUNC (__ucmpdi2) (void);
|
||||
#endif
|
||||
#ifdef HAVE___BSWAPSI2
|
||||
void EXPORT_FUNC (__bswapsi2) (void);
|
||||
#endif
|
||||
#ifdef HAVE___BSWAPDI2
|
||||
void EXPORT_FUNC (__bswapdi2) (void);
|
||||
#endif
|
1
include/grub/mips/pci.h
Normal file
1
include/grub/mips/pci.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/machine/pci.h>
|
0
include/grub/mips/qemu-mips/boot.h
Normal file
0
include/grub/mips/qemu-mips/boot.h
Normal file
36
include/grub/mips/qemu-mips/kernel.h
Normal file
36
include/grub/mips/qemu-mips/kernel.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,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_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
void EXPORT_FUNC (grub_reboot) (void);
|
||||
void EXPORT_FUNC (grub_halt) (void);
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
0
include/grub/mips/qemu-mips/loader.h
Normal file
0
include/grub/mips/qemu-mips/loader.h
Normal file
54
include/grub/mips/qemu-mips/memory.h
Normal file
54
include/grub/mips/qemu-mips/memory.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MEMORY_MACHINE_HEADER
|
||||
#define GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#endif
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x80f00000
|
||||
#define GRUB_MACHINE_MEMORY_USABLE 0x81000000
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
grub_err_t EXPORT_FUNC (grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
|
||||
grub_uint64_t size __attribute__ ((unused)),
|
||||
int type __attribute__ ((unused)),
|
||||
int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_unregister (int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
24
include/grub/mips/qemu-mips/serial.h
Normal file
24
include/grub/mips/qemu-mips/serial.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MACHINE_SERIAL_HEADER
|
||||
#define GRUB_MACHINE_SERIAL_HEADER 1
|
||||
|
||||
#define GRUB_MACHINE_SERIAL_PORTS { 0x140003f8 }
|
||||
|
||||
#endif
|
34
include/grub/mips/qemu-mips/time.h
Normal file
34
include/grub/mips/qemu-mips/time.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2004,2005,2007 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 KERNEL_MACHINE_TIME_HEADER
|
||||
#define KERNEL_MACHINE_TIME_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#define GRUB_TICKS_PER_SECOND 1000
|
||||
|
||||
/* Return the real time in ticks. */
|
||||
grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
|
||||
|
||||
static inline void
|
||||
grub_cpu_idle(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* ! KERNEL_MACHINE_TIME_HEADER */
|
39
include/grub/mips/relocator.h
Normal file
39
include/grub/mips/relocator.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_RELOCATOR_CPU_HEADER
|
||||
#define GRUB_RELOCATOR_CPU_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
|
||||
struct grub_relocator32_state
|
||||
{
|
||||
/* gpr[0] is ignored since it's hardwired to 0. */
|
||||
grub_uint32_t gpr[32];
|
||||
/* Register holding target $pc. */
|
||||
int jumpreg;
|
||||
};
|
||||
|
||||
void *grub_relocator32_alloc (grub_size_t size);
|
||||
grub_err_t grub_relocator32_boot (void *relocator, grub_uint32_t dest,
|
||||
struct grub_relocator32_state state);
|
||||
void *grub_relocator32_realloc (void *relocator, grub_size_t size);
|
||||
void grub_relocator32_free (void *relocator);
|
||||
|
||||
#endif /* ! GRUB_RELOCATOR_CPU_HEADER */
|
27
include/grub/mips/setjmp.h
Normal file
27
include/grub/mips/setjmp.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2004,2006,2007,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_SETJMP_CPU_HEADER
|
||||
#define GRUB_SETJMP_CPU_HEADER 1
|
||||
|
||||
typedef unsigned long grub_jmp_buf[11];
|
||||
|
||||
int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice));
|
||||
void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn));
|
||||
|
||||
#endif /* ! GRUB_SETJMP_CPU_HEADER */
|
0
include/grub/mips/time.h
Normal file
0
include/grub/mips/time.h
Normal file
38
include/grub/mips/types.h
Normal file
38
include/grub/mips/types.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2006,2007,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_TYPES_CPU_HEADER
|
||||
#define GRUB_TYPES_CPU_HEADER 1
|
||||
|
||||
/* The size of void *. */
|
||||
#define GRUB_TARGET_SIZEOF_VOID_P 4
|
||||
|
||||
/* The size of long. */
|
||||
#define GRUB_TARGET_SIZEOF_LONG 4
|
||||
|
||||
#ifdef GRUB_CPU_MIPSEL
|
||||
/* mipsEL is little-endian. */
|
||||
#undef GRUB_TARGET_WORDS_BIGENDIAN
|
||||
#elif defined (GRUB_CPU_MIPS)
|
||||
/* mips is big-endian. */
|
||||
#define GRUB_TARGET_WORDS_BIGENDIAN
|
||||
#elif !defined (GRUB_SYMBOL_GENERATOR)
|
||||
#error Neither GRUB_CPU_MIPS nor GRUB_CPU_MIPSEL is defined
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TYPES_CPU_HEADER */
|
25
include/grub/mips/yeeloong/at_keyboard.h
Normal file
25
include/grub/mips/yeeloong/at_keyboard.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MACHINE_AT_KEYBOARD_HEADER
|
||||
#define GRUB_MACHINE_AT_KEYBOARD_HEADER 1
|
||||
|
||||
#define KEYBOARD_REG_DATA 0xbfd00060
|
||||
#define KEYBOARD_REG_STATUS 0xbfd00064
|
||||
|
||||
#endif
|
0
include/grub/mips/yeeloong/boot.h
Normal file
0
include/grub/mips/yeeloong/boot.h
Normal file
28
include/grub/mips/yeeloong/cmos.h
Normal file
28
include/grub/mips/yeeloong/cmos.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 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_CPU_CMOS_H
|
||||
#define GRUB_CPU_CMOS_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/cpu/io.h>
|
||||
|
||||
#define GRUB_CMOS_ADDR_REG 0xbfd00070
|
||||
#define GRUB_CMOS_DATA_REG 0xbfd00071
|
||||
|
||||
#endif /* GRUB_CPU_CMOS_H */
|
32
include/grub/mips/yeeloong/kernel.h
Normal file
32
include/grub/mips/yeeloong/kernel.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,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_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
void EXPORT_FUNC (grub_reboot) (void);
|
||||
void EXPORT_FUNC (grub_halt) (void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
0
include/grub/mips/yeeloong/loader.h
Normal file
0
include/grub/mips/yeeloong/loader.h
Normal file
68
include/grub/mips/yeeloong/memory.h
Normal file
68
include/grub/mips/yeeloong/memory.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MEMORY_MACHINE_HEADER
|
||||
#define GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#endif
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x801ffff0
|
||||
#define GRUB_ARCH_LOWMEMVSTART 0x80000000
|
||||
#define GRUB_ARCH_LOWMEMPSTART 0x00000000
|
||||
#define GRUB_ARCH_LOWMEMMAXSIZE 0x10000000
|
||||
#define GRUB_ARCH_HIGHMEMPSTART 0x10000000
|
||||
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
#define GRUB_MACHINE_MEMORY_MAX_TYPE 1
|
||||
/* This one is special: it's used internally but is never reported
|
||||
by firmware. */
|
||||
#define GRUB_MACHINE_MEMORY_HOLE 2
|
||||
#define GRUB_MACHINE_MEMORY_RESERVED GRUB_MACHINE_MEMORY_HOLE
|
||||
|
||||
#ifndef ASM_FILE
|
||||
grub_err_t EXPORT_FUNC (grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
|
||||
grub_uint64_t size __attribute__ ((unused)),
|
||||
int type __attribute__ ((unused)),
|
||||
int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_unregister (int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
grub_uint64_t grub_mmap_get_lower (void);
|
||||
grub_uint64_t grub_mmap_get_upper (void);
|
||||
|
||||
extern grub_uint32_t EXPORT_VAR (grub_arch_memsize);
|
||||
extern grub_uint32_t EXPORT_VAR (grub_arch_highmemsize);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
105
include/grub/mips/yeeloong/pci.h
Normal file
105
include/grub/mips/yeeloong/pci.h
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 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_MACHINE_PCI_H
|
||||
#define GRUB_MACHINE_PCI_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/cpu/io.h>
|
||||
|
||||
#define GRUB_PCI_NUM_BUS 1
|
||||
#define GRUB_PCI_NUM_DEVICES 16
|
||||
|
||||
#define GRUB_MACHINE_PCI_IO_BASE 0xbfd00000
|
||||
#define GRUB_MACHINE_PCI_CONFSPACE 0xbfe80000
|
||||
#define GRUB_MACHINE_PCI_CONF_CTRL_REG (*(volatile grub_uint32_t *) 0xbfe00118)
|
||||
#define GRUB_MACHINE_PCI_IO_CTRL_REG (*(volatile grub_uint32_t *) 0xbfe00110)
|
||||
#define GRUB_MACHINE_PCI_WIN_MASK_SIZE 6
|
||||
#define GRUB_MACHINE_PCI_WIN_MASK ((1 << GRUB_MACHINE_PCI_WIN_MASK_SIZE) - 1)
|
||||
|
||||
/* We have 3 PCI windows. */
|
||||
#define GRUB_MACHINE_PCI_NUM_WIN 3
|
||||
/* Each window is 64MiB. */
|
||||
#define GRUB_MACHINE_PCI_WIN_SHIFT 26
|
||||
#define GRUB_MACHINE_PCI_WIN_OFFSET_MASK ((1 << GRUB_MACHINE_PCI_WIN_SHIFT) - 1)
|
||||
|
||||
#define GRUB_MACHINE_PCI_WIN_SIZE 0x04000000
|
||||
/* Graphical acceleration takes 1 MiB away. */
|
||||
#define GRUB_MACHINE_PCI_WIN1_SIZE 0x03f00000
|
||||
|
||||
#define GRUB_MACHINE_PCI_WIN1_ADDR 0xb0000000
|
||||
#define GRUB_MACHINE_PCI_WIN2_ADDR 0xb4000000
|
||||
#define GRUB_MACHINE_PCI_WIN3_ADDR 0xb8000000
|
||||
|
||||
static inline grub_uint32_t
|
||||
grub_pci_read (grub_pci_address_t addr)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
return *(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff));
|
||||
}
|
||||
|
||||
static inline grub_uint16_t
|
||||
grub_pci_read_word (grub_pci_address_t addr)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
return *(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff));
|
||||
}
|
||||
|
||||
static inline grub_uint8_t
|
||||
grub_pci_read_byte (grub_pci_address_t addr)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
return *(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff));
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_pci_write (grub_pci_address_t addr, grub_uint32_t data)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
*(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff)) = data;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
*(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff)) = data;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data)
|
||||
{
|
||||
GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf);
|
||||
*(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE
|
||||
| (addr & 0x03ff)) = data;
|
||||
}
|
||||
|
||||
volatile void *
|
||||
grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)),
|
||||
grub_addr_t base, grub_size_t size);
|
||||
void
|
||||
grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)),
|
||||
volatile void *mem,
|
||||
grub_size_t size __attribute__ ((unused)));
|
||||
|
||||
#endif /* GRUB_MACHINE_PCI_H */
|
24
include/grub/mips/yeeloong/serial.h
Normal file
24
include/grub/mips/yeeloong/serial.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MACHINE_SERIAL_HEADER
|
||||
#define GRUB_MACHINE_SERIAL_HEADER 1
|
||||
|
||||
#define GRUB_MACHINE_SERIAL_PORTS { 0xbff003f8 }
|
||||
|
||||
#endif
|
37
include/grub/mips/yeeloong/time.h
Normal file
37
include/grub/mips/yeeloong/time.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2004,2005,2007 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 KERNEL_MACHINE_TIME_HEADER
|
||||
#define KERNEL_MACHINE_TIME_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#define GRUB_TICKS_PER_SECOND (grub_arch_cpuclock / 2)
|
||||
|
||||
/* Return the real time in ticks. */
|
||||
grub_uint64_t EXPORT_FUNC (grub_get_rtc) (void);
|
||||
|
||||
extern grub_uint32_t EXPORT_VAR (grub_arch_busclock);
|
||||
extern grub_uint32_t EXPORT_VAR (grub_arch_cpuclock);
|
||||
|
||||
static inline void
|
||||
grub_cpu_idle(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* ! KERNEL_MACHINE_TIME_HEADER */
|
|
@ -110,6 +110,12 @@ char *EXPORT_FUNC(grub_strstr) (const char *haystack, const char *needle);
|
|||
int EXPORT_FUNC(grub_isspace) (int c);
|
||||
int EXPORT_FUNC(grub_isprint) (int c);
|
||||
|
||||
static inline int
|
||||
grub_iscntrl (int c)
|
||||
{
|
||||
return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_isalpha (int c)
|
||||
{
|
||||
|
@ -128,6 +134,12 @@ grub_isdigit (int c)
|
|||
return (c >= '0' && c <= '9');
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_isalnum (int c)
|
||||
{
|
||||
return grub_isalpha (c) || grub_isdigit (c);
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_tolower (int c)
|
||||
{
|
||||
|
@ -182,6 +194,43 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
|
|||
|
||||
unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base);
|
||||
unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base);
|
||||
|
||||
static inline long
|
||||
grub_strtol (const char *str, char **end, int base)
|
||||
{
|
||||
int negative = 0;
|
||||
unsigned long magnitude;
|
||||
|
||||
while (*str && grub_isspace (*str))
|
||||
str++;
|
||||
|
||||
if (*str == '-')
|
||||
{
|
||||
negative = 1;
|
||||
str++;
|
||||
}
|
||||
|
||||
magnitude = grub_strtoull (str, end, base);
|
||||
if (negative)
|
||||
{
|
||||
if (magnitude > (unsigned long) GRUB_LONG_MAX + 1)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "negative overflow");
|
||||
return GRUB_LONG_MIN;
|
||||
}
|
||||
return -((long) magnitude);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (magnitude > GRUB_LONG_MAX)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "positive overflow");
|
||||
return GRUB_LONG_MAX;
|
||||
}
|
||||
return (long) magnitude;
|
||||
}
|
||||
}
|
||||
|
||||
char *EXPORT_FUNC(grub_strdup) (const char *s);
|
||||
char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n);
|
||||
void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
|
||||
|
@ -195,8 +244,13 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
|
|||
const char *condition,
|
||||
const char *fmt, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
|
||||
int EXPORT_FUNC(grub_sprintf) (char *str, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
||||
int EXPORT_FUNC(grub_vsprintf) (char *str, const char *fmt, va_list args);
|
||||
int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt,
|
||||
va_list args);
|
||||
char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args);
|
||||
void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn));
|
||||
void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn));
|
||||
grub_size_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest,
|
||||
|
|
|
@ -45,7 +45,6 @@ grub_err_t grub_multiboot_add_module (grub_addr_t start, grub_size_t size,
|
|||
void grub_multiboot_set_bootdev (void);
|
||||
|
||||
grub_uint32_t grub_get_multiboot_mmap_len (void);
|
||||
void grub_fill_multiboot_mmap (struct multiboot_mmap_entry *first_entry);
|
||||
grub_err_t grub_multiboot_set_video_mode (void);
|
||||
|
||||
#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU)
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
/* multiboot2.h - multiboot2 header file with grub definitions. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2007 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_MULTIBOOT2_HEADER
|
||||
#define GRUB_MULTIBOOT2_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/elf.h>
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
typedef grub_uint32_t uint32_t;
|
||||
typedef grub_uint64_t uint64_t;
|
||||
#define __WORDSIZE GRUB_TARGET_WORDSIZE
|
||||
#endif
|
||||
|
||||
struct multiboot2_tag_header;
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len);
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_tags_arch_create (void);
|
||||
|
||||
void
|
||||
grub_mb2_arch_boot (grub_addr_t entry, void *tags);
|
||||
|
||||
void
|
||||
grub_mb2_arch_unload (struct multiboot2_tag_header *tags);
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load);
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load);
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr);
|
||||
|
||||
grub_err_t
|
||||
grub_mb2_arch_module_free (grub_addr_t addr, grub_size_t size);
|
||||
|
||||
void
|
||||
grub_multiboot2 (int argc, char *argv[]);
|
||||
|
||||
void
|
||||
grub_module2 (int argc, char *argv[]);
|
||||
|
||||
#define for_each_tag(tag, tags) \
|
||||
for (tag = tags; \
|
||||
tag && tag->key != MULTIBOOT2_TAG_END; \
|
||||
tag = (struct multiboot2_tag_header *)((char *)tag + tag->len))
|
||||
|
||||
#endif /* ! GRUB_MULTIBOOT2_HEADER */
|
|
@ -101,43 +101,16 @@ void read_command_list (void);
|
|||
/* Defined in `autofs.c'. */
|
||||
void read_fs_list (void);
|
||||
|
||||
void grub_context_init (void);
|
||||
void grub_context_fini (void);
|
||||
|
||||
void read_crypto_list (void);
|
||||
|
||||
void read_terminal_list (void);
|
||||
|
||||
void grub_set_more (int onoff);
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void grub_normal_init (void);
|
||||
void grub_normal_fini (void);
|
||||
void grub_hello_init (void);
|
||||
void grub_hello_fini (void);
|
||||
void grub_ls_init (void);
|
||||
void grub_ls_fini (void);
|
||||
void grub_cat_init (void);
|
||||
void grub_cat_fini (void);
|
||||
void grub_boot_init (void);
|
||||
void grub_boot_fini (void);
|
||||
void grub_cmp_init (void);
|
||||
void grub_cmp_fini (void);
|
||||
void grub_terminal_init (void);
|
||||
void grub_terminal_fini (void);
|
||||
void grub_loop_init (void);
|
||||
void grub_loop_fini (void);
|
||||
void grub_help_init (void);
|
||||
void grub_help_fini (void);
|
||||
void grub_halt_init (void);
|
||||
void grub_halt_fini (void);
|
||||
void grub_reboot_init (void);
|
||||
void grub_reboot_fini (void);
|
||||
void grub_configfile_init (void);
|
||||
void grub_configfile_fini (void);
|
||||
void grub_search_init (void);
|
||||
void grub_search_fini (void);
|
||||
void grub_test_init (void);
|
||||
void grub_test_fini (void);
|
||||
void grub_blocklist_init (void);
|
||||
void grub_blocklist_fini (void);
|
||||
#endif
|
||||
int grub_normal_get_line_counter (void);
|
||||
void grub_install_newline_hook (void);
|
||||
|
||||
#endif /* ! GRUB_NORMAL_HEADER */
|
||||
|
|
|
@ -83,20 +83,6 @@ void EXPORT_FUNC(grub_partition_map_register) (grub_partition_map_t partmap);
|
|||
|
||||
void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap);
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void grub_msdos_partition_map_init (void);
|
||||
void grub_msdos_partition_map_fini (void);
|
||||
void grub_amiga_partition_map_init (void);
|
||||
void grub_amiga_partition_map_fini (void);
|
||||
void grub_apple_partition_map_init (void);
|
||||
void grub_apple_partition_map_fini (void);
|
||||
void grub_sun_partition_map_init (void);
|
||||
void grub_sun_partition_map_fini (void);
|
||||
void grub_gpt_partition_map_init (void);
|
||||
void grub_gpt_partition_map_fini (void);
|
||||
void grub_apple_partition_map_init (void);
|
||||
void grub_apple_partition_map_fini (void);
|
||||
#endif
|
||||
|
||||
static inline grub_disk_addr_t
|
||||
grub_partition_get_start (const grub_partition_t p)
|
||||
|
|
|
@ -35,6 +35,37 @@
|
|||
#define GRUB_PCI_ADDR_MEM_MASK ~0xf
|
||||
#define GRUB_PCI_ADDR_IO_MASK ~0x03
|
||||
|
||||
#define GRUB_PCI_REG_PCI_ID 0x00
|
||||
#define GRUB_PCI_REG_VENDOR 0x00
|
||||
#define GRUB_PCI_REG_DEVICE 0x02
|
||||
#define GRUB_PCI_REG_COMMAND 0x04
|
||||
#define GRUB_PCI_REG_STATUS 0x06
|
||||
#define GRUB_PCI_REG_REVISION 0x08
|
||||
#define GRUB_PCI_REG_CLASS 0x08
|
||||
#define GRUB_PCI_REG_CACHELINE 0x0c
|
||||
#define GRUB_PCI_REG_LAT_TIMER 0x0d
|
||||
#define GRUB_PCI_REG_HEADER_TYPE 0x0e
|
||||
#define GRUB_PCI_REG_BIST 0x0f
|
||||
#define GRUB_PCI_REG_ADDRESSES 0x10
|
||||
|
||||
/* Beware that 64-bit address takes 2 registers. */
|
||||
#define GRUB_PCI_REG_ADDRESS_REG0 0x10
|
||||
#define GRUB_PCI_REG_ADDRESS_REG1 0x14
|
||||
#define GRUB_PCI_REG_ADDRESS_REG2 0x18
|
||||
#define GRUB_PCI_REG_ADDRESS_REG3 0x1c
|
||||
#define GRUB_PCI_REG_ADDRESS_REG4 0x20
|
||||
#define GRUB_PCI_REG_ADDRESS_REG5 0x24
|
||||
|
||||
#define GRUB_PCI_REG_CIS_POINTER 0x28
|
||||
#define GRUB_PCI_REG_SUBVENDOR 0x2c
|
||||
#define GRUB_PCI_REG_SUBSYSTEM 0x2e
|
||||
#define GRUB_PCI_REG_ROM_ADDRESS 0x30
|
||||
#define GRUB_PCI_REG_CAP_POINTER 0x34
|
||||
#define GRUB_PCI_REG_IRQ_LINE 0x3c
|
||||
#define GRUB_PCI_REG_IRQ_PIN 0x3d
|
||||
#define GRUB_PCI_REG_MIN_GNT 0x3e
|
||||
#define GRUB_PCI_REG_MAX_LAT 0x3f
|
||||
|
||||
typedef grub_uint32_t grub_pci_id_t;
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
|
||||
#define GRUB_IEEE1275_CELL_SIZEOF 4
|
||||
typedef grub_uint32_t grub_ieee1275_cell_t;
|
||||
|
||||
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
|
||||
|
|
|
@ -33,3 +33,42 @@ void EXPORT_FUNC (__trampoline_setup) (void);
|
|||
#ifdef HAVE___UCMPDI2
|
||||
void EXPORT_FUNC (__ucmpdi2) (void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__RESTGPR_14_X
|
||||
void EXPORT_FUNC (_restgpr_14_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_15_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_16_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_17_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_18_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_19_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_20_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_21_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_22_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_23_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_24_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_25_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_26_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_27_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_28_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_29_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_30_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_31_x) (void);
|
||||
void EXPORT_FUNC (_savegpr_14) (void);
|
||||
void EXPORT_FUNC (_savegpr_15) (void);
|
||||
void EXPORT_FUNC (_savegpr_16) (void);
|
||||
void EXPORT_FUNC (_savegpr_17) (void);
|
||||
void EXPORT_FUNC (_savegpr_18) (void);
|
||||
void EXPORT_FUNC (_savegpr_19) (void);
|
||||
void EXPORT_FUNC (_savegpr_20) (void);
|
||||
void EXPORT_FUNC (_savegpr_21) (void);
|
||||
void EXPORT_FUNC (_savegpr_22) (void);
|
||||
void EXPORT_FUNC (_savegpr_23) (void);
|
||||
void EXPORT_FUNC (_savegpr_24) (void);
|
||||
void EXPORT_FUNC (_savegpr_25) (void);
|
||||
void EXPORT_FUNC (_savegpr_26) (void);
|
||||
void EXPORT_FUNC (_savegpr_27) (void);
|
||||
void EXPORT_FUNC (_savegpr_28) (void);
|
||||
void EXPORT_FUNC (_savegpr_29) (void);
|
||||
void EXPORT_FUNC (_savegpr_30) (void);
|
||||
void EXPORT_FUNC (_savegpr_31) (void);
|
||||
#endif
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_SERIAL_MACHINE_HEADER
|
||||
#define GRUB_SERIAL_MACHINE_HEADER 1
|
||||
#ifndef GRUB_SERIAL_HEADER
|
||||
#define GRUB_SERIAL_HEADER 1
|
||||
|
||||
/* Macros. */
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
|
||||
#define GRUB_IEEE1275_CELL_SIZEOF 8
|
||||
typedef grub_uint64_t grub_ieee1275_cell_t;
|
||||
|
||||
/* Encoding of 'mode' argument to grub_ieee1275_map_physical() */
|
||||
|
@ -36,10 +37,6 @@ typedef grub_uint64_t grub_ieee1275_cell_t;
|
|||
#define IEEE1275_MAP_DEFAULT (IEEE1275_MAP_WRITE | IEEE1275_MAP_READ | \
|
||||
IEEE1275_MAP_EXEC | IEEE1275_MAP_CACHED)
|
||||
|
||||
extern int EXPORT_FUNC(grub_ieee1275_map_physical) (grub_addr_t paddr,
|
||||
grub_addr_t vaddr,
|
||||
grub_size_t size,
|
||||
grub_uint32_t mode);
|
||||
extern int EXPORT_FUNC(grub_ieee1275_claim_vaddr) (grub_addr_t vaddr,
|
||||
grub_size_t size);
|
||||
extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr,
|
||||
|
|
|
@ -208,9 +208,8 @@ grub_term_register_input (const char *name __attribute__ ((unused)),
|
|||
else
|
||||
{
|
||||
/* If this is the first terminal, enable automatically. */
|
||||
if (term->init)
|
||||
term->init ();
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
|
||||
if (! term->init || term->init () == GRUB_ERR_NONE)
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,10 +223,9 @@ grub_term_register_output (const char *name __attribute__ ((unused)),
|
|||
else
|
||||
{
|
||||
/* If this is the first terminal, enable automatically. */
|
||||
if (term->init)
|
||||
term->init ();
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
|
||||
GRUB_AS_LIST (term));
|
||||
if (! term->init || term->init () == GRUB_ERR_NONE)
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
|
||||
GRUB_AS_LIST (term));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2010 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_TEST_HEADER
|
||||
#define GRUB_TEST_HEADER
|
||||
|
||||
|
|
|
@ -23,8 +23,10 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/cpu/time.h>
|
||||
|
||||
#ifdef GRUB_MACHINE_EMU
|
||||
#if defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL)
|
||||
#define GRUB_TICKS_PER_SECOND 100000
|
||||
/* Return the real time in ticks. */
|
||||
grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
|
||||
#else
|
||||
#include <grub/machine/time.h>
|
||||
#endif
|
||||
|
|
44
include/grub/trig.h
Normal file
44
include/grub/trig.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/* trig.h - Trigonometric function support. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 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_TRIG_HEADER
|
||||
#define GRUB_TRIG_HEADER 1
|
||||
|
||||
#define GRUB_TRIG_ANGLE_MAX 256
|
||||
#define GRUB_TRIG_ANGLE_MASK 255
|
||||
#define GRUB_TRIG_FRACTION_SCALE 16384
|
||||
|
||||
extern short grub_trig_sintab[];
|
||||
extern short grub_trig_costab[];
|
||||
|
||||
static __inline int
|
||||
grub_sin (int x)
|
||||
{
|
||||
x &= GRUB_TRIG_ANGLE_MASK;
|
||||
return grub_trig_sintab[x];
|
||||
}
|
||||
|
||||
static __inline int
|
||||
grub_cos (int x)
|
||||
{
|
||||
x &= GRUB_TRIG_ANGLE_MASK;
|
||||
return grub_trig_costab[x];
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_TRIG_HEADER */
|
|
@ -223,4 +223,10 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
|
|||
# endif
|
||||
#endif /* ! WORDS_BIGENDIAN */
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 8
|
||||
# define grub_host_to_target_addr(x) grub_host_to_target64(x)
|
||||
#else
|
||||
# define grub_host_to_target_addr(x) grub_host_to_target32(x)
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TYPES_HEADER */
|
||||
|
|
|
@ -34,6 +34,10 @@ struct grub_video_render_target;
|
|||
struct grub_video_bitmap;
|
||||
|
||||
/* Defines used to describe video mode or rendering target. */
|
||||
/* If following is set render target contains currenly displayed image
|
||||
after swapping buffers (otherwise it contains previously displayed image).
|
||||
*/
|
||||
#define GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP 0x00000080
|
||||
#define GRUB_VIDEO_MODE_TYPE_PURE_TEXT 0x00000040
|
||||
#define GRUB_VIDEO_MODE_TYPE_ALPHA 0x00000020
|
||||
#define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED 0x00000010
|
||||
|
@ -48,6 +52,8 @@ struct grub_video_bitmap;
|
|||
#define GRUB_VIDEO_MODE_TYPE_DEPTH_MASK 0x0000ff00
|
||||
#define GRUB_VIDEO_MODE_TYPE_DEPTH_POS 8
|
||||
|
||||
/* The basic render target representing the whole display. This always
|
||||
renders to the back buffer when double-buffering is in use. */
|
||||
#define GRUB_VIDEO_RENDER_TARGET_DISPLAY \
|
||||
((struct grub_video_render_target *) 0)
|
||||
|
||||
|
@ -151,6 +157,16 @@ struct grub_video_mode_info
|
|||
grub_uint8_t fg_alpha;
|
||||
};
|
||||
|
||||
/* A 2D rectangle type. */
|
||||
struct grub_video_rect
|
||||
{
|
||||
unsigned x;
|
||||
unsigned y;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
};
|
||||
typedef struct grub_video_rect grub_video_rect_t;
|
||||
|
||||
struct grub_video_palette_data
|
||||
{
|
||||
grub_uint8_t r; /* Red color value (0-255). */
|
||||
|
@ -180,7 +196,7 @@ struct grub_video_adapter
|
|||
grub_err_t (*fini) (void);
|
||||
|
||||
grub_err_t (*setup) (unsigned int width, unsigned int height,
|
||||
unsigned int mode_type);
|
||||
unsigned int mode_type, unsigned int mode_mask);
|
||||
|
||||
grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
|
@ -243,13 +259,13 @@ struct grub_video_adapter
|
|||
};
|
||||
typedef struct grub_video_adapter *grub_video_adapter_t;
|
||||
|
||||
void grub_video_register (grub_video_adapter_t adapter);
|
||||
void EXPORT_FUNC (grub_video_register) (grub_video_adapter_t adapter);
|
||||
void grub_video_unregister (grub_video_adapter_t adapter);
|
||||
void grub_video_iterate (int (*hook) (grub_video_adapter_t adapter));
|
||||
|
||||
grub_err_t grub_video_restore (void);
|
||||
grub_err_t EXPORT_FUNC (grub_video_restore) (void);
|
||||
|
||||
grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);
|
||||
grub_err_t EXPORT_FUNC (grub_video_get_info) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
/* Framebuffer address may change as a part of normal operation
|
||||
(e.g. double buffering). That's why you need to stop video subsystem to be
|
||||
|
@ -267,57 +283,78 @@ grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
|
|||
grub_err_t grub_video_get_palette (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
|
||||
grub_err_t grub_video_set_viewport (unsigned int x, unsigned int y,
|
||||
unsigned int width, unsigned int height);
|
||||
grub_err_t EXPORT_FUNC (grub_video_set_viewport) (unsigned int x,
|
||||
unsigned int y,
|
||||
unsigned int width,
|
||||
unsigned int height);
|
||||
|
||||
grub_err_t grub_video_get_viewport (unsigned int *x, unsigned int *y,
|
||||
unsigned int *width, unsigned int *height);
|
||||
grub_err_t EXPORT_FUNC (grub_video_get_viewport) (unsigned int *x,
|
||||
unsigned int *y,
|
||||
unsigned int *width,
|
||||
unsigned int *height);
|
||||
|
||||
grub_video_color_t grub_video_map_color (grub_uint32_t color_name);
|
||||
grub_video_color_t EXPORT_FUNC (grub_video_map_color) (grub_uint32_t color_name);
|
||||
|
||||
grub_video_color_t grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue);
|
||||
grub_video_color_t EXPORT_FUNC (grub_video_map_rgb) (grub_uint8_t red,
|
||||
grub_uint8_t green,
|
||||
grub_uint8_t blue);
|
||||
|
||||
grub_video_color_t grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue, grub_uint8_t alpha);
|
||||
grub_video_color_t EXPORT_FUNC (grub_video_map_rgba) (grub_uint8_t red,
|
||||
grub_uint8_t green,
|
||||
grub_uint8_t blue,
|
||||
grub_uint8_t alpha);
|
||||
|
||||
grub_err_t grub_video_unmap_color (grub_video_color_t color,
|
||||
grub_uint8_t *red, grub_uint8_t *green,
|
||||
grub_uint8_t *blue, grub_uint8_t *alpha);
|
||||
grub_err_t EXPORT_FUNC (grub_video_unmap_color) (grub_video_color_t color,
|
||||
grub_uint8_t *red,
|
||||
grub_uint8_t *green,
|
||||
grub_uint8_t *blue,
|
||||
grub_uint8_t *alpha);
|
||||
|
||||
grub_err_t grub_video_fill_rect (grub_video_color_t color, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
grub_err_t EXPORT_FUNC (grub_video_fill_rect) (grub_video_color_t color,
|
||||
int x, int y,
|
||||
unsigned int width,
|
||||
unsigned int height);
|
||||
|
||||
grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y, int offset_x, int offset_y,
|
||||
unsigned int width, unsigned int height);
|
||||
grub_err_t EXPORT_FUNC (grub_video_blit_bitmap) (struct grub_video_bitmap *bitmap,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y,
|
||||
int offset_x, int offset_y,
|
||||
unsigned int width,
|
||||
unsigned int height);
|
||||
|
||||
grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y,
|
||||
int offset_x, int offset_y,
|
||||
unsigned int width,
|
||||
unsigned int height);
|
||||
grub_err_t EXPORT_FUNC (grub_video_blit_render_target) (struct grub_video_render_target *source,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y,
|
||||
int offset_x,
|
||||
int offset_y,
|
||||
unsigned int width,
|
||||
unsigned int height);
|
||||
|
||||
grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);
|
||||
|
||||
grub_err_t grub_video_swap_buffers (void);
|
||||
grub_err_t EXPORT_FUNC (grub_video_swap_buffers) (void);
|
||||
|
||||
grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
unsigned int mode_type);
|
||||
grub_err_t EXPORT_FUNC (grub_video_create_render_target) (struct grub_video_render_target **result,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
unsigned int mode_type);
|
||||
|
||||
grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);
|
||||
grub_err_t EXPORT_FUNC (grub_video_delete_render_target) (struct grub_video_render_target *target);
|
||||
|
||||
grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);
|
||||
grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_render_target *target);
|
||||
|
||||
grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);
|
||||
|
||||
grub_err_t grub_video_set_mode (const char *modestring,
|
||||
int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p,
|
||||
struct grub_video_mode_info *mode_info));
|
||||
grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring,
|
||||
unsigned int modemask,
|
||||
unsigned int modevalue);
|
||||
|
||||
static inline int
|
||||
grub_video_check_mode_flag (unsigned int flags, unsigned int mask,
|
||||
unsigned int flag, int def)
|
||||
{
|
||||
return (flag & mask) ? !! (flags & flag) : def;
|
||||
}
|
||||
|
||||
grub_video_driver_id_t
|
||||
grub_video_get_driver_id (void);
|
||||
|
|
|
@ -115,4 +115,15 @@ grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **targ
|
|||
grub_err_t
|
||||
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);
|
||||
|
||||
typedef grub_err_t
|
||||
(*grub_video_fb_doublebuf_update_screen_t) (struct grub_video_fbrender_target *front,
|
||||
struct grub_video_fbrender_target *back);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_doublebuf_blit_init (struct grub_video_fbrender_target **front,
|
||||
struct grub_video_fbrender_target **back,
|
||||
grub_video_fb_doublebuf_update_screen_t *update_screen,
|
||||
struct grub_video_mode_info mode_info,
|
||||
void *framebuf);
|
||||
|
||||
#endif /* ! GRUB_VIDEO_FB_HEADER */
|
||||
|
|
1
include/grub/x86_64/at_keyboard.h
Normal file
1
include/grub/x86_64/at_keyboard.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/at_keyboard.h>
|
|
@ -108,5 +108,8 @@ extern grub_uint32_t grub_xnu_heap_real_start;
|
|||
extern grub_size_t grub_xnu_heap_size;
|
||||
extern void *grub_xnu_heap_start;
|
||||
extern struct grub_video_bitmap *grub_xnu_bitmap;
|
||||
typedef enum {GRUB_XNU_BITMAP_CENTER, GRUB_XNU_BITMAP_STRETCH}
|
||||
grub_xnu_bitmap_mode_t;
|
||||
extern grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode;
|
||||
extern int grub_xnu_is_64bit;
|
||||
#endif
|
||||
|
|
|
@ -233,6 +233,8 @@ struct multiboot_mmap_entry
|
|||
multiboot_uint64_t len;
|
||||
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define MULTIBOOT_MEMORY_RESERVED 2
|
||||
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
|
||||
#define MULTIBOOT_MEMORY_NVS 4
|
||||
multiboot_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
||||
|
|
|
@ -107,6 +107,8 @@ struct multiboot_mmap_entry
|
|||
multiboot_uint64_t len;
|
||||
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define MULTIBOOT_MEMORY_RESERVED 2
|
||||
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
|
||||
#define MULTIBOOT_MEMORY_NVS 4
|
||||
multiboot_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue