Second version of the patch (sent to grub-devel in 2008-01-29)

This commit is contained in:
Robert Millan 2010-01-18 14:24:17 +00:00
parent 2c40cc7868
commit c8298743f3
14 changed files with 36 additions and 32 deletions

View file

@ -3,7 +3,6 @@
* geninit.sh: Call _init with a null argument.
* configure.ac: Add ia64-efi target.
* Makefile.in (STRIP_FLAGS): Declare (overriden on ia64).
(RMKFILES): Add ia64-efi.rmk
* genmk.rb: Use STRIP_FLAGS for strip.
* util/ia64/efi/grub-install.in: New file.
* util/ia64/efi/pe32.h: New file.

View file

@ -83,8 +83,7 @@ enable_grub_emu = @enable_grub_emu@
### General variables.
RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \
sparc64-ieee1275.rmk i386-efi.rmk ia64-efi.rmk)
RMKFILES = $(wildcard $(srcdir)/conf/*.rmk)
MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \
@ -98,13 +97,13 @@ MOSTLYCLEANFILES =
DISTCLEANFILES = config.status config.cache config.log config.h \
Makefile stamp-h include/grub/cpu include/grub/machine \
gensymlist.sh genkernsyms.sh
MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES))
MAINTAINER_CLEANFILES = $(srcdir)/configure $(MKFILES)
# The default target.
all: all-local
### Include an arch-specific Makefile.
$(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb
$(MKFILES): %.mk: %.rmk genmk.rb
if test "x$(RUBY)" = x; then \
touch $@; \
else \

View file

@ -1,4 +1,4 @@
/* acpi.c - Display acpi. */
/* acpi.c - Display acpi tables. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
@ -23,20 +23,17 @@
static grub_uint32_t read16 (grub_uint8_t *p)
{
return p[0] | (p[1] << 8);
return grub_le_to_cpu16 (*(grub_uint16_t *)p);
}
static grub_uint32_t read32 (grub_uint8_t *p)
{
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
return grub_le_to_cpu32 (*(grub_uint32_t *)p);
}
static grub_uint64_t read64 (grub_uint8_t *p)
{
grub_uint32_t l, h;
l = read32(p);
h = read32(p + 4);
return l | (((grub_uint64_t)h) << 32);
return grub_le_to_cpu64 (*(grub_uint64_t *)p);
}
static void

View file

@ -20,6 +20,7 @@ pkgdata_DATA += kern/ia64/efi/elf_ia64_efi.lds
# For grub-elf2pe
grub_elf2pe_SOURCES = util/ia64/efi/elf2pe.c
grub_elf2pe_CFLAGS = -DELF2PE_IA64
# For grub-emu.
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
@ -27,8 +28,12 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
commands/terminal.c commands/ls.c commands/test.c \
commands/search.c commands/blocklist.c \
disk/loopback.c \
fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \
fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \
\
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/xfs.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \

View file

@ -88,10 +88,10 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `long', as computed by sizeof. */
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `void *', as computed by sizeof. */
/* The size of a `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* Define it to either start or _start */

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2007 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,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

View file

@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Linux/IA-64 version.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2008 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 Free Software Foundation, Inc.
* Copyright (C) 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

View file

@ -23,15 +23,15 @@
.proc __ia64_trampoline
.global __ia64_trampoline
__ia64_trampoline:
// Read address of the real descriptor
/* Read address of the real descriptor. */
ld8 r2=[r1],8
;;
// Read chain
/* Read chain. */
ld8 r15=[r1]
// Read pc
/* Read pc. */
ld8 r3=[r2],8
;;
// Read gp
/* Read gp. */
ld8 r1=[r2]
mov b6=r3
br.many b6

View file

@ -39,14 +39,16 @@
#define BOOT_PARAM_SIZE 16384
struct ia64_boot_param {
struct ia64_boot_param
{
grub_uint64_t command_line; /* physical address of command line. */
grub_uint64_t efi_systab; /* physical address of EFI system table */
grub_uint64_t efi_memmap; /* physical address of EFI memory map */
grub_uint64_t efi_memmap_size; /* size of EFI memory map */
grub_uint64_t efi_memdesc_size; /* size of an EFI memory map descriptor */
grub_uint32_t efi_memdesc_version; /* memory descriptor version */
struct {
struct
{
grub_uint16_t num_cols; /* number of columns on console output dev */
grub_uint16_t num_rows; /* number of rows on console output device */
grub_uint16_t orig_x; /* cursor's x position */
@ -61,7 +63,8 @@ struct ia64_boot_param {
grub_uint64_t modules_nbr;
};
struct ia64_boot_module {
struct ia64_boot_module
{
grub_uint64_t mod_start;
grub_uint64_t mod_end;
@ -71,7 +74,8 @@ struct ia64_boot_module {
grub_uint64_t next;
};
typedef struct {
typedef struct
{
grub_uint32_t revision;
grub_uint32_t reserved;
void *fpswa;

View file

@ -101,7 +101,7 @@ GRUB_MOD_FINI(linux_normal)
{
grub_unregister_command ("linux");
grub_unregister_command ("initrd");
grub_unregister_command ("normal");
grub_unregister_command ("module");
grub_unregister_command ("relocate");
grub_unregister_command ("fpswa");
}

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
/* Copyright (C) 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
/* Copyright (C) 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -23,12 +23,12 @@
#include <time.h>
#include <elf.h>
#if defined(i386)
#if defined(ELF2PE_I386)
#define USE_ELF32
#define USE_PE32
#define ELF_MACHINE EM_386
#define EFI_MACHINE PE32_MACHINE_I386
#elif defined(__ia64__)
#elif defined(ELF2PE_IA64)
#define USE_ELF64
#define USE_PE32PLUS
#define ELF_MACHINE EM_IA_64