Commit Graph

57 Commits

Author SHA1 Message Date
Alexander Graf f1957dc8a3 RISC-V: Add to build system
This patch adds support for RISC-V to the grub build system. With this
patch, I can successfully build grub on RISC-V as a UEFI application.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-02-25 14:02:05 +01:00
Robert Elliott c79c59f129 lsefimmap: support persistent memory and other UEFI 2.5 features
This should accompany
	76ce1de740 Translate UEFI persistent memory type

1. Add a string for the EfiPersistentMemory type 14 that was
added in UEFI 2.5.

2. Decode the memory attributes that were added in UEFI 2.5:
* NV (non-volatile)
* MORE_RELIABLE (higher reliable, e.g., mirrored memory in a system
  with partial memory mirroring)
* RO (read-only)

3. Use proper IEC binary units (KiB, MiB, etc.) for power-of-two
values rather than misusing SI power-of-ten units (KB, MB, etc.)

4. The lsmmap command only decodes memory ranges sizes up to GiB scale
units.  Persistent memory ranges will reach into the TiB scale.
Since 64-bit size field supports TiB, PiB, and EiB, decode all of
them for completeness.

5. In the lsefimmap command, rewrite the print statements to
* avoid rounding
* avoid a big nested if/else tree.

For example: In the sixth entry below, the value of 309MB implies
316416KB but is really reporting 316436KB.

Widen the size column to 6 digits to accommodate typical cases.
The worst case value would require 14 digits; if that happens,
let the columns get out of sync.

Old format:
Type      Physical start  - end             #Pages     Size Attributes
conv-mem  0000000000000000-0000000000092fff 00000093  588KB UC WC WT WB
reserved  0000000000093000-0000000000093fff 00000001    4KB UC WC WT WB
conv-mem  0000000000094000-000000000009ffff 0000000c   48KB UC WC WT WB
conv-mem  0000000000100000-000000000fffffff 0000ff00  255MB UC WC WT WB
BS-code   0000000010000000-0000000010048fff 00000049  292KB UC WC WT WB
conv-mem  0000000010049000-000000002354dfff 00013505  309MB UC WC WT WB
ldr-data  000000002354e000-000000003ecfffff 0001b7b2  439MB UC WC WT WB
BS-data   000000003ed00000-000000003ed7ffff 00000080  512KB UC WC WT WB
conv-mem  000000003ed80000-000000006af5ffff 0002c1e0  705MB UC WC WT WB
reserved  000000006af60000-000000006b55ffff 00000600    6MB UC WC WT WB
BS-data   000000006b560000-000000006b560fff 00000001    4KB UC WC WT WB
RT-data   000000006b561000-000000006b5e1fff 00000081  516KB RT UC WC WT WB
BS-data   000000006b5e2000-000000006ecfafff 00003719   55MB UC WC WT WB
BS-code   000000006ecfb000-000000006ecfbfff 00000001    4KB UC WC WT WB
conv-mem  000000006ecfc000-00000000711fafff 000024ff   36MB UC WC WT WB
BS-data   00000000711fb000-000000007128dfff 00000093  588KB UC WC WT WB
Unk 0d    0000000880000000-0000000e7fffffff 00600000   24GB UC WC WT WB NV
reserved  0000001680000000-0000001c7fffffff 00600000   24GB UC WC WT WB NV

New format:
Type      Physical start  - end             #Pages        Size Attributes
conv-mem  0000000000000000-0000000000092fff 00000093    588KiB UC WC WT WB
reserved  0000000000093000-0000000000093fff 00000001      4KiB UC WC WT WB
conv-mem  0000000000094000-000000000009ffff 0000000c     48KiB UC WC WT WB
conv-mem  0000000000100000-000000000fffffff 0000ff00    255MiB UC WC WT WB
BS-code   0000000010000000-0000000010048fff 00000049    292KiB UC WC WT WB
conv-mem  0000000010049000-000000002354dfff 00013505 316436KiB UC WC WT WB
ldr-data  000000002354e000-000000003ecfffff 0001b7b2 450248KiB UC WC WT WB
BS-data   000000003ed00000-000000003ed7ffff 00000080    512KiB UC WC WT WB
conv-mem  000000003ed80000-000000006af5ffff 0002c1e0 722816KiB UC WC WT WB
reserved  000000006af60000-000000006b55ffff 00000600      6MiB UC WC WT WB
BS-data   000000006b560000-000000006b560fff 00000001      4KiB UC WC WT WB
RT-data   000000006b561000-000000006b5e1fff 00000081    516KiB RT UC WC WT WB
BS-data   000000006b5e2000-000000006ecfafff 00003719  56420KiB UC WC WT WB
BS-code   000000006ecfb000-000000006ecfbfff 00000001      4KiB UC WC WT WB
conv-mem  000000006ecfc000-0000000071222fff 00002527  38044KiB UC WC WT WB
BS-data   0000000071223000-00000000712ddfff 000000bb    748KiB UC WC WT WB
persist   0000000880000000-0000000e7fffffff 00600000     24GiB UC WC WT WB NV
reserved  0000001680000000-0000001c7fffffff 00600000     24GiB UC WC WT WB NV
2015-12-17 21:00:44 +03:00
Robert Elliott 76ce1de740 Translate UEFI persistent memory type
Define
* GRUB_EFI_PERSISTENT_MEMORY (UEFI memory map type 14) per UEFI 2.5
* GRUB_MEMORY_PERSISTENT (E820 type 7) per ACPI 3.0
* GRUB_MEMORY_PERSISTENT_LEGACY (E820 unofficial type 12) per ACPI 3.0

and translate GRUB_EFI_PERSISTENT_MEMORY to GRUB_MEMORY_PERSISTENT in
grub_efi_mmap_iterate().

Includes
* adding the E820 names to lsmmap
* handling the E820 types in make_efi_memtype()

Suggested-by: Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
Suggested-by: Andrei Borzenkov <arvidjaar@gmail.com>
2015-12-15 10:25:34 +03:00
Pavel Bludov 7994077ab9 Add some UUIDs found in the hardware 2015-11-14 17:57:35 +03:00
Peter Jones 9e5f70174e Use EFI_SIMPLE_TEXT_INPUT_EX to support key combinations. 2015-10-25 16:36:28 +01:00
Andrei Borzenkov f348aee7b3 efinet: enable hardware filters when opening interface
Exclusive open on SNP will close all existing protocol instances which
may disable all receive filters on interface. Reinstall them after we
opened protocol exclusively.

Also follow UEFI specification recommendation and stop interfaces when
closing them:

Unexpected system errors, reboots and hangs can occur if an OS is loaded
and the network devices are not Shutdown() and Stopped().

Also by: Mark Salter <msalter@redhat.com>
Closes: 45204
2015-06-16 19:52:45 +03:00
Vladimir Serbinenko 4d6c69536e Show SATA device path. 2013-12-24 18:10:28 +01:00
Vladimir Serbinenko da98622662 Declare GRUB_EFI_VENDOR_APPLE_GUID. 2013-12-24 14:14:19 +01:00
Vladimir Serbinenko fba31b5f69 Dump type and vendor specific data when printing device path. 2013-12-24 14:05:48 +01:00
Leif Lindholm 30a9ab952f arm64: add EFI Linux loader
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
2013-12-22 18:38:44 +00:00
Vladimir Serbinenko b3aea1bc26 * include/grub/efi/api.h (GRUB_EFI_ERROR_CODE): Use explicit cast
rather than LL suffix.
2013-12-18 07:39:15 +01:00
Vladimir Serbinenko e8c360ca4a * include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): Remove leftover. 2013-12-18 07:35:51 +01:00
Vladimir Serbinenko 9fdec226ff * include/grub/efi/api.h: Don't use call wrappers when compiled with
mingw or cygwin as API already matches.
2013-12-16 14:39:06 +01:00
Vladimir Serbinenko 3e38c31a4b * include/grub/efi/api.h: Define (u)intn_t based on pointer size and
not on long.
2013-12-16 14:34:23 +01:00
Vladimir Serbinenko 7e47e27bd8 Add gcc_struct to all packed structures when compiling with mingw.
Just "packed" doesn't always pack the way we expect.
2013-12-15 14:14:30 +01:00
Vladimir Serbinenko 6dc3337774 Fix definition of grub_efi_hard_drive_device_path. Take care that
existing code would work even if by some reason bogus definition is
	used by EFI implementations.
2013-12-14 22:04:02 +01:00
Vladimir Serbinenko 607a39f9f0 * include/grub/efi/api.h: Rename protocol and interface to avoid
conflict.
2013-12-14 21:48:46 +01:00
Vladimir Serbinenko 316dda716c Introduce grub_efi_packed_guid and use it where alignment is not
guaranteed.
2013-12-11 15:57:08 +01:00
Vladimir Serbinenko 219401b8b9 * include/grub/efi/api.h (grub_efi_device_path): Define length as
unaligned u16 rather than u8[2].
2013-12-11 15:54:01 +01:00
Leif Lindholm 15a463d742 ARM 64 port by Leif Lindholm 2013-11-16 20:52:55 +01:00
Vladimir Serbinenko 9f8acdaa5d * grub-core/term/serial.c: Add option for enabling/disabling
RTS/CTS flow control.
2013-11-08 18:20:20 +01:00
Vladimir 'phcoder' Serbinenko bd69257a77 * include/grub/efi/api.h (GRUB_EFI_DEVICE_PATH_LENGTH): Use
grub_get_unaligned16 rather than shifts.
2013-04-28 15:15:57 +02:00
Vladimir 'phcoder' Serbinenko 3bfa763c48 * include/grub/efi/api.h (grub_efi_runtime_services): Make vendor_guid
a const pointer.
	* grub-core/efiemu/runtime/efiemu.c (efiemu_memcpy): Make from a
	const pointer.
	(efiemu_set_variable): Make vendor_guid a const pointer.
2012-09-12 08:31:05 +02:00
Peter Jones c5052c81ab * grub-core/Makefile.core.def (efifwsetup): New module.
* grub-core/commands/efi/efifwsetup.c: New file.
	* grub-core/kern/efi/efi.c (grub_efi_set_variable): New function
	* include/grub/efi/api.h (GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI):
	New define.
	* include/grub/efi/efi.h (grub_efi_set_variable): New proto.
2012-09-08 09:40:24 +02:00
Vladimir 'phcoder' Serbinenko 7bd29c01f0 New command `lsefi'.
* grub-core/Makefile.core.def (lsefi): New module.
	* grub-core/commands/efi/lsefi.c: New file.
	* include/grub/efi/api.h: Add more GUIDs.
2012-07-22 19:59:06 +02:00
Vladimir 'phcoder' Serbinenko 5a0dc6fb2a * include/grub/efi/api.h (grub_efi_runtime_services): Add missing
const qualifier for vendor_guid.
2012-02-27 14:09:09 +01:00
Matthew Garrett c598862958 * grub-core/kern/efi/efi.c (grub_efi_get_variable): Add new function.
* include/grub/efi/efi.h: Likewise.
	* include/grub/efi/api.h: Add guid for EFI-specified variables.
	* include/grub/charset.h (GRUB_MAX_UTF16_PER_UTF8): New definition.
	* grub-core/normal/charset.c (grub_utf8_process): Move from here ...
	* include/grub/charset.h (grub_utf8_process): ... to here. Inline.
	* grub-core/normal/charset.c (grub_utf8_to_utf16): Move from here ...
	* include/grub/charset.h (grub_utf8_to_utf16): ... to here. Inline.
2012-02-27 12:02:57 +01:00
Vladimir 'phcoder' Serbinenko a9c7fd1c6c Implement serial on IEEE1275 and EFI.
* docs/grub.texi (Platform-specific limitations): Fix the columen video
	on emu. Mention arc and emu as the only platforms without serial
	support.
	* grub-core/Makefile.core.def (serial): Enable on all terminfomodule and
	ieee1275 platforms.
	* grub-core/term/efi/serial.c: New file.
	* grub-core/term/ieee1275/serial.c: Likewise.
	* grub-core/term/serial.c (grub_serial_find): Disable direct port
	specification if no ns8250 driver is available.
	(grub_cmd_serial): Likewise.
	(GRUB_MOD_INIT) [GRUB_MACHINE_IEEE1275]: Init ofserial.
	(GRUB_MOD_INIT) [GRUB_MACHINE_EFI]: Init efiserial.
	* include/grub/efi/api.h (GRUB_EFI_SERIAL_IO_GUID): New define.
	(grub_efi_parity_type_t): New type.
	(grub_efi_stop_bits_t): Likewise.
	(grub_efi_serial_io_interface): New struct.
	* include/grub/serial.h (grub_serial_port): Make 'broken' field
	available for all interfaces.
	Add EFI and IEEE1275 fields.
	(grub_ofserial_init): New proto.
	(grub_efiserial_init): Likeiwse.
	* util/grub.d/00_header.in: Don't check for the presence of serial
	module.
2012-02-26 17:08:11 +01:00
Vladimir 'phcoder' Serbinenko bd67ad0f70 merge mainline into net 2011-12-15 20:51:35 +01:00
Vladimir 'phcoder' Serbinenko e739d69885 * include/grub/efi/api.h (grub_efi_memory_descriptor): Add packed
attribute as the structure isn't guaranteed to be properly aligned.
	(grub_efi_pci_device_path): Likewise.
	(grub_efi_pccard_device_path): Likewise.
	(grub_efi_memory_mapped_device_path): Likewise. Additionaly explicitly
	specify the size of `memory_type'.
	(grub_efi_vendor_device_path): Likewise.
	(grub_efi_controller_device_path): Likewise.
	(grub_efi_acpi_device_path): Likewise.
	(grub_efi_expanded_acpi_device_path): Likewise.
	(grub_efi_atapi_device_path): Likewise.
	(grub_efi_scsi_device_path): Likewise.
	(grub_efi_fibre_channel_device_path): Likewise.
	(grub_efi_1394_device_path): Likewise.
	(grub_efi_usb_device_path): Likewise.
	(grub_efi_usb_class_device_path): Likewise.
	(grub_efi_i2o_device_path): Likewise.
	(grub_efi_mac_address_device_path): Likewise.
	(grub_efi_ipv4_device_path): Likewise.
	(grub_efi_ipv6_device_path): Likewise.
	(grub_efi_infiniband_device_path): Likewise.
	(grub_efi_uart_device_path): Likewise.
	(grub_efi_vendor_messaging_device_path): Likewise.
	(grub_efi_hard_drive_device_path): Likewise.
	(grub_efi_cdrom_device_path): Likewise.
	(grub_efi_vendor_media_device_path): Likewise.
	(grub_efi_file_path_device_path): Likewise.
	(grub_efi_protocol_device_path): Likewise.
	(grub_efi_piwg_device_path): Likewise.
	(grub_efi_bios_device_path): Likewise.
2011-12-14 11:13:14 +01:00
Vladimir 'phcoder' Serbinenko eb6a7b9788 Hopefully fix EFI problem. Not tested 2011-10-05 23:33:36 +02:00
Vladimir 'phcoder' Serbinenko 0c51bb63c5 add missing brackets in efi_wrap macroses 2011-07-02 18:57:24 +02:00
Vladimir 'phcoder' Serbinenko cae730b452 Automatically determine prefix when netbooted on EFI 2011-07-02 16:56:35 +02:00
Vladimir 'phcoder' Serbinenko 9d22909b85 efinet support 2011-06-26 22:42:04 +02:00
phcoder c18271ed00 Fix compilation errors 2011-01-03 02:28:14 +01:00
Tristan Gingold 41a331a8d3 * grub-core/commands/efi/lsefimmap.c: New file.
* grub-core/Makefile.core.def (lsefimmap): New module.
	* include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): New definition.

	Also-By: Robert Millan <rmh.grub@aybabtu.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-01 10:12:41 +02:00
Tristan Gingold 105de6a758 * grub-core/commands/efi/lsefisystab.c: New file.
* grub-core/commands/efi/lssal.c: Likewise.
	* grub-core/Makefile.core.def (lsacpi): New module.
	(lsefisystab): Likewise.
	* include/grub/efi/api.h (GRUB_EFI_SAL_TABLE_GUID): New definition.
	(GRUB_EFI_HCDP_TABLE_GUID): Likewise.
	(grub_efi_sal_system_table): New struct.
	(grub_efi_sal_system_table_entrypoint_descriptor): Likewise.
	(grub_efi_sal_system_table_memory_descriptor): Likewise.
	(grub_efi_sal_system_table_platform_features): Likewise.
	(grub_efi_sal_system_table_translation_register_descriptor): Likewise.
	(grub_efi_sal_system_table_purge_translation_coherence): Likewise.
	(grub_efi_sal_system_table_ap_wakeup): Likewise.
	* include/grub/types.h (PRIuGRUB_UINT64_T): New definition.

	Also-By: Robert Millan <rmh.grub@aybabtu.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-01 02:37:17 +02:00
Vladimir 'phcoder' Serbinenko 52c2d97f26 2010-01-04 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/efi/api.h (GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE):
	New constant.
	(grub_efi_piwg_device_path): New structure
	(grub_efi_piwg_device_path_t): New type.
	* loader/efi/appleloader.c (piwg_full_device_path): New structure.
	(devpath_1): Transform to a structure. All users updated.
	(devpath_2): Likewise.
	(devpath_3): Likewise.
	(devpath_4): Likewise.
	(devpath_5): Likewise.
2010-01-04 14:59:06 +01:00
Robert Millan 58bc8bd5b1 2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* boot/i386/pc/boot.S: Update copyright year.
	* boot/i386/pc/cdboot.S: Likewise.
	* boot/i386/pc/diskboot.S: Likewise.
	* boot/i386/pc/lnxboot.S: Likewise.
	* boot/i386/pc/pxeboot.S: Likewise.
	* bus/pci.c: Likewise.
	* commands/cmp.c: Likewise.
	* commands/help.c: Likewise.
	* commands/hexdump.c: Likewise.
	* commands/i386/pc/halt.c: Likewise.
	* commands/i386/pc/play.c: Likewise.
	* commands/i386/pc/vbeinfo.c: Likewise.
	* commands/ls.c: Likewise.
	* commands/test.c: Likewise.
	* disk/dmraid_nvidia.c: Likewise.
	* disk/i386/pc/biosdisk.c: Likewise.
	* disk/ieee1275/nand.c: Likewise.
	* disk/ieee1275/ofdisk.c: Likewise.
	* disk/lvm.c: Likewise.
	* disk/raid.c: Likewise.
	* disk/raid6_recover.c: Likewise.
	* disk/scsi.c: Likewise.
	* fs/affs.c: Likewise.
	* fs/cpio.c: Likewise.
	* fs/ext2.c: Likewise.
	* fs/hfs.c: Likewise.
	* fs/iso9660.c: Likewise.
	* fs/ntfs.c: Likewise.
	* fs/sfs.c: Likewise.
	* fs/udf.c: Likewise.
	* fs/ufs.c: Likewise.
	* fs/xfs.c: Likewise.
	* gencmdlist.sh: Likewise.
	* genmk.rb: Likewise.
	* include/grub/disk.h: Likewise.
	* include/grub/efi/api.h: Likewise.
	* include/grub/efi/efi.h: Likewise.
	* include/grub/efi/pe32.h: Likewise.
	* include/grub/elf.h: Likewise.
	* include/grub/fs.h: Likewise.
	* include/grub/i386/at_keyboard.h: Likewise.
	* include/grub/i386/pc/memory.h: Likewise.
	* include/grub/i386/pc/vbe.h: Likewise.
	* include/grub/i386/pci.h: Likewise.
	* include/grub/i386/tsc.h: Likewise.
	* include/grub/ieee1275/ieee1275.h: Likewise.
	* include/grub/ntfs.h: Likewise.
	* include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
	* include/grub/sparc64/libgcc.h: Likewise.
	* include/grub/symbol.h: Likewise.
	* include/grub/types.h: Likewise.
	* include/multiboot2.h: Likewise.
	* io/gzio.c: Likewise.
	* kern/device.c: Likewise.
	* kern/disk.c: Likewise.
	* kern/efi/efi.c: Likewise.
	* kern/efi/mm.c: Likewise.
	* kern/elf.c: Likewise.
	* kern/file.c: Likewise.
	* kern/i386/dl.c: Likewise.
	* kern/i386/pc/init.c: Likewise.
	* kern/i386/pc/startup.S: Likewise.
	* kern/ieee1275/ieee1275.c: Likewise.
	* kern/ieee1275/init.c: Likewise.
	* kern/main.c: Likewise.
	* kern/mm.c: Likewise.
	* kern/powerpc/dl.c: Likewise.
	* kern/sparc64/dl.c: Likewise.
	* kern/x86_64/dl.c: Likewise.
	* lib/hexdump.c: Likewise.
	* loader/efi/appleloader.c: Likewise.
	* loader/i386/ieee1275/linux.c: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* loader/i386/pc/linux.c: Likewise.
	* loader/i386/pc/multiboot2.c: Likewise.
	* loader/ieee1275/multiboot2.c: Likewise.
	* loader/multiboot2.c: Likewise.
	* loader/multiboot_loader.c: Likewise.
	* loader/powerpc/ieee1275/linux.c: Likewise.
	* normal/completion.c: Likewise.
	* normal/menu_entry.c: Likewise.
	* partmap/apple.c: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/hostfs.c: Likewise.
	* video/readers/png.c: Likewise.
2010-01-03 22:05:07 +00:00
phcoder 12d6fc8461 EFI support 2009-09-03 19:19:59 +02:00
fzielcke b39f9d20a9 remove all trailing whitespace 2009-06-10 21:04:23 +00:00
phcoder 5caf964d75 2009-05-02 Vladimir Serbinenko <phcoder@gmail.com>
Efiemu
 
	* conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram,
	_linux_efi, linux_efi. 
	new files in grub-emu 
	new targets efiemu32.o and efiemu64.o
	* loader/linux_normal_efiemu.c: likewise
	* loader/i386/efi/linux.c: added preliminary efiemu support
	* util/i386/pc/grub-install.in: add efiemu??.o to the list of 
	files to copy
	* include/grub/autoefi.h: new file
	* nclude/grub/i386/efiemu.h: likewise
	* include/grub/i386/pc/efiemu.h: likewise
	* include/grub/efi/api.h: add LL suffix when necessary
	new definitions relating to tables
	* include/grub/efiemu/efiemu.h: new file
	* include/grub/efiemu/runtime.h: likewise
	* efiemu/prepare.c: likewise
	* efiemu/loadcore_common.c: likewise
	* efiemu/loadcore64.c: likewise
	* efiemu/runtime/efiemu.sh: likewise
	* efiemu/runtime/efiemu.S: likewise
	* efiemu/runtime/efiemu.c: likewise
	* efiemu/runtime/config.h: likewise
	* efiemu/prepare32.c: likewise
	* efiemu/main.c: likewise
	* efiemu/modules/pnvram.c: likewise
	* efiemu/modules/i386: likewise
	* efiemu/modules/i386/pc: likewise
	* efiemu/modules/acpi.c: likewise
	* efiemu/i386/pc/cfgtables.c: likewise
	* efiemu/i386/loadcore64.c: likewise
	* efiemu/i386/loadcore32.c: likewise
	* efiemu/prepare64.c: likewise
	* efiemu/loadcore.c: likewise
	* efiemu/symbols.c: likewise
	* efiemu/mm.c: likewise
	* efiemu/loadcore32.c: likewise
2009-05-02 22:40:21 +00:00
bean e7e6862a4c 2009-04-10 Bean <bean123ch@gnail.com>
* include/grub/efi/api.h (grub_efi_configuration_table): Add packed
	attribute, otherwise the size would be wrong for i386 platform.

	* include/grub/pci.h (grub_pci_read_word): New inline function.
	(grub_pci_read_byte): Likewise.
	(grub_pci_write): Likewise.
	(grub_pci_write_word): Likewise.
	(grub_pci_write_byte): Likewise.

	* include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR.

	* loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module.
	(find_framebuf): Scan pci to locate the frame buffer address.

	* commands/efi/fixvideo.c: New file.

	* commands/efi/loadbios.c: Likewise.

	* commands/memrw.c: Likewise.

	* util/grub-dumpbios.in: Likewise.

	* conf/common.rmk (grub-dumpbios): New utility.
	(pkglib_MODULES): New module memrw.mod.
	(memrw_mod_SOURCE): New macro.
	(memrw_mod_CFLAGS): Likewise.
	(memrw_mod_LDFLAGS): Likewise.

	* conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and
	fixvideo.mod.
	(loadbios_mod_SOURCE): New macro.
	(loadbios_mod_CFLAGS): Likewise.
	(loadbios_mod_LDFLAGS): Likewise.
	(fixvideo_mod_SOURCE): Likewise.
	(fixvideo_mod_CFLAGS): Likewise.
	(fixvideo_mod_LDFLAGS): Likewise.

	* conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and
	fixvideo.mod.
	(loadbios_mod_SOURCE): New macro.
	(loadbios_mod_CFLAGS): Likewise.
	(loadbios_mod_LDFLAGS): Likewise.
	(fixvideo_mod_SOURCE): Likewise.
	(fixvideo_mod_CFLAGS): Likewise.
	(fixvideo_mod_LDFLAGS): Likewise.
2009-04-10 15:33:34 +00:00
okuji 6842cec424 Undo r2063. 2009-04-04 09:22:35 +00:00
bean 838c454296 2009-04-04 Bean <bean123ch@gnail.com>
* include/grub/efi/api.h (grub_efi_configuration_table): Add packed
	attribute, otherwise the size would be wrong for i386 platform.

	* include/grub/pci.h (grub_pci_read_word): New inline function.
	(grub_pci_read_byte): Likewise.
	(grub_pci_write): Likewise.
	(grub_pci_write_word): Likewise.
	(grub_pci_write_byte): Likewise.

	* include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR.

	* loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module.
	(find_framebuf): Scan pci to locate the frame buffer address.

	* commands/efi/fixvideo.c: New file.

	* commands/efi/loadbios.c: Likewise.

	* commands/memrw.c: Likewise.

	* util/grub-dumpbios.in: Likewise.

	* conf/common.rmk (grub-dumpbios): New utility.
	(pkglib_MODULES): New module memrw.mod.
	(memrw_mod_SOURCE): New macro.
	(memrw_mod_CFLAGS): Likewise.
	(memrw_mod_LDFLAGS): Likewise.

	* conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and
	fixvideo.mod.
	(loadbios_mod_SOURCE): New macro.
	(loadbios_mod_CFLAGS): Likewise.
	(loadbios_mod_LDFLAGS): Likewise.
	(fixvideo_mod_SOURCE): Likewise.
	(fixvideo_mod_CFLAGS): Likewise.
	(fixvideo_mod_LDFLAGS): Likewise.

	* conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and
	fixvideo.mod.
	(loadbios_mod_SOURCE): New macro.
	(loadbios_mod_CFLAGS): Likewise.
	(loadbios_mod_LDFLAGS): Likewise.
	(fixvideo_mod_SOURCE): Likewise.
	(fixvideo_mod_CFLAGS): Likewise.
	(fixvideo_mod_LDFLAGS): Likewise.
2009-04-04 08:08:01 +00:00
bean 9902d04725 2009-03-01 Bean <bean123ch@gmail.com>
* include/grub/efi/api.h (GRUB_EFI_MPS_TABALE_GUID): New constant.
	(GRUB_EFI_ACPI_TABLE_GUID): Likewise.
	(GRUB_EFI_ACPI_20_TABLE_GUID): Likewise.
	(GRUB_EFI_SMBIOS_TABLE_GUID): Likewise.

	* loader/i386/efi/linux.c (acpi_guid): New variable.
	(acpi_guid): Likewise.
	(EBDA_SEG_ADDR): New constant.
	(LOW_MEM_ADDR): Likewise.
	(FAKE_EBDA_SEG): Likewise.
	(fake_bios_data): New function.
	(grub_linux_boot): Call fake_bios_data.
2009-03-01 17:57:57 +00:00
bean 6e09b8b72e 2009-02-24 Bean <bean123ch@gmail.com>
* configure.ac: Check for -mcmodel=large in x86_64 target.

	* include/grub/efi/api.h (efi_call_10): New macro.
	(efi_wrap_10): New function.

	* include/grub/efi/pe32.h (GRUB_PE32_REL_BASE_HIGH): New macro.
	(GRUB_PE32_REL_BASED_HIGH): Likewise.
	(GRUB_PE32_REL_BASED_LOW): Likewise.
	(GRUB_PE32_REL_BASED_HIGHLOW): Likewise.
	(GRUB_PE32_REL_BASED_HIGHADJ): Likewise.
	(GRUB_PE32_REL_BASED_MIPS_JMPADDR): Likewise.
	(GRUB_PE32_REL_BASED_SECTION): Likewise.
	(GRUB_PE32_REL_BASED_REL): Likewise.
	(GRUB_PE32_REL_BASED_IA64_IMM64): Likewise.
	(GRUB_PE32_REL_BASED_DIR64): Likewise.
	(GRUB_PE32_REL_BASED_HIGH3ADJ): Likewise.

	* kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Fixed relocation
	issue.

	* kern/x86_64/efi/callwrap.S (efi_wrap_6): Bug fix.
	(efi_wrap_10): New function.

	* kern/x86_64/efi/startup.S (codestart): Use relative addressing.

	* loader/efi/appleloader.c (devpath_5): Add support for late 2008
	MB/MBP model (NV chipset).
	(devdata_devs): Add devpath_5 to the list.

	* load/i386/efi/linux.c (video_base): Remove variable.
	(RGB_MASK): New macro.
	(RGB_MAGIC): Likewise.
	(LINE_MIN): Likewise.
	(LINE_MAX): Likewise.
	(FBTEST_STEP): Likewise.
	(FBTEST_COUNT): Likewise.
	(fb_list): New variable.
	(grub_find_video_card): Remove function.
	(find_framebuf): New function.
	(grub_linux_setup_video): Use find_framebuf to get frame buffer and
	line length.

	* util/i386/efi/grub-mkimage.c (grub_reloc_section): Fix relocation
	problem for x86_64.
2009-02-24 13:19:46 +00:00
robertmh f36cc10867 2009-01-10 Robert Millan <rmh@aybabtu.com>
Update a few copyright years which we forgot to do in 2008 (only for
            files whose changes made in 2008 were copyright-significant)

            * Makefile.in: Add 2008 to Copyright line.
            * disk/ieee1275/ofdisk.c: Likewise.
            * disk/efi/efidisk.c: Likewise.
            * kern/dl.c: Likewise.
            * kern/sparc64/ieee1275/init.c: Likewise.
            * kern/mm.c: Likewise.
            * kern/efi/mm.c: Likewise.
            * boot/i386/pc/boot.S: Likewise.
            * genfslist.sh: Likewise.
            * fs/iso9660.c: Likewise.
            * fs/hfs.c: Likewise.
            * fs/jfs.c: Likewise.
            * fs/minix.c: Likewise.
            * fs/ufs.c: Likewise.
            * gensymlist.sh.in: Likewise.
            * genkernsyms.sh.in: Likewise.
            * include/grub/misc.h: Likewise.
            * include/grub/types.h: Likewise.
            * include/grub/symbol.h: Likewise.
            * include/grub/elf.h: Likewise.
            * include/grub/kernel.h: Likewise.
            * include/grub/disk.h: Likewise.
            * include/grub/dl.h: Likewise.
            * include/grub/i386/linux.h: Likewise.
            * include/grub/i386/pc/biosdisk.h: Likewise.
            * include/grub/efi/api.h: Likewise.
            * include/grub/efi/pe32.h: Likewise.
            * include/grub/util/misc.h: Likewise.
            * normal/execute.c: Likewise.
            * normal/arg.c: Likewise.
            * normal/completion.c: Likewise.
            * normal/lexer.c: Likewise.
            * normal/parser.y: Likewise.
            * normal/misc.c: Likewise.
            * commands/i386/pc/vbeinfo.c: Likewise.
            * commands/hexdump.c: Likewise.
            * commands/terminal.c: Likewise.
            * commands/ls.c: Likewise.
            * commands/help.c: Likewise.
            * partmap/pc.c: Likewise.
            * loader/efi/chainloader.c: Likewise.
            * loader/multiboot_loader.c: Likewise.
            * loader/i386/pc/multiboot2.c: Likewise.
            * term/efi/console.c: Likewise.
            * term/i386/pc/serial.c: Likewise.
            * util/lvm.c: Likewise.
            * util/console.c: Likewise.
            * util/i386/efi/grub-mkimage.c: Likewise.
            * util/raid.c: Likewise.
2009-01-10 13:07:44 +00:00
bean 2001169405 2008-07-17 Bean <bean123ch@gmail.com>
* conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod.
	(appleldr_mod_SOURCE): New variavle.
	(appleldr_mod_CFLAGS): Likewise.
	(appleldr_mod_LDFLAGS): Likewise.
	(pci_mod_SOURCES): Likewise.
	(pci_mod_CFLAGS): Likewise.
	(pci_mod_LDFLAGS): Likewise.
	(lspci_mod_SOURCES): Likewise.
	(lspci_mod_CFLAGS): Likewise.
	(lspci_mod_LDFLAGS): Likewise.

	* conf/x86_64-efi.rmk: New file.

	* disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N
	macro.
	(grub_efidisk_write): Likewise.

	* include/efi/api.h (efi_call_0): New macro.
	(efi_call_1): Likewise.
	(efi_call_2): Likewise.
	(efi_call_3): Likewise.
	(efi_call_4): Likewise.
	(efi_call_5): Likewise.
	(efi_call_6): Likewise.

	* include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to
	grub_rescue_cmd_chainloader.

	* include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro.
	(grub_pe32_optional_header): Change some fields based on i386 or
	x86_64 platform.
	(GRUB_PE32_PE32_MAGIC): Likewise.

	* include/grub/efi/uga_draw.h: New file.

	* include/grub/elf.h (STN_ABS): New constant.
	(R_X86_64_NONE): Relocation constant for x86_64.
	(R_X86_64_64): Likewise.
	(R_X86_64_PC32): Likewise.
	(R_X86_64_GOT32): Likewise.
	(R_X86_64_PLT32): Likewise.
	(R_X86_64_COPY): Likewise.
	(R_X86_64_GLOB_DAT): Likewise.
	(R_X86_64_JUMP_SLOT): Likewise.
	(R_X86_64_RELATIVE): Likewise.
	(R_X86_64_GOTPCREL): Likewise.
	(R_X86_64_32): Likewise.
	(R_X86_64_32S): Likewise.
	(R_X86_64_16): Likewise.
	(R_X86_64_PC16): Likewise.
	(R_X86_64_8): Likewise.
	(R_X86_64_PC8): Likewise.

	* include/grub/i386/efi/pci.h: New file.

	* include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE):
	Change it value based on platform.
	(GRUB_LINUX_EFI_SIGNATURE_0204): New constant.
	(GRUB_E820_RAM): Likewise.
	(GRUB_E820_RESERVED): Likewise.
	(GRUB_E820_ACPI): Likewise.
	(GRUB_E820_NVS): Likewise.
	(GRUB_E820_EXEC_CODE): Likewise.
	(GRUB_E820_MAX_ENTRY): Likewise.
	(grub_e820_mmap): New structure.
	(linux_kernel_header): Change the efi field according to different
	kernel version, also field from linux_kernel_header.

	* include/grub/kernel.h (grub_module_info): Add padding for x86_64.

	* include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant.
	(GRUB_PCI_ADDR_SPACE_MEMORY): Likewise.
	(GRUB_PCI_ADDR_SPACE_IO): Likewise.
	(GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise.
	(GRUB_PCI_ADDR_MEM_TYPE_32): Likewise.
	(GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise.
	(GRUB_PCI_ADDR_MEM_TYPE_64): Likewise.
	(GRUB_PCI_ADDR_MEM_PREFETCH): Likewise.
	(GRUB_PCI_ADDR_MEM_MASK): Likewise.
	(GRUB_PCI_ADDR_IO_MASK): Likewise.

	* include/grub/x86_64/efi/kernel.h: New file.

	* include/grub/x86_64/efi/loader.h: Likewise.

	* include/grub/x86_64/efi/machine.h: Likewise.

	* include/grub/x86_64/efi/pci.h: Likewise.

	* include/grub/x86_64/efi/time.h: Likewise.

	* include/grub/x86_64/linux.h: Likewise.

	* include/grub/x86_64/setjmp.h: Likewise.

	* include/grub/x86_64/time.h: Likewise.

	* include/grub/x86_64/types.h: Likewise.

	* kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to
	 GRUB_TARGET_SIZEOF_VOID_P.

	* kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls.
	(grub_efi_locate_handle): Likewise.
	(grub_efi_open_protocol): Likewise.
	(grub_efi_set_text_mode): Likewise.
	(grub_efi_stall): Likewise.
	(grub_exit): Likewise.
	(grub_reboot): Likewise.
	(grub_halt): Likewise.
	(grub_efi_exit_boot_services): Likewise.
	(grub_get_rtc): Likewise.

	* kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models.
	(GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P.
	(grub_efi_allocate_pages): Wrap efi calls.
	(grub_efi_free_pages): Wrap efi calls.
	(grub_efi_get_memory_map): Wrap efi calls.

	* kern/x86_64/dl.c: New file.

	* kern/x86_64/efi/callwrap.S: Likewise.

	* kern/x86_64/efi/startup.S: Likewise.

	* loader/efi/appleloader.c: Likewise.

	* loader/efi/chainloader.c (cmdline): New variable.
	(grub_chainloader_unload): Wrap efi calls.
	(grub_chainloader_boot): Likewise.
	(grub_rescue_cmd_chainloader): Wrap efi calls, handle
	command line.

	* loader/efi/chainloader_normal.c (chainloader_command):
	Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass
	command line.

	* loader/i386/efi/linux.c (allocate_pages): Change allocation
	method.
	(grub_e820_add_region): New function.
	(grub_linux_boot): Construct e820 map from efi map, handle x86_64
	booting.
	(grub_find_video_card): New function.
	(grub_linux_setup_video): New function.
	(grub_rescue_cmd_linux): Probe for video information.

	* normal/x86_64/setjmp.S: New file.

	* term/efi/console.c (map_char): New function.
	(grub_console_putchar): Map unicode char.
	(grub_console_checkkey): Wrap efi calls.
	(grub_console_getkey): Likewise.
	(grub_console_getwh): Likewise.
	(grub_console_gotoxy): Likewise.
	(grub_console_cls): Likewise.
	(grub_console_setcolorstate): Likewise.
	(grub_console_setcursor): Likewise.

	* util/i386/efi/grub-mkimage.c: Add support for x86_64.
2008-07-17 09:50:26 +00:00
proski cc85c3c340 Typo fixes in comments and variable names. 2007-12-30 08:52:06 +00:00