merge mainline into newreloc
This commit is contained in:
commit
262355247f
44 changed files with 1520 additions and 62 deletions
|
@ -37,6 +37,7 @@ extern struct grub_relocator *grub_multiboot_relocator;
|
|||
void grub_multiboot (int argc, char *argv[]);
|
||||
void grub_module (int argc, char *argv[]);
|
||||
|
||||
void grub_multiboot_set_accepts_video (int val);
|
||||
grub_err_t grub_multiboot_make_mbi (grub_uint32_t *target);
|
||||
void grub_multiboot_free_mbi (void);
|
||||
grub_err_t grub_multiboot_init_mbi (int argc, char *argv[]);
|
||||
|
|
67
include/grub/test.h
Normal file
67
include/grub/test.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
#ifndef GRUB_TEST_HEADER
|
||||
#define GRUB_TEST_HEADER
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/list.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
|
||||
struct grub_test
|
||||
{
|
||||
/* The next test. */
|
||||
struct grub_test *next;
|
||||
|
||||
/* The test name. */
|
||||
char *name;
|
||||
|
||||
/* The test main function. */
|
||||
void (*main) (void);
|
||||
};
|
||||
typedef struct grub_test *grub_test_t;
|
||||
|
||||
extern grub_test_t grub_test_list;
|
||||
|
||||
void grub_test_register (const char *name, void (*test) (void));
|
||||
void grub_test_unregister (const char *name);
|
||||
|
||||
/* Execute a test and print results. */
|
||||
int grub_test_run (grub_test_t test);
|
||||
|
||||
/* Test `cond' for nonzero; log failure otherwise. */
|
||||
void grub_test_nonzero (int cond, const char *file,
|
||||
const char *func, grub_uint32_t line,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 5, 6)));
|
||||
|
||||
/* Macro to fill in location details and an optional error message. */
|
||||
#define grub_test_assert(cond, ...) \
|
||||
grub_test_nonzero(cond, __FILE__, __FUNCTION__, __LINE__, \
|
||||
## __VA_ARGS__, \
|
||||
"assert failed: %s", #cond)
|
||||
|
||||
/* Macro to define a unit test. */
|
||||
#define GRUB_UNIT_TEST(name, funp) \
|
||||
void grub_unit_test_init (void) \
|
||||
{ \
|
||||
grub_test_register (name, funp); \
|
||||
} \
|
||||
\
|
||||
void grub_unit_test_fini (void) \
|
||||
{ \
|
||||
grub_test_unregister (name); \
|
||||
}
|
||||
|
||||
/* Macro to define a functional test. */
|
||||
#define GRUB_FUNCTIONAL_TEST(name, funp) \
|
||||
GRUB_MOD_INIT(functional_test_##funp) \
|
||||
{ \
|
||||
grub_test_register (name, funp); \
|
||||
} \
|
||||
\
|
||||
GRUB_MOD_FINI(functional_test_##funp) \
|
||||
{ \
|
||||
grub_test_unregister (name); \
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_TEST_HEADER */
|
|
@ -329,4 +329,7 @@ grub_video_check_mode_flag (unsigned int flags, unsigned int mask,
|
|||
grub_video_driver_id_t
|
||||
grub_video_get_driver_id (void);
|
||||
|
||||
grub_video_driver_id_t
|
||||
grub_video_get_driver_id (void);
|
||||
|
||||
#endif /* ! GRUB_VIDEO_HEADER */
|
||||
|
|
1
include/grub/x86_64/multiboot.h
Normal file
1
include/grub/x86_64/multiboot.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/multiboot.h>
|
|
@ -85,10 +85,12 @@
|
|||
#define MULTIBOOT_INFO_APM_TABLE 0x00000400
|
||||
|
||||
/* Is there video information? */
|
||||
#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
|
||||
#define MULTIBOOT_INFO_VBE_INFO 0x00000800
|
||||
#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef unsigned char multiboot_uint8_t;
|
||||
typedef unsigned short multiboot_uint16_t;
|
||||
typedef unsigned int multiboot_uint32_t;
|
||||
typedef unsigned long long multiboot_uint64_t;
|
||||
|
@ -187,9 +189,43 @@ struct multiboot_info
|
|||
multiboot_uint16_t vbe_interface_seg;
|
||||
multiboot_uint16_t vbe_interface_off;
|
||||
multiboot_uint16_t vbe_interface_len;
|
||||
|
||||
multiboot_uint64_t framebuffer_addr;
|
||||
multiboot_uint32_t framebuffer_pitch;
|
||||
multiboot_uint32_t framebuffer_width;
|
||||
multiboot_uint32_t framebuffer_height;
|
||||
multiboot_uint8_t framebuffer_bpp;
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
|
||||
multiboot_uint8_t framebuffer_type;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
multiboot_uint32_t framebuffer_palette_addr;
|
||||
multiboot_uint16_t framebuffer_palette_num_colors;
|
||||
};
|
||||
struct
|
||||
{
|
||||
multiboot_uint8_t framebuffer_red_field_position;
|
||||
multiboot_uint8_t framebuffer_red_mask_size;
|
||||
multiboot_uint8_t framebuffer_green_field_position;
|
||||
multiboot_uint8_t framebuffer_green_mask_size;
|
||||
multiboot_uint8_t framebuffer_blue_field_position;
|
||||
multiboot_uint8_t framebuffer_blue_mask_size;
|
||||
};
|
||||
};
|
||||
};
|
||||
typedef struct multiboot_info multiboot_info_t;
|
||||
|
||||
struct multiboot_color
|
||||
{
|
||||
multiboot_uint8_t red;
|
||||
multiboot_uint8_t green;
|
||||
multiboot_uint8_t blue;
|
||||
};
|
||||
|
||||
struct multiboot_mmap_entry
|
||||
{
|
||||
multiboot_uint32_t size;
|
||||
|
|
|
@ -85,10 +85,12 @@
|
|||
#define MULTIBOOT_INFO_APM_TABLE 0x00000400
|
||||
|
||||
/* Is there video information? */
|
||||
#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
|
||||
#define MULTIBOOT_INFO_VBE_INFO 0x00000800
|
||||
#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef unsigned char multiboot_uint8_t;
|
||||
typedef unsigned short multiboot_uint16_t;
|
||||
typedef unsigned int multiboot_uint32_t;
|
||||
typedef unsigned long long multiboot_uint64_t;
|
||||
|
@ -187,9 +189,43 @@ struct multiboot_info
|
|||
multiboot_uint16_t vbe_interface_seg;
|
||||
multiboot_uint16_t vbe_interface_off;
|
||||
multiboot_uint16_t vbe_interface_len;
|
||||
|
||||
multiboot_uint64_t framebuffer_addr;
|
||||
multiboot_uint32_t framebuffer_pitch;
|
||||
multiboot_uint32_t framebuffer_width;
|
||||
multiboot_uint32_t framebuffer_height;
|
||||
multiboot_uint8_t framebuffer_bpp;
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
|
||||
#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
|
||||
multiboot_uint8_t framebuffer_type;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
multiboot_uint32_t framebuffer_palette_addr;
|
||||
multiboot_uint16_t framebuffer_palette_num_colors;
|
||||
};
|
||||
struct
|
||||
{
|
||||
multiboot_uint8_t framebuffer_red_field_position;
|
||||
multiboot_uint8_t framebuffer_red_mask_size;
|
||||
multiboot_uint8_t framebuffer_green_field_position;
|
||||
multiboot_uint8_t framebuffer_green_mask_size;
|
||||
multiboot_uint8_t framebuffer_blue_field_position;
|
||||
multiboot_uint8_t framebuffer_blue_mask_size;
|
||||
};
|
||||
};
|
||||
};
|
||||
typedef struct multiboot_info multiboot_info_t;
|
||||
|
||||
struct multiboot_color
|
||||
{
|
||||
multiboot_uint8_t red;
|
||||
multiboot_uint8_t green;
|
||||
multiboot_uint8_t blue;
|
||||
};
|
||||
|
||||
struct multiboot_mmap_entry
|
||||
{
|
||||
multiboot_uint32_t size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue