merge mainline into arm
This commit is contained in:
commit
8e71d87482
490 changed files with 24671 additions and 8612 deletions
|
@ -176,3 +176,5 @@ include/grub/gcrypt/gcrypt.h
|
|||
include/grub/gcrypt/g10lib.h
|
||||
grub-core/lib/dtc-grub
|
||||
grub-core/Makefile.libfdt.def
|
||||
po/POTFILES.in
|
||||
po/POTFILES-shell.in
|
||||
|
|
856
ChangeLog
856
ChangeLog
|
@ -1,3 +1,859 @@
|
|||
2013-05-11 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* docs/grub.texi (Device syntax): Clarify description of network
|
||||
drives.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Redirect xasprintf to grub_xvasprintf rather than having #ifdef's
|
||||
for vasprintf presence.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-install.in: Handle efibootmgr presence check.
|
||||
Reported by: Leif Lindholm.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/testspeed.c: Reuse formatting string to decrease
|
||||
new strings to translate.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Replace `STR' with `STRING' to avoid adding
|
||||
yet another string (pun intended) to translate.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* po/POTFILES-shell.in: Autogenerate it.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/net/net.c (grub_net_open_real): Autoload network modules.
|
||||
|
||||
2013-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/terminfo.c: Rename ANSI_C0 to ANSI_CSI to avoid
|
||||
misnomer.
|
||||
|
||||
2013-05-08 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* docs/grub.texi (Network): Add description of net_default_interface,
|
||||
net_default_ip and net_default_mac. Rewrite variables description
|
||||
to emphasize that they are per-interface.
|
||||
|
||||
2013-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
New test: cmdline and cat.
|
||||
|
||||
2013-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/cat.c: Show UTF-8 characters.
|
||||
|
||||
2013-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* conf/Makefile.common: Poison float and double on non-emu.
|
||||
|
||||
2013-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Don't disable extended registers on emu.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Don't use extended registers on x86_64.
|
||||
Reported by: Peter Jones.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/efi/console.c: Fix compile error.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Compressed HFS+ support.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/videoinfo.c: Use "paletted" rather than "packed
|
||||
pixel".
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Menu color test.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/tests/setjmp_test.c: New test.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
New variables 'net_default_*' to determine MAC/IP of default interface.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/gettext_strings_test.in: A test to check for strings not
|
||||
marked for translation.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* autogen.sh: Exclude unused libgcrypt files from translation.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Simplify few strings.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Mark few forgotten strings for translation.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/linux.c: Use grub_dprintf for debug statements
|
||||
rather than printf.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/video/readers/jpeg.c: Use grub_dprintf for debug statements
|
||||
rather than printf.
|
||||
* grub-core/video/readers/tga.c: Likewise.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/priority_queue_unit_test.cc: New test.
|
||||
|
||||
2013-05-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/font/font.c: Use grub_dprintf for debug statements rather
|
||||
than printf.
|
||||
|
||||
2013-05-06 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
Reimplement grub-reboot to not depend on saved_entry. Use next_entry
|
||||
variable for one time boot menu entry.
|
||||
|
||||
2013-05-05 Bean <bean123ch@gmail.com>
|
||||
|
||||
* grub-core/commands/testspeed.c: New command testspeed.
|
||||
|
||||
2013-05-05 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Factor-out human-size printing.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Agglomerate more mallocs to speed-up gfxterm.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Speed-up gfxterm by slightly agglomerating mallocs.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
More video checks.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Speed-up gfxterm by saving intermediate results in index+alpha
|
||||
format.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/tests/lib/functional_test.c: Don't stop on first failed
|
||||
test.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/menu_text.c (menu_clear_timeout): Clear second
|
||||
line of timeout as it may contain the rest of long line.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/main.c: Fix freed memory dereference.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix several memory leaks.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/menu.c (run_menu): Fix timeout reference point.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/gettext/gettext.c: Try $lang.gmo as well.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix test -a and -o precedence.
|
||||
Reported by: adrian15.
|
||||
|
||||
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/font/font.c (grub_font_construct_glyph): Fix memory leak.
|
||||
|
||||
2013-05-03 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
Rename grub-core/tests/checksums.c into grub-core/tests/checksums.h
|
||||
and add it as source to functional_test module.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/tests/video_checksum.c: Don't set GENERATE_MODE.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
New series of tests for gfxterm and gfxmenu.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/gfxmenu/gfxmenu.c (grub_gfxmenu_try): Allow specifying
|
||||
the theme path relative to $prefix/themes.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/video/fb/fbblit.c (grub_video_fbblit_blend_BGR888_RGBA8888):
|
||||
Fix order bug.
|
||||
(grub_video_fbblit_blend_RGB888_RGBA8888): Likewise.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/gui.h (grub_gfxmenu_timeout_unregister): Free cb
|
||||
descriptor.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/gfxmenu/view.c (grub_gfxmenu_view_new): Clear
|
||||
grub_gfxmenu_timeout_notifications.
|
||||
(grub_gfxmenu_view_destroy): Likewise.
|
||||
|
||||
2013-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/term.c (print_ucs4_real): Fix startwidth in dry run.
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Several fixes to ieee1275 and big-endian video.
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add missing exports on mips.
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/tests/videotest_checksum.c (videotest_checksum): Error out
|
||||
if no unifont is found.
|
||||
Restore original keyboard.
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/i386/linux.c (grub_linux_setup_video): Add
|
||||
GRUB_VIDEO_ADAPTER_CAPTURE: to handled drived ids.
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
First automated video test (running videotest and comparing results)
|
||||
|
||||
2013-05-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/videotest.c: Reduce flickering and draw 6 squares
|
||||
instead of 2 to have full RGB/CMY test pattern.
|
||||
|
||||
2013-04-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add few more tests.
|
||||
|
||||
2013-04-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/arc/arc.h: Account for missing "other" peripheral on
|
||||
ARCS. All users updated.
|
||||
|
||||
2013-04-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/mips/loongson/init.c: Support halt for loongson 2E.
|
||||
|
||||
2013-04-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/partmap/amiga.c: Fix size of checksummed block.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Use -mcmodel=large on x86_64-emu as well.
|
||||
Reported by: qwertial.
|
||||
|
||||
2013-04-29 Vladimir Testov <vladimir.testov@rosalab.ru>
|
||||
|
||||
* grub-core/gfxmenu/circular_progress.c: Set start_angle in degrees
|
||||
with syntax "XXX deg"/"XXX °".
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make PCI init in i386-qemu port more robust.
|
||||
|
||||
2013-04-29 Vladimir Testov <vladimir.testov@rosalab.ru>
|
||||
|
||||
* grub-core/gfxmenu/gui_list.c: Refresh first_shown_entry value when
|
||||
cached view is reused.
|
||||
* grub-core/gfxmenu/view.c: Call the refresh procedure for all
|
||||
open boot menus.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Unify more code in grub-install_header.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add few new tests.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Enforce disabling of firmware disk drivers when native drivers kick in.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/nativedisk.c: Customize the list of modules on
|
||||
platform. Don't try to search for disks already using native drivers.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/bus/usb/uhci.c: Fix DMA handling and enable on all PCI
|
||||
platforms.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/script/execute.c (grub_script_arglist_to_argv): Fix
|
||||
handling of variables containing backslash.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/list.h (FOR_LIST_ELEMENTS_SAFE):Fix a NULL pointer
|
||||
dereference.
|
||||
Reported by: qwertial.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/mips/arc/init.c: Fix prefix detection.
|
||||
|
||||
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/arg.c (grub_arg_show_help): Fix a NULL pointer
|
||||
dereference.
|
||||
Reported by: qwertial.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* docs/grub.texi: Add a comment about usefullness of nativedisk.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/nativedisk.c: Ignore unknown filesystem error.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
New command `nativedisk'.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/io/lzopio.c: Use GRUB_PROPERLY_ALIGNED_ARRAY.
|
||||
* grub-core/loader/i386/bsd.c: Likewise.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/ahci.c: Fix compilation for amd64 (format warnings).
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* include/grub/efi/api.h (GRUB_EFI_DEVICE_PATH_LENGTH): Use
|
||||
grub_get_unaligned16 rather than shifts.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/file.c: Use const char * rather than casting to
|
||||
non-const.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/probe.c: Add missing grub_device_close.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* INSTALL: Document linguas.sh.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Remove POTFILES.in and regenerate it in autogen.sh.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Move --directory/--override-directorry to grub-install_header and unify.
|
||||
|
||||
2013-04-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/morse.c: Macroify dih and dah.
|
||||
|
||||
2013-04-27 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
||||
|
||||
* include/grub/macho.h: Set GRUB_MACHO_FAT_EFI_MAGIC as unsigned.
|
||||
|
||||
2013-04-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/ns8250.c: Systematically probe ports by writing
|
||||
to SR before using them.
|
||||
|
||||
2013-04-27 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
||||
|
||||
* util/ieee1275/ofpath.c (of_path_of_scsi): Fix path output for sas
|
||||
disks.
|
||||
(check_sas): Get sas_adress info.
|
||||
|
||||
2013-04-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/ahci.c (grub_ahci_pciinit): Fix handling of empty
|
||||
ports.
|
||||
|
||||
2013-04-27 Leon Drugi <eyak>
|
||||
|
||||
* grub-core/loader/multiboot_mbi2.c (grub_multiboot_load): Fix cast in
|
||||
BSS clearing.
|
||||
|
||||
2013-04-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Core compression test.
|
||||
|
||||
2013-04-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Implement grub_machine_get_bootlocation for ARC.
|
||||
|
||||
2013-04-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Improve AHCI detection and command issuing.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix pseries test.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make 'make check' work on emu.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Replace libcurses with our own vt100 handling for the ease of testing
|
||||
and decreasing prerequisites.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/Makefile.core.def: Fix grub-emu and grub-emu-lite sources.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/getroot.c (exec_pipe): Put proper #if's so that its users don't
|
||||
compile when not needed.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/pseries_test.in: New test.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add test to check that different boot mediums work.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Rename i386-ieee1275 core image due to
|
||||
ofw limited ISO support.
|
||||
|
||||
2013-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* configure.ac: Fix loongson conditional.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Enable mipsel-arc.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add serial on ARC platform.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/boot/powerpc/bootinfo.txt.in: Missing update from previous
|
||||
commit.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/partmap_test.in: Add missing double semicolon.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Fix loongson filename.
|
||||
|
||||
2013-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Move all files that don't have a location
|
||||
set in stone under /boot/grub. Use ISO hard links rather than copies
|
||||
to save some space.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/ieee1275/console.c (grub_console_dimensions): Ignore
|
||||
bogus SLOF values.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Make check work on mips-arc.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Alias sashARCS as sash.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/arc/console.c: Assume that console is 80x24 vt100 if
|
||||
it's serial.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-install.in: Fix target fo qemu_mips.
|
||||
Fix extension on EFI.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/menu_text.c (print_entry): Put an asterisk
|
||||
in front of chosen entry to mark it even if highlighting is lost.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/i386/linux.c (grub_linux_boot): Default to
|
||||
gfxpayload=keep if cbfb is active.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/ata.c (grub_ata_real_open): Use grub_error properly.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add missing video ids to coreboot and ieee1275 video.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Add mips-arc support.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/dl.c (grub_dl_resolve_symbols): Handle malloc failure.
|
||||
|
||||
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Move mips-arc link address. Previous link address was chosen
|
||||
in belief that RAM on SGI platforms grows down while in fact it
|
||||
grows up from an unusual base.
|
||||
|
||||
2013-04-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/arc/arcdisk.c (grub_arcdisk_iterate_iter):
|
||||
Fix a type which prevented CD-ROM and floppy boot.
|
||||
|
||||
2013-04-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Support coreboot framebuffer.
|
||||
|
||||
* grub-core/video/i386/coreboot/cbfb.c: New file.
|
||||
|
||||
2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/mm.c (grub_mm_init_region): Fix condition for
|
||||
detecting too small regions.
|
||||
|
||||
2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/Makefile.core.def (legacycfg): Enable on EFI.
|
||||
|
||||
2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/efi/relocator.c (grub_relocator_firmware_alloc_region):
|
||||
Remove dprintf.
|
||||
* grub-core/lib/relocator.c (malloc_in_range): Likewise.
|
||||
|
||||
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/ieee1275/init.c (grub_claim_heap): Improve handling
|
||||
of GRUB_IEEE1275_FLAG_FORCE_CLAIM.
|
||||
* grub-core/loader/powerpc/ieee1275/linux.c
|
||||
(grub_linux_claimmap_iterate): Handle GRUB_IEEE1275_FLAG_FORCE_CLAIM.
|
||||
|
||||
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options):
|
||||
Look for /boot-rom as well as /rom/boot-rom.
|
||||
|
||||
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/videotest.c (grub_cmd_videotest): Fix error
|
||||
handling when creating text_layer failed.
|
||||
* grub-core/video/video.c (grub_video_create_render_target):
|
||||
Set result to 0 on error.
|
||||
(grub_video_delete_render_target): Do not dereference NULL.
|
||||
|
||||
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/elfXX.c (grub_elfXX_load): Handle
|
||||
GRUB_ELF_LOAD_FLAGS_30BITS and GRUB_ELF_LOAD_FLAGS_62BITS.
|
||||
* grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_load32),
|
||||
(grub_linux_load64): Mask out 2 high bits.
|
||||
|
||||
2013-04-19 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* util/grub.d/30_os-prober.in: Add onstr to linux entries in one
|
||||
more place.
|
||||
|
||||
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add support for pseries and other bootinfo machines to grub-mkrescue.
|
||||
|
||||
Tested by: Paulo Flabiano Smorigo.
|
||||
|
||||
2013-04-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Add GPT for EFI boot.
|
||||
|
||||
2013-04-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/efi/efidisk.c: Detect floppies by ACPI ID.
|
||||
It improves performance in qemu.
|
||||
|
||||
2013-04-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* build-aux/snippet: Add missing gnulib files.
|
||||
|
||||
2013-04-16 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* grub-core/disk/efi/efidisk.c: Really limit transfer chunk size.
|
||||
|
||||
2013-04-16 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* autogen.sh: Use "-f" in addition for "-h" when checking file presence.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
2013-04-15 Peter Jones <pjones@redhat.com>
|
||||
|
||||
* grub-core/disk/efi/efidisk.c: Limit disk read or write chunk to 0x500
|
||||
sectors.
|
||||
Based on patch by Peter Jones.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix DMRAID partition handling.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/grub_cmd_date.in: Skip on sparc64.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/grub_script_expansion.in: Use fixed-string grep to skip over
|
||||
firmware error messages.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/ieee1275/openfw.c (grub_ieee1275_devalias_next): Make
|
||||
source and destination differ.
|
||||
|
||||
2013-04-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/ieee1275/ofdisk.c: Fix CD-ROM and boot device
|
||||
detection.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/lib/posix_wrap/sys/types.h: Make WORDS_BIGENDIAN definition
|
||||
match config-util.h to avoid warnings and increase compatibility.
|
||||
|
||||
2013-04-14 Szymon Janc <szymon@janc.net.pl>
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Add option to compress files on install/image creation.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* docs/grub-dev.texi: Rearrange menu to match the section order.
|
||||
Reported by: Bryan Hundven.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/i386/linux.c: Remove useless leftover pointer.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Move GRUB out of system area when using xorriso 1.2.9 or later.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/grub_cmd_date.in: Add missing exit 1.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/partmap_test.in: Skip on sparc64.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Support grub-shell on sparc64.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Support mkrescue on sparc64.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Allow IEEE1275 ports on path even if it wasn't detected automatically.
|
||||
Needed on OpenBIOS due to incomplete device tree.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/ieee1275/ofdisk.c: Iterate over bootpath even if it
|
||||
would be otherwise excluded.
|
||||
|
||||
2013-04-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options):
|
||||
Inline name defines used only once.
|
||||
|
||||
2013-04-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix memory leaks in ofnet.
|
||||
Reported by: Francesco Lavra.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* docs/man/grub-glue-efi.h2m: Add missing file.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkrescue.in: Fix wrong architecture for ppc dir.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Better support Apple Intel Macs on CD.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Replace stpcpy with grub_stpcpy in tools.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Handle Japanese special keys.
|
||||
Reported by: Hiroyuki YAMAMORI.
|
||||
Codes supplied by: Hiroyuki YAMAMORI.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mkimage.c: Document memdisk implying --prefix.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/bus/usb/ehci.c (grub_ehci_fini_hw): Ignore errors, not
|
||||
much we can do about it anyway.
|
||||
|
||||
2013-04-12 Aleš Nesrsta <starous@volny.cz>
|
||||
|
||||
Fix handling of split transfers.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/net/http.c: Fix bad free.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/net/drivers/ieee1275/ofnet.c: Don't attempt to send more
|
||||
than buffer size.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Disable partmap check on i386-ieee1275 due to openfirmware issues.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/util/grub-shell.in: Fix it on powerpc.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Turn off QEMU ACPI-way since new releases don't have shutdown port
|
||||
anymore.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* docs/grub.texi: Update coreboot status info.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/grub_cmd_date.in: New test for datetime.
|
||||
|
||||
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* tests/partmap_test.in: Fix missing qemudisk setting.
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Support i386-ieee1275 grub-mkrescue and make check on it.
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Merge powerpc grub-mkrescue flavour with common. Use xorriso HFS+
|
||||
feature for it.
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* docs/grub.texi: Fix description of GRUB_CMDLINE_XEN and
|
||||
GRUB_CMDLINE_XEN_DEFAULT.
|
||||
Reported by: Marc Warne (GigaTux) <gigatux>
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Import new gnulib.
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Use ACPI shutdown intests as traditional port was removed.
|
||||
|
||||
2013-04-11 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* util/grub.d/30_os-prober.in: Add onstr to entries for visual
|
||||
distinction.
|
||||
|
||||
2013-04-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix missing PVs if they don't contain "interesting" LV. Closes #38677.
|
||||
Fix few warining messages and leaks while on it.
|
||||
|
||||
2013-04-09 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* autogen.sh: Use "-h", not "-f", to test for existence of symbolic
|
||||
links under grub-core/lib/libgcrypt-grub/mpi.
|
||||
|
||||
2013-04-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix ia64-efi image generation on big-endian machines. Deduplicate
|
||||
some code while on it.
|
||||
Reported by: Leif Lindholm.
|
||||
|
||||
2013-04-08 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* grub-core/Makefile.core.def: Add kern/elfXX.c to elf module
|
||||
as extra_dist.
|
||||
|
||||
2013-04-08 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
* grub-core/term/i386/pc/console.c: Fix cursor moving algorithm.
|
||||
|
||||
2013-04-08 Bryan Hundven <bryanhundven@gmail.com>
|
||||
|
||||
* docs/grub-dev.texi: Move @itemize after @subsection to satisfy
|
||||
texinfo-5.1.
|
||||
|
||||
2013-04-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/term.c: Few more fixes for menu entry editor
|
||||
rendering.
|
||||
Reported by: Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
2013-04-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/term.c: Few more fixes for menu entry editor
|
||||
|
|
27
INSTALL
27
INSTALL
|
@ -23,11 +23,11 @@ On GNU/Linux, you also need:
|
|||
|
||||
* libdevmapper 1.02.34 or later (recommended)
|
||||
|
||||
To build grub-emu, you need:
|
||||
For optional grub-emu features, you need:
|
||||
|
||||
* ncurses
|
||||
* libusb (recommended)
|
||||
* SDL (recommended)
|
||||
* libpciaccess (optional)
|
||||
* libusb (optional)
|
||||
|
||||
To build GRUB's graphical terminal (gfxterm), you need:
|
||||
|
||||
|
@ -45,7 +45,7 @@ need the following.
|
|||
Prerequisites for make-check:
|
||||
|
||||
* qemu, specifically the binary 'qemu-system-i386'
|
||||
* xorriso, for grub-mkrescue and grub-shell
|
||||
* xorriso 1.2.9 or later, for grub-mkrescue and grub-shell
|
||||
|
||||
Configuring the GRUB
|
||||
====================
|
||||
|
@ -76,9 +76,14 @@ Building the GRUB
|
|||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code. If
|
||||
you don't use a release tarball you have to type `./autogen.sh'.
|
||||
Type `./configure' to configure the package for your system.
|
||||
1. `cd' to the directory containing the package's source code.
|
||||
|
||||
2. Skip this and following step if you use release tarball and proceed to
|
||||
step 4. If you want translations type `./linguas.sh'.
|
||||
|
||||
3. Type `./autogen.sh'.
|
||||
|
||||
4. Type `./configure' to configure the package for your system.
|
||||
If you're using `csh' on an old version of System V, you might
|
||||
need to type `sh ./configure' instead to prevent `csh' from trying
|
||||
to execute `configure' itself.
|
||||
|
@ -86,15 +91,15 @@ The simplest way to compile this package is:
|
|||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
6. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
7. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
8. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
9. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
|
|
73
Makefile.am
73
Makefile.am
|
@ -153,10 +153,10 @@ if COND_x86_64_efi
|
|||
QEMU32=qemu-system-x86_64
|
||||
endif
|
||||
|
||||
linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S
|
||||
linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S
|
||||
linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.mips: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
|
@ -171,46 +171,46 @@ linux.init.mipsel: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
|||
linux.init.loongson: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1
|
||||
|
||||
multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.aout: kfreebsd.elf
|
||||
$(OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id -R .note.gnu.gold-version
|
||||
|
||||
pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
|
||||
pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32
|
||||
|
||||
pc-chainloader.bin: pc-chainloader.elf
|
||||
$(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
|
||||
ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32
|
||||
|
||||
ntldr.bin: ntldr.elf
|
||||
$(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1
|
||||
|
||||
kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S
|
||||
kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S
|
||||
kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
|
||||
knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_NETBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
|
||||
kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
|
||||
knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
|
||||
kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux-initramfs.mips: linux.init.mips Makefile
|
||||
|
@ -261,70 +261,70 @@ kfreebsd-mfsroot.i386.gz: kfreebsd-mfsroot.i386.img
|
|||
gzip < $< > $@
|
||||
|
||||
bootcheck-kfreebsd-i386: kfreebsd-mfsroot.i386.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.i386 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
kfreebsd-mfsroot.x86_64.gz: kfreebsd-mfsroot.x86_64.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-kfreebsd-x86_64: kfreebsd-mfsroot.x86_64.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
knetbsd.miniroot-image.i386.gz: knetbsd.miniroot-image.i386.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-knetbsd-i386: knetbsd.miniroot-image.i386.gz $(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kopenbsd-i386: kopenbsd.image.i386 $(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kopenbsd-x86_64: kopenbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
knetbsd.miniroot-image.x86_64.gz: knetbsd.miniroot-image.x86_64.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-knetbsd-x86_64: knetbsd.miniroot-image.x86_64.gz $(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-mips: linux-initramfs.mips $(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-ppc: linux-initramfs.ppc $(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-mipsel: linux-initramfs.mipsel $(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-loongson: linux-initramfs.loongson $(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux16-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux16-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-multiboot: multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-multiboot2: multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kfreebsd-aout: kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-pc-chainloader: pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
if COND_i386_efi
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386
|
||||
|
@ -335,18 +335,17 @@ BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-
|
|||
endif
|
||||
|
||||
if COND_i386_multiboot
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
# FreeBSD requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
if COND_i386_coreboot
|
||||
# 64-bit NetBSD crashes because memory at 0-0x1000 is occupied
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64
|
||||
# Freebsd requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
if COND_i386_qemu
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
# FreeBSD requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
|
|
|
@ -59,6 +59,18 @@ library = {
|
|||
common = grub-core/disk/mdraid1x_linux.c;
|
||||
common = grub-core/disk/raid5_recover.c;
|
||||
common = grub-core/disk/raid6_recover.c;
|
||||
common = grub-core/font/font.c;
|
||||
common = grub-core/gfxmenu/font.c;
|
||||
common = grub-core/normal/charset.c;
|
||||
common = grub-core/video/fb/fbblit.c;
|
||||
common = grub-core/video/fb/fbutil.c;
|
||||
common = grub-core/video/fb/fbfill.c;
|
||||
common = grub-core/video/fb/video_fb.c;
|
||||
common = grub-core/video/video.c;
|
||||
common = grub-core/video/capture.c;
|
||||
common = grub-core/video/colors.c;
|
||||
common = grub-core/unidata.c;
|
||||
common = grub-core/io/bufio.c;
|
||||
common = grub-core/fs/affs.c;
|
||||
common = grub-core/fs/afs.c;
|
||||
common = grub-core/fs/bfs.c;
|
||||
|
@ -73,6 +85,7 @@ library = {
|
|||
common = grub-core/fs/fshelp.c;
|
||||
common = grub-core/fs/hfs.c;
|
||||
common = grub-core/fs/hfsplus.c;
|
||||
common = grub-core/fs/hfspluscomp.c;
|
||||
common = grub-core/fs/iso9660.c;
|
||||
common = grub-core/fs/jfs.c;
|
||||
common = grub-core/fs/minix.c;
|
||||
|
@ -453,25 +466,9 @@ script = {
|
|||
script = {
|
||||
mansection = 1;
|
||||
name = grub-mkrescue;
|
||||
x86 = util/grub-install_header;
|
||||
x86 = util/grub-mkrescue.in;
|
||||
mips_qemu_mips = util/grub-install_header;
|
||||
mips_qemu_mips = util/grub-mkrescue.in;
|
||||
mips_loongson = util/grub-install_header;
|
||||
mips_loongson = util/grub-mkrescue.in;
|
||||
ia64_efi = util/grub-install_header;
|
||||
ia64_efi = util/grub-mkrescue.in;
|
||||
powerpc_ieee1275 = util/powerpc/ieee1275/grub-mkrescue.in;
|
||||
enable = i386_pc;
|
||||
enable = i386_efi;
|
||||
enable = x86_64_efi;
|
||||
enable = i386_qemu;
|
||||
enable = i386_multiboot;
|
||||
enable = i386_coreboot;
|
||||
enable = mips_qemu_mips;
|
||||
enable = mips_loongson;
|
||||
enable = ia64_efi;
|
||||
enable = powerpc_ieee1275;
|
||||
common = util/grub-install_header;
|
||||
common = util/grub-mkrescue.in;
|
||||
enable = noemu;
|
||||
};
|
||||
|
||||
script = {
|
||||
|
@ -551,12 +548,54 @@ script = {
|
|||
common = tests/example_scripted_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = gettext_strings_test;
|
||||
common = tests/gettext_strings_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = pata_test;
|
||||
common = tests/pata_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ahci_test;
|
||||
common = tests/ahci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = uhci_test;
|
||||
common = tests/uhci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ohci_test;
|
||||
common = tests/ohci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ehci_test;
|
||||
common = tests/ehci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = example_grub_script_test;
|
||||
common = tests/example_grub_script_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_test;
|
||||
common = tests/grub_script_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_echo1;
|
||||
|
@ -671,6 +710,24 @@ script = {
|
|||
common = tests/grub_cmd_regexp.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_date;
|
||||
common = tests/grub_cmd_date.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_set_date;
|
||||
common = tests/grub_cmd_set_date.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_sleep;
|
||||
common = tests/grub_cmd_sleep.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_expansion;
|
||||
|
@ -689,24 +746,96 @@ script = {
|
|||
common = tests/partmap_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = hddboot_test;
|
||||
common = tests/hddboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = fddboot_test;
|
||||
common = tests/fddboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = cdboot_test;
|
||||
common = tests/cdboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = netboot_test;
|
||||
common = tests/netboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = pseries_test;
|
||||
common = tests/pseries_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = core_compress_test;
|
||||
common = tests/core_compress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = xzcompress_test;
|
||||
common = tests/xzcompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = gzcompress_test;
|
||||
common = tests/gzcompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = lzocompress_test;
|
||||
common = tests/lzocompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_echo;
|
||||
common = tests/grub_cmd_echo.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = help_test;
|
||||
common = tests/help_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_gettext;
|
||||
common = tests/grub_script_gettext.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_escape_comma;
|
||||
common = tests/grub_script_escape_comma.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_strcmp;
|
||||
common = tests/grub_script_strcmp.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_func_test;
|
||||
common = tests/grub_func_test.in;
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = example_unit_test;
|
||||
|
@ -737,6 +866,23 @@ program = {
|
|||
ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = priority_queue_unit_test;
|
||||
common = tests/priority_queue_unit_test.cc;
|
||||
common = tests/lib/unit_test.c;
|
||||
common = grub-core/kern/list.c;
|
||||
common = grub-core/kern/misc.c;
|
||||
common = grub-core/tests/lib/test.c;
|
||||
common = grub-core/lib/priority_queue.c;
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
condition = COND_HAVE_CXX;
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = cmp_test;
|
||||
|
@ -765,3 +911,33 @@ program = {
|
|||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-glue-efi;
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-glue-efi.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-render-label;
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-render-label.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
|
|
@ -6,6 +6,9 @@ export LC_CTYPE=C
|
|||
export LC_COLLATE=C
|
||||
unset LC_ALL
|
||||
|
||||
find . -iname '*.[ch]' -not -ipath './grub-core/lib/libgcrypt-grub/*' -not -ipath './build-aux/*' -not -ipath './grub-core/lib/libgcrypt/src/misc.c' -not -ipath './grub-core/lib/libgcrypt/src/global.c' -not -ipath './grub-core/lib/libgcrypt/src/secmem.c' |sort > po/POTFILES.in
|
||||
find util -iname '*.in' -not -name Makefile.in |sort > po/POTFILES-shell.in
|
||||
|
||||
autogen --version >/dev/null || exit 1
|
||||
|
||||
echo "Importing unicode..."
|
||||
|
@ -24,7 +27,7 @@ ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10
|
|||
cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
|
||||
|
||||
for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do
|
||||
if [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
|
||||
if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
|
||||
rm grub-core/lib/libgcrypt-grub/mpi/"$x"
|
||||
fi
|
||||
ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2006 Free Software Foundation, Inc.
|
||||
# Copyright 1996-2013 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
|
@ -25,7 +25,7 @@
|
|||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
@ -47,7 +47,7 @@ for cc_temp in $CC""; do
|
|||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
|
@ -57,14 +57,7 @@ else
|
|||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
darwin*)
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
|
@ -72,24 +65,37 @@ else
|
|||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
icc* | ecc*)
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
pgcc | pgf77 | pgf90)
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
|
@ -97,22 +103,36 @@ else
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
|
@ -121,7 +141,7 @@ else
|
|||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
|
@ -129,7 +149,7 @@ hardcode_direct=no
|
|||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
|
@ -155,22 +175,21 @@ if test "$with_gnu_ld" = yes; then
|
|||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we cannot use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
|
@ -179,7 +198,7 @@ if test "$with_gnu_ld" = yes; then
|
|||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
|
@ -189,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
|
|||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
interix3*)
|
||||
haiku*)
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
linux*)
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
|
@ -251,7 +272,7 @@ else
|
|||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
|
@ -261,7 +282,7 @@ else
|
|||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
|
@ -280,7 +301,7 @@ else
|
|||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
|
@ -316,14 +337,18 @@ else
|
|||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
|
@ -333,24 +358,15 @@ else
|
|||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if test "$GCC" = yes ; then
|
||||
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
|
@ -359,7 +375,7 @@ else
|
|||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
|
@ -411,19 +427,25 @@ else
|
|||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
|
@ -471,7 +493,7 @@ else
|
|||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
|
@ -487,34 +509,58 @@ else
|
|||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
kfreebsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
|
@ -528,10 +574,13 @@ case "$host_os" in
|
|||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix3*)
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
|
@ -548,41 +597,62 @@ case "$host_os" in
|
|||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx*)
|
||||
*nto* | *qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
tpf*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
@ -596,6 +666,12 @@ libext="$libext"
|
|||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
|
10
build-aux/snippet/_Noreturn.h
Normal file
10
build-aux/snippet/_Noreturn.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
#if !defined _Noreturn && __STDC_VERSION__ < 201112
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
|
@ -1,5 +1,5 @@
|
|||
/* A C macro for declaring that specific arguments must not be NULL.
|
||||
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
|
@ -9,7 +9,7 @@
|
|||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
@ -1,5 +1,5 @@
|
|||
/* C++ compatible function declaration macros.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
|
@ -9,7 +9,7 @@
|
|||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
@ -1,5 +1,5 @@
|
|||
/* A C macro for emitting warnings if a function is used.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
|
@ -9,7 +9,7 @@
|
|||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
@ -55,7 +55,7 @@
|
|||
rather than issue the nice warning, but the end result of informing
|
||||
the developer about their portability problem is still achieved):
|
||||
#if HAVE_RAW_DECL_ENVIRON
|
||||
static inline char ***rpl_environ (void) { return &environ; }
|
||||
static char ***rpl_environ (void) { return &environ; }
|
||||
_GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
|
||||
# undef environ
|
||||
# define environ (*rpl_environ ())
|
|
@ -44,6 +44,11 @@ endif
|
|||
|
||||
# Other options
|
||||
|
||||
if ! COND_emu
|
||||
CFLAGS_PLATFORM += -Dfloat=__grub_poision
|
||||
CFLAGS_PLATFORM += -Ddouble=__grub_poision
|
||||
endif
|
||||
|
||||
CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\"
|
||||
CPPFLAGS_DEFAULT += -I$(builddir)
|
||||
CPPFLAGS_DEFAULT += -I$(srcdir)
|
||||
|
|
|
@ -49,4 +49,6 @@
|
|||
|
||||
#define RE_ENABLE_I18N 1
|
||||
|
||||
#define __USE_GNU 1
|
||||
|
||||
#endif
|
||||
|
|
51
configure.ac
51
configure.ac
|
@ -56,6 +56,7 @@ grub_TRANSFORM([grub-install])
|
|||
grub_TRANSFORM([grub-mkconfig])
|
||||
grub_TRANSFORM([grub-mkfont])
|
||||
grub_TRANSFORM([grub-mkimage])
|
||||
grub_TRANSFORM([grub-glue-efi])
|
||||
grub_TRANSFORM([grub-mklayout])
|
||||
grub_TRANSFORM([grub-mkpasswd-pbkdf2])
|
||||
grub_TRANSFORM([grub-mkrelpath])
|
||||
|
@ -65,6 +66,7 @@ grub_TRANSFORM([grub-reboot])
|
|||
grub_TRANSFORM([grub-script-check])
|
||||
grub_TRANSFORM([grub-set-default])
|
||||
grub_TRANSFORM([grub-sparc64-setup])
|
||||
grub_TRANSFORM([grub-render-label])
|
||||
|
||||
# Optimization flag. Allow user to override.
|
||||
if test "x$TARGET_CFLAGS" = x; then
|
||||
|
@ -147,6 +149,7 @@ case "$target_cpu"-"$platform" in
|
|||
mips-qemu_mips) ;;
|
||||
mips-qemu-mips) platform=qemu_mips;;
|
||||
mips-arc) ;;
|
||||
mipsel-arc) ;;
|
||||
mipsel-qemu_mips) ;;
|
||||
mipsel-qemu-mips) platform=qemu_mips;;
|
||||
mipsel-yeeloong) platform=loongson ;;
|
||||
|
@ -204,6 +207,23 @@ else
|
|||
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
|
||||
fi
|
||||
|
||||
case "${target_cpu}-$platform" in
|
||||
mips-arc)
|
||||
TARGET_LINK_ADDR=0x88200000
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
|
||||
;;
|
||||
mipsel-arc)
|
||||
TARGET_LINK_ADDR=0x80700000
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
|
||||
;;
|
||||
mips*-qemu_mips | mips*-loongson)
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(TARGET_LINK_ADDR)
|
||||
AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
|
||||
|
||||
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
|
||||
|
||||
AC_SUBST(host_cpu)
|
||||
|
@ -308,12 +328,15 @@ AC_PATH_PROGS(MAKEINFO, makeinfo true)
|
|||
|
||||
AC_PROG_CC
|
||||
gl_EARLY
|
||||
AC_PROG_CXX
|
||||
AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
|
||||
# Must be GCC.
|
||||
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
|
||||
|
||||
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
||||
|
||||
AC_GNU_SOURCE
|
||||
AM_GNU_GETTEXT([external])
|
||||
AC_SYS_LARGEFILE
|
||||
|
@ -340,7 +363,7 @@ else
|
|||
fi
|
||||
|
||||
# Check for functions and headers.
|
||||
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
|
||||
AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
|
||||
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
|
||||
|
||||
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
|
||||
|
@ -449,7 +472,9 @@ if test "x$target_cpu" = xi386; then
|
|||
else
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
|
||||
# Some toolchains enable these features by default, but they need
|
||||
# registers that aren't set up properly in GRUB.
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
|
||||
|
@ -593,7 +618,7 @@ if test "x$target_m64" = x1; then
|
|||
TARGET_MODULE_FORMAT="elf64"
|
||||
fi
|
||||
|
||||
if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
if test "$target_cpu" = x86_64; then
|
||||
# Use large model to support 4G memory
|
||||
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
|
||||
SAVED_CFLAGS=$CFLAGS
|
||||
|
@ -607,7 +632,9 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
|
|||
else
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
# EFI writes to stack below %rsp, we must not use the red zone
|
||||
AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
|
||||
CFLAGS="$CFLAGS -m64 -mno-red-zone"
|
||||
|
@ -838,22 +865,6 @@ AC_ARG_ENABLE([grub-emu-pci],
|
|||
[build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
|
||||
|
||||
if test "$platform" = emu; then
|
||||
missing_ncurses=
|
||||
[# Check for curses libraries.]
|
||||
AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
|
||||
[AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
|
||||
[missing_ncurses=[true]])])
|
||||
AC_SUBST([LIBCURSES])
|
||||
[if [ x"$missing_ncurses" = x ]; then ]
|
||||
[# Check for headers.]
|
||||
AC_CHECK_HEADERS([ncurses/curses.h], [],
|
||||
[AC_CHECK_HEADERS([ncurses.h], [],
|
||||
[AC_CHECK_HEADERS([curses.h], [],
|
||||
[missing_ncurses=[true]])])])
|
||||
[fi]
|
||||
if test x"$missing_ncurses" = xtrue ; then
|
||||
AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
|
||||
fi
|
||||
|
||||
if test x"$enable_grub_emu_usb" != xyes ; then
|
||||
grub_emu_usb_excuse="not enabled"
|
||||
|
@ -1160,7 +1171,7 @@ AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform =
|
|||
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
|
||||
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
|
||||
AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
|
||||
AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
|
||||
AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
|
||||
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
|
||||
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
|
||||
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
|
||||
|
@ -1191,6 +1202,8 @@ AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
|
|||
AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
|
||||
AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
|
||||
|
||||
AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
|
||||
|
||||
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
|
||||
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
|
||||
AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
|
||||
|
|
|
@ -74,8 +74,8 @@ This edition documents version @value{VERSION}.
|
|||
|
||||
@menu
|
||||
* Getting the source code::
|
||||
* Finding your way around::
|
||||
* Coding style::
|
||||
* Finding your way around::
|
||||
* Contributing Changes::
|
||||
* Porting::
|
||||
* Error Handling::
|
||||
|
@ -948,8 +948,8 @@ driver manager works are not included here.
|
|||
|
||||
@menu
|
||||
* Video API::
|
||||
* Bitmap API::
|
||||
* Example usage of Video API::
|
||||
* Bitmap API::
|
||||
@end menu
|
||||
|
||||
@node Video API
|
||||
|
@ -1394,8 +1394,8 @@ grub_video_blit_glyph (&glyph, color, 0, 0);
|
|||
|
||||
@node Bitmap API
|
||||
@section Bitmap API
|
||||
@itemize
|
||||
@subsection grub_video_bitmap_create
|
||||
@itemize
|
||||
@item Prototype:
|
||||
@example
|
||||
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)
|
||||
|
|
229
docs/grub.texi
229
docs/grub.texi
|
@ -1290,9 +1290,8 @@ As @samp{GRUB_CMDLINE_LINUX}, but for GNU Mach.
|
|||
|
||||
@item GRUB_CMDLINE_XEN
|
||||
@itemx GRUB_CMDLINE_XEN_DEFAULT
|
||||
The values of these options are appended to the values of
|
||||
@samp{GRUB_CMDLINE_LINUX} and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux
|
||||
and Xen menu entries.
|
||||
The values of these options are passed to Xen hypervisor Xen menu entries,
|
||||
for all respectively normal entries.
|
||||
|
||||
@item GRUB_CMDLINE_LINUX_XEN_REPLACE
|
||||
@item GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT
|
||||
|
@ -2135,37 +2134,52 @@ this should be changed both in the prefix and in any references to the
|
|||
device name in the configuration file.
|
||||
|
||||
GRUB provides several environment variables which may be used to inspect or
|
||||
change the behaviour of the PXE device:
|
||||
change the behaviour of the PXE device. In the following description
|
||||
@var{<interface>} is placeholder for the name of network interface (platform
|
||||
dependent):
|
||||
|
||||
@table @samp
|
||||
@item net_pxe_ip
|
||||
The IP address of this machine. Read-only.
|
||||
@item net_@var{<interface>}_ip
|
||||
The network interface's IP address. Read-only.
|
||||
|
||||
@item net_pxe_mac
|
||||
@item net_@var{<interface>}_mac
|
||||
The network interface's MAC address. Read-only.
|
||||
|
||||
@item net_pxe_hostname
|
||||
@item net_@var{<interface>}_hostname
|
||||
The client host name provided by DHCP. Read-only.
|
||||
|
||||
@item net_pxe_domain
|
||||
@item net_@var{<interface>}_domain
|
||||
The client domain name provided by DHCP. Read-only.
|
||||
|
||||
@item net_pxe_rootpath
|
||||
@item net_@var{<interface>}_rootpath
|
||||
The path to the client's root disk provided by DHCP. Read-only.
|
||||
|
||||
@item net_pxe_extensionspath
|
||||
@item net_@var{<interface>}_extensionspath
|
||||
The path to additional DHCP vendor extensions provided by DHCP. Read-only.
|
||||
|
||||
@item net_pxe_boot_file
|
||||
@item net_@var{<interface>}_boot_file
|
||||
The boot file name provided by DHCP. Read-only.
|
||||
|
||||
@item net_pxe_dhcp_server_name
|
||||
@item net_@var{<interface>}_dhcp_server_name
|
||||
The name of the DHCP server responsible for these boot parameters.
|
||||
Read-only.
|
||||
|
||||
@item net_default_interface
|
||||
Initially set to name of network interface that was used to load grub.
|
||||
Read-write, although setting it affects only interpretation of
|
||||
@samp{net_default_ip} and @samp{net_default_mac}
|
||||
|
||||
@item net_default_ip
|
||||
The IP address of default interface. Read-only. This is alias for the
|
||||
@samp{net_$@{net_default_interface@}_ip}.
|
||||
|
||||
@item net_default_mac
|
||||
The default interface's MAC address. Read-only. This is alias for the
|
||||
@samp{net_$@{net_default_interface@}_mac}.
|
||||
|
||||
@item net_default_server
|
||||
The default server. Read-write, although setting this is only useful
|
||||
before opening a network device.
|
||||
The default server used by network drives (@pxref{Device syntax}). Read-write,
|
||||
although setting this is only useful before opening a network device.
|
||||
|
||||
@end table
|
||||
|
||||
|
@ -2517,8 +2531,10 @@ of the partition when installing GRUB).
|
|||
(hd0,1,3)
|
||||
@end example
|
||||
|
||||
If you enabled the network support, the special drives @samp{(tftp)},
|
||||
@samp{(http)} and so on ars also available.
|
||||
If you enabled the network support, the special drives
|
||||
@code{(@var{protocol}[,@var{server}])} are also available. Supported protocols
|
||||
are @samp{http} and @samp{tftp}. If @var{server} is omitted, value of
|
||||
environment variable @samp{net_default_server} is used.
|
||||
Before using the network drive, you must initialize the network.
|
||||
@xref{Network}, for more information.
|
||||
|
||||
|
@ -2736,14 +2752,18 @@ These variables have special meaning to GRUB.
|
|||
* locale_dir::
|
||||
* menu_color_highlight::
|
||||
* menu_color_normal::
|
||||
* net_pxe_boot_file::
|
||||
* net_pxe_dhcp_server_name::
|
||||
* net_pxe_domain::
|
||||
* net_pxe_extensionspath::
|
||||
* net_pxe_hostname::
|
||||
* net_pxe_ip::
|
||||
* net_pxe_mac::
|
||||
* net_pxe_rootpath::
|
||||
* net_@var{<interface>}_boot_file::
|
||||
* net_@var{<interface>}_dhcp_server_name::
|
||||
* net_@var{<interface>}_domain::
|
||||
* net_@var{<interface>}_extensionspath::
|
||||
* net_@var{<interface>}_hostname::
|
||||
* net_@var{<interface>}_ip::
|
||||
* net_@var{<interface>}_mac::
|
||||
* net_@var{<interface>}_rootpath::
|
||||
* net_default_interface::
|
||||
* net_default_ip::
|
||||
* net_default_mac::
|
||||
* net_default_server::
|
||||
* pager::
|
||||
* prefix::
|
||||
* pxe_blksize::
|
||||
|
@ -3010,50 +3030,74 @@ variable changes those colors. For the available color names,
|
|||
The default is the value of @samp{color_normal} (@pxref{color_normal}).
|
||||
|
||||
|
||||
@node net_pxe_boot_file
|
||||
@subsection net_pxe_boot_file
|
||||
@node net_@var{<interface>}_boot_file
|
||||
@subsection net_@var{<interface>}_boot_file
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_dhcp_server_name
|
||||
@subsection net_pxe_dhcp_server_name
|
||||
@node net_@var{<interface>}_dhcp_server_name
|
||||
@subsection net_@var{<interface>}_dhcp_server_name
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_domain
|
||||
@subsection net_pxe_domain
|
||||
@node net_@var{<interface>}_domain
|
||||
@subsection net_@var{<interface>}_domain
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_extensionspath
|
||||
@subsection net_pxe_extensionspath
|
||||
@node net_@var{<interface>}_extensionspath
|
||||
@subsection net_@var{<interface>}_extensionspath
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_hostname
|
||||
@subsection net_pxe_hostname
|
||||
@node net_@var{<interface>}_hostname
|
||||
@subsection net_@var{<interface>}_hostname
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_ip
|
||||
@subsection net_pxe_ip
|
||||
@node net_@var{<interface>}_ip
|
||||
@subsection net_@var{<interface>}_ip
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_mac
|
||||
@subsection net_pxe_mac
|
||||
@node net_@var{<interface>}_mac
|
||||
@subsection net_@var{<interface>}_mac
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_pxe_rootpath
|
||||
@subsection net_pxe_rootpath
|
||||
@node net_@var{<interface>}_rootpath
|
||||
@subsection net_@var{<interface>}_rootpath
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_default_interface
|
||||
@subsection net_default_interface
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_default_ip
|
||||
@subsection net_default_ip
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_default_mac
|
||||
@subsection net_default_mac
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_default_server
|
||||
@subsection net_default_server
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
@ -3413,6 +3457,7 @@ you forget a command, you can run the command @command{help}
|
|||
* lsfonts:: List loaded fonts
|
||||
* lsmod:: Show loaded modules
|
||||
* md5sum:: Compute or check MD5 hash
|
||||
* nativedisk:: Switch to native disk drivers
|
||||
* normal:: Enter normal mode
|
||||
* normal_exit:: Exit from normal mode
|
||||
* parttool:: Modify partition table entries
|
||||
|
@ -4048,6 +4093,17 @@ Alias for @code{hashsum --hash md5 arg @dots{}}. See command @command{hashsum}
|
|||
@end deffn
|
||||
|
||||
|
||||
@node nativedisk
|
||||
@subsection nativedisk
|
||||
|
||||
@deffn Command nativedisk
|
||||
Switch from firmware disk drivers to native ones.
|
||||
Really useful only on platforms where both
|
||||
firmware and native disk drives are available.
|
||||
Currently i386-pc, i386-efi, i386-ieee1275 and
|
||||
x86_64-efi.
|
||||
@end deffn
|
||||
|
||||
@node normal
|
||||
@subsection normal
|
||||
|
||||
|
@ -4599,26 +4655,35 @@ On normalized ZFS subvolumes filenames out of normalisation are inaccessible.
|
|||
|
||||
@chapter Output terminal
|
||||
Firmware output console ``console'' on ARC and IEEE1275 are limited to ASCII.
|
||||
|
||||
BIOS firmware console and VGA text are limited to ASCII and some pseudographics.
|
||||
|
||||
None of above mentioned is appropriate for displaying international and any
|
||||
unsupported character is replaced with question mark except pseudographics
|
||||
which we attempt to approximate with ASCII. EFI console on the other hand
|
||||
nominally supports UTF-16 but actual language coverage depends on firmware and
|
||||
may be very limited. The encoding used on serial can be chosen with
|
||||
@command{terminfo} as either ASCII, UTF-8 or ``visual UTF-8''. Last one is
|
||||
against the specification but results in correct rendering of right-to-left
|
||||
on some readers which don't have own bidi implementation. When using gfxterm
|
||||
or gfxmenu GRUB itself is responsible for rendering the text. In this case
|
||||
GRUB is limited by loaded fonts. If fonts contain all required characters
|
||||
then bidirectional text, cursive variants and combining marks other than
|
||||
enclosing, half (e.g. left half tilde or combining overline) and double ones.
|
||||
Ligatures aren't supported though. This should cover European, Middle Eastern
|
||||
(if you don't mind lack of lam-alif ligature in Arabic) and East Asian scripts.
|
||||
Notable unsupported scripts are Brahmic family and derived as well as
|
||||
Mongolian, Tifinagh, Korean Jamo (precomposed characters have no problem)
|
||||
and tonal writing (2e5-2e9). GRUB also ignores deprecated (as specified
|
||||
in Unicode) characters (e.g. tags). GRUB also doesn't handle so called
|
||||
``annotation characters'' If you can complete either of
|
||||
which we attempt to approximate with ASCII.
|
||||
|
||||
EFI console on the other hand nominally supports UTF-16 but actual language
|
||||
coverage depends on firmware and may be very limited.
|
||||
|
||||
The encoding used on serial can be chosen with @command{terminfo} as
|
||||
either ASCII, UTF-8 or ``visual UTF-8''. Last one is against the specification
|
||||
but results in correct rendering of right-to-left on some readers which don't
|
||||
have own bidi implementation.
|
||||
|
||||
On emu GRUB checks if charset is UTF-8 and uses it if so and uses ASCII
|
||||
otherwise.
|
||||
|
||||
When using gfxterm or gfxmenu GRUB itself is responsible for rendering the
|
||||
text. In this case GRUB is limited by loaded fonts. If fonts contain all
|
||||
required characters then bidirectional text, cursive variants and combining
|
||||
marks other than enclosing, half (e.g. left half tilde or combining overline)
|
||||
and double ones. Ligatures aren't supported though. This should cover European,
|
||||
Middle Eastern (if you don't mind lack of lam-alif ligature in Arabic) and
|
||||
East Asian scripts. Notable unsupported scripts are Brahmic family and
|
||||
derived as well as Mongolian, Tifinagh, Korean Jamo (precomposed characters
|
||||
have no problem) and tonal writing (2e5-2e9). GRUB also ignores deprecated
|
||||
(as specified in Unicode) characters (e.g. tags). GRUB also doesn't handle so
|
||||
called ``annotation characters'' If you can complete either of
|
||||
two lists or, better, propose a patch to improve rendering, please contact
|
||||
developer team.
|
||||
|
||||
|
@ -4742,8 +4807,7 @@ ARC platform is unable to change datetime (firmware doesn't seem to provide a
|
|||
function for it).
|
||||
EMU has similar limitation.
|
||||
|
||||
ARC platform no serial port is available.
|
||||
EMU has similar limitation.
|
||||
On EMU platform no serial port is available.
|
||||
|
||||
Console charset refers only to firmware-assisted console. gfxterm is always
|
||||
Unicode (see Internationalisation section for its limitations). Serial is
|
||||
|
@ -4760,9 +4824,6 @@ the actual console may be much more limited depending on firmware
|
|||
On BIOS network is supported only if the image is loaded through network.
|
||||
On sparc64 GRUB is unable to determine which server it was booted from.
|
||||
|
||||
On platforms not having direct serial support (as indicated in the line serial)
|
||||
you can still redirect firmware console to serial if it allows so.
|
||||
|
||||
Direct ATA/AHCI support allows to circumvent various firmware limitations but
|
||||
isn't needed for normal operation except on baremetal ports.
|
||||
|
||||
|
@ -4843,7 +4904,7 @@ and mips-qemu_mips can use only memory up to first hole.
|
|||
@multitable @columnfractions .20 .20 .20 .20 .20
|
||||
@item @tab MIPS qemu @tab emu
|
||||
@item video @tab no @tab yes
|
||||
@item console charset @tab CP437 @tab ASCII
|
||||
@item console charset @tab CP437 @tab Unicode (*)
|
||||
@item network @tab no @tab yes
|
||||
@item ATA/AHCI @tab yes @tab no
|
||||
@item AT keyboard @tab yes @tab no
|
||||
|
@ -4873,6 +4934,7 @@ Information retrieval:
|
|||
@item mips-arc: lsdev
|
||||
@item efi: lsefisystab, lssal, lsefimmap
|
||||
@item i386-pc: lsapm
|
||||
@item i386-coreboot: lscoreboot, coreboot_boottime
|
||||
@item acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi
|
||||
@end itemize
|
||||
|
||||
|
@ -4908,10 +4970,10 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item Plan9 @tab yes @tab no (1)
|
||||
@item Freedos @tab yes @tab no (1)
|
||||
@item FreeBSD bootloader @tab yes @tab crashes (1)
|
||||
@item 32-bit kFreeBSD @tab yes @tab crashes (2,6)
|
||||
@item 64-bit kFreeBSD @tab yes @tab crashes (2,6)
|
||||
@item 32-bit kFreeBSD @tab yes @tab crashes (5)
|
||||
@item 64-bit kFreeBSD @tab yes @tab crashes (5)
|
||||
@item 32-bit kNetBSD @tab yes @tab crashes (1)
|
||||
@item 64-bit kNetBSD @tab yes @tab crashes (2)
|
||||
@item 64-bit kNetBSD @tab yes @tab crashes
|
||||
@item 32-bit kOpenBSD @tab yes @tab yes
|
||||
@item 64-bit kOpenBSD @tab yes @tab yes
|
||||
@item Multiboot @tab yes @tab yes
|
||||
|
@ -4922,9 +4984,9 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item 64-bit Linux (modern protocol) @tab yes @tab yes
|
||||
@item 32-bit XNU @tab yes @tab ?
|
||||
@item 64-bit XNU @tab yes @tab ?
|
||||
@item 32-bit EFI chainloader @tab no (3) @tab no (3)
|
||||
@item 64-bit EFI chainloader @tab no (3) @tab no (3)
|
||||
@item Appleloader @tab no (3) @tab no (3)
|
||||
@item 32-bit EFI chainloader @tab no (2) @tab no (2)
|
||||
@item 64-bit EFI chainloader @tab no (2) @tab no (2)
|
||||
@item Appleloader @tab no (2) @tab no (2)
|
||||
@end multitable
|
||||
|
||||
@multitable @columnfractions .50 .22 .22
|
||||
|
@ -4934,8 +4996,8 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item Plan9 @tab no (1) @tab no (1)
|
||||
@item FreeDOS @tab no (1) @tab no (1)
|
||||
@item FreeBSD bootloader @tab crashes (1) @tab crashes (1)
|
||||
@item 32-bit kFreeBSD @tab crashes (6) @tab crashes (6)
|
||||
@item 64-bit kFreeBSD @tab crashes (6) @tab crashes (6)
|
||||
@item 32-bit kFreeBSD @tab crashes (5) @tab crashes (5)
|
||||
@item 64-bit kFreeBSD @tab crashes (5) @tab crashes (5)
|
||||
@item 32-bit kNetBSD @tab crashes (1) @tab crashes (1)
|
||||
@item 64-bit kNetBSD @tab yes @tab yes
|
||||
@item 32-bit kOpenBSD @tab yes @tab yes
|
||||
|
@ -4948,9 +5010,9 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item 64-bit Linux (modern protocol) @tab yes @tab yes
|
||||
@item 32-bit XNU @tab ? @tab ?
|
||||
@item 64-bit XNU @tab ? @tab ?
|
||||
@item 32-bit EFI chainloader @tab no (3) @tab no (3)
|
||||
@item 64-bit EFI chainloader @tab no (3) @tab no (3)
|
||||
@item Appleloader @tab no (3) @tab no (3)
|
||||
@item 32-bit EFI chainloader @tab no (2) @tab no (2)
|
||||
@item 64-bit EFI chainloader @tab no (2) @tab no (2)
|
||||
@item Appleloader @tab no (2) @tab no (2)
|
||||
@end multitable
|
||||
|
||||
@multitable @columnfractions .50 .22 .22
|
||||
|
@ -4973,9 +5035,9 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item 32-bit Linux (modern protocol) @tab yes @tab yes
|
||||
@item 64-bit Linux (modern protocol) @tab yes @tab yes
|
||||
@item 32-bit XNU @tab yes @tab yes
|
||||
@item 64-bit XNU @tab yes (5) @tab yes
|
||||
@item 32-bit EFI chainloader @tab yes @tab no (4)
|
||||
@item 64-bit EFI chainloader @tab no (4) @tab yes
|
||||
@item 64-bit XNU @tab yes (4) @tab yes
|
||||
@item 32-bit EFI chainloader @tab yes @tab no (3)
|
||||
@item 64-bit EFI chainloader @tab no (3) @tab yes
|
||||
@item Appleloader @tab yes @tab yes
|
||||
@end multitable
|
||||
|
||||
|
@ -4986,8 +5048,8 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item Plan9 @tab no (1)
|
||||
@item FreeDOS @tab no (1)
|
||||
@item FreeBSD bootloader @tab crashes (1)
|
||||
@item 32-bit kFreeBSD @tab crashes (6)
|
||||
@item 64-bit kFreeBSD @tab crashes (6)
|
||||
@item 32-bit kFreeBSD @tab crashes (5)
|
||||
@item 64-bit kFreeBSD @tab crashes (5)
|
||||
@item 32-bit kNetBSD @tab crashes (1)
|
||||
@item 64-bit kNetBSD @tab ?
|
||||
@item 32-bit kOpenBSD @tab ?
|
||||
|
@ -5000,14 +5062,13 @@ X86 support is summarised in the following table. ``Yes'' means that the kernel
|
|||
@item 64-bit Linux (modern protocol) @tab ?
|
||||
@item 32-bit XNU @tab ?
|
||||
@item 64-bit XNU @tab ?
|
||||
@item 32-bit EFI chainloader @tab no (3)
|
||||
@item 64-bit EFI chainloader @tab no (3)
|
||||
@item Appleloader @tab no (3)
|
||||
@item 32-bit EFI chainloader @tab no (2)
|
||||
@item 64-bit EFI chainloader @tab no (2)
|
||||
@item Appleloader @tab no (2)
|
||||
@end multitable
|
||||
|
||||
@enumerate
|
||||
@item Requires BIOS
|
||||
@item Crashes because the memory at 0x0-0x1000 isn't available
|
||||
@item EFI only
|
||||
@item 32-bit and 64-bit EFI have different structures and work in different CPU modes so it's not possible to chainload 32-bit bootloader on 64-bit platform and vice-versa
|
||||
@item Some modules may need to be disabled
|
||||
|
|
4
docs/man/grub-glue-efi.h2m
Normal file
4
docs/man/grub-glue-efi.h2m
Normal file
|
@ -0,0 +1,4 @@
|
|||
[NAME]
|
||||
grub-glue-efi \- generate a fat binary for EFI
|
||||
[DESCRIPTION]
|
||||
grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format.
|
3
docs/man/grub-render-label.h2m
Normal file
3
docs/man/grub-render-label.h2m
Normal file
|
@ -0,0 +1,3 @@
|
|||
[NAME]
|
||||
grub-render-label \- generate a .disk_label for Apple Macs.
|
||||
|
|
@ -59,7 +59,7 @@ GROUPS["videomodules"] = GRUB_PLATFORMS[:];
|
|||
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
|
||||
|
||||
# Similar for terminfo
|
||||
GROUPS["terminfoinkernel"] = ["mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"] + GROUPS["uboot"];
|
||||
GROUPS["terminfoinkernel"] = [ "emu", "mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"] + GROUPS["uboot"];
|
||||
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
|
||||
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ endif
|
|||
if COND_mips_arc
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arc/arc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
||||
endif
|
||||
|
||||
if COND_mips_qemu_mips
|
||||
|
@ -159,6 +160,7 @@ KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
|||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
|
||||
|
@ -177,6 +179,7 @@ KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.h
|
|||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
|
||||
|
@ -228,6 +231,7 @@ if COND_emu
|
|||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/datetime.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/misc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/export.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
if COND_GRUB_EMU_SDL
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h
|
||||
endif
|
||||
|
|
|
@ -30,6 +30,20 @@ script = {
|
|||
common = gdb_grub.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
installdir = platform;
|
||||
name = grub.chrp;
|
||||
common = boot/powerpc/grub.chrp.in;
|
||||
enable = powerpc_ieee1275;
|
||||
};
|
||||
|
||||
script = {
|
||||
installdir = platform;
|
||||
name = bootinfo.txt;
|
||||
common = boot/powerpc/bootinfo.txt.in;
|
||||
enable = powerpc_ieee1275;
|
||||
};
|
||||
|
||||
kernel = {
|
||||
name = kernel;
|
||||
|
||||
|
@ -62,9 +76,10 @@ kernel = {
|
|||
mips_loongson_ldflags = '-Wl,-Ttext,0x80200000';
|
||||
powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
|
||||
sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400';
|
||||
mips_arc_ldflags = '-Wl,-Ttext,0x8bd00000';
|
||||
mips_arc_ldflags = '-Wl,-Ttext,$(TARGET_LINK_ADDR)';
|
||||
mips_qemu_mips_ldflags = '-Wl,-Ttext,0x80200000';
|
||||
|
||||
mips_arc_cppflags = '-DGRUB_DECOMPRESSOR_LINK_ADDR=$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
mips_loongson_cppflags = '-DUSE_ASCII_FAILBACK';
|
||||
i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||
emu_cflags = '$(CFLAGS_GNULIB)';
|
||||
|
@ -132,7 +147,9 @@ kernel = {
|
|||
|
||||
i386 = kern/i386/dl.c;
|
||||
|
||||
i386_coreboot_multiboot_qemu = kern/i386/coreboot/init.c;
|
||||
i386_coreboot = kern/i386/coreboot/init.c;
|
||||
i386_multiboot = kern/i386/coreboot/init.c;
|
||||
i386_qemu = kern/i386/qemu/init.c;
|
||||
i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
|
||||
|
||||
efi = disk/efi/efidisk.c;
|
||||
|
@ -214,7 +231,7 @@ kernel = {
|
|||
|
||||
emu = disk/host.c;
|
||||
emu = gnulib/progname.c;
|
||||
emu = gnulib/error.c;
|
||||
emu = kern/emu/error.c;
|
||||
emu = kern/emu/cache_s.S;
|
||||
emu = kern/emu/hostdisk.c;
|
||||
emu = kern/emu/hostfs.c;
|
||||
|
@ -254,9 +271,9 @@ program = {
|
|||
emu = kern/emu/full.c;
|
||||
emu_nodist = grub_emu_init.c;
|
||||
|
||||
ldadd = 'kernel.img$(EXEEXT)';
|
||||
ldadd = 'kernel.exec$(EXEEXT)';
|
||||
ldadd = '$(MODULE_FILES)';
|
||||
ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
ldadd = 'gnulib/libgnu.a $(LIBINTL) $(LIBUTIL) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
|
||||
enable = emu;
|
||||
};
|
||||
|
@ -267,8 +284,8 @@ program = {
|
|||
emu = kern/emu/lite.c;
|
||||
emu_nodist = symlist.c;
|
||||
|
||||
ldadd = 'kernel.img$(EXEEXT)';
|
||||
ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
ldadd = 'kernel.exec$(EXEEXT)';
|
||||
ldadd = 'gnulib/libgnu.a $(LIBINTL) $(LIBUTIL) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
|
||||
enable = emu;
|
||||
};
|
||||
|
@ -295,12 +312,34 @@ image = {
|
|||
enable = sparc64_ieee1275;
|
||||
};
|
||||
|
||||
image = {
|
||||
name = boot_hybrid;
|
||||
i386_pc = boot/i386/pc/boot.S;
|
||||
|
||||
cppflags = '-DHYBRID_BOOT=1';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
enable = i386_pc;
|
||||
};
|
||||
|
||||
image = {
|
||||
name = cdboot;
|
||||
|
||||
i386_pc = boot/i386/pc/cdboot.S;
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
|
||||
sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;
|
||||
sparc64_ieee1275_objcopyflags = '-O a.out-sunos-big';
|
||||
sparc64_ieee1275_ldflags = ' -Wl,-Ttext=0x4000';
|
||||
sparc64_ieee1275_cppflags = '-DCDBOOT=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
|
||||
enable = sparc64_ieee1275;
|
||||
enable = i386_pc;
|
||||
};
|
||||
|
||||
|
@ -354,9 +393,7 @@ image = {
|
|||
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
mips_loongson_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_qemu_mips_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_arc_ldflags = '-static-libgcc -Wl,-Ttext,0x8bc00000';
|
||||
mips_ldflags = '-static-libgcc -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
ldadd = '-lgcc';
|
||||
cflags = '-Wno-unreachable-code -static-libgcc';
|
||||
enable = mips;
|
||||
|
@ -370,9 +407,7 @@ image = {
|
|||
cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
mips_loongson_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_qemu_mips_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_arc_ldflags = '-static-libgcc -Wl,-Ttext,0x8bc00000';
|
||||
mips_ldflags = '-static-libgcc -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
ldadd = '-lgcc';
|
||||
cflags = '-static-libgcc';
|
||||
enable = mips;
|
||||
|
@ -469,7 +504,7 @@ module = {
|
|||
module = {
|
||||
name = uhci;
|
||||
common = bus/usb/uhci.c;
|
||||
enable = x86;
|
||||
enable = pci;
|
||||
};
|
||||
|
||||
module = {
|
||||
|
@ -494,6 +529,15 @@ module = {
|
|||
enable = i386_multiboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = nativedisk;
|
||||
common = commands/nativedisk.c;
|
||||
|
||||
enable = x86;
|
||||
enable = mips_loongson;
|
||||
enable = mips_qemu_mips;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = emupci;
|
||||
common = bus/emu/pci.c;
|
||||
|
@ -1164,6 +1208,11 @@ module = {
|
|||
common = fs/hfsplus.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = hfspluscomp;
|
||||
common = fs/hfspluscomp.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = iso9660;
|
||||
common = fs/iso9660.c;
|
||||
|
@ -1339,6 +1388,8 @@ module = {
|
|||
module = {
|
||||
name = elf;
|
||||
common = kern/elf.c;
|
||||
|
||||
extra_dist = kern/elfXX.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
|
@ -1652,10 +1703,12 @@ module = {
|
|||
common = term/serial.c;
|
||||
x86 = term/ns8250.c;
|
||||
ieee1275 = term/ieee1275/serial.c;
|
||||
mips_arc = term/arc/serial.c;
|
||||
efi = term/efi/serial.c;
|
||||
|
||||
enable = terminfomodule;
|
||||
enable = ieee1275;
|
||||
enable = mips_arc;
|
||||
};
|
||||
|
||||
module = {
|
||||
|
@ -1712,6 +1765,10 @@ module = {
|
|||
name = functional_test;
|
||||
common = tests/lib/functional_test.c;
|
||||
common = tests/lib/test.c;
|
||||
common = tests/checksums.h;
|
||||
common = tests/video_checksum.c;
|
||||
common = tests/fake_input.c;
|
||||
common = video/capture.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
|
@ -1719,6 +1776,26 @@ module = {
|
|||
common = tests/example_functional_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = setjmp_test;
|
||||
common = tests/setjmp_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = videotest_checksum;
|
||||
common = tests/videotest_checksum.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = gfxterm_menu;
|
||||
common = tests/gfxterm_menu.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cmdline_cat_test;
|
||||
common = tests/cmdline_cat_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = bitmap;
|
||||
common = video/bitmap.c;
|
||||
|
@ -1787,6 +1864,12 @@ module = {
|
|||
enable = powerpc_ieee1275;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = coreboot_fb;
|
||||
common = video/i386/coreboot/cbfb.c;
|
||||
enable = i386_coreboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = sdl;
|
||||
emu = video/emu/sdl.c;
|
||||
|
@ -1853,7 +1936,12 @@ module = {
|
|||
common = commands/legacycfg.c;
|
||||
common = lib/legacy_parse.c;
|
||||
emu = lib/i386/pc/vesa_modes_table.c;
|
||||
i386_efi = lib/i386/pc/vesa_modes_table.c;
|
||||
x86_64_efi = lib/i386/pc/vesa_modes_table.c;
|
||||
|
||||
enable = i386_pc;
|
||||
enable = i386_efi;
|
||||
enable = x86_64_efi;
|
||||
enable = emu;
|
||||
};
|
||||
|
||||
|
@ -1981,3 +2069,7 @@ module = {
|
|||
enable = i386;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = testspeed;
|
||||
common = commands/testspeed.c;
|
||||
};
|
||||
|
|
|
@ -28,6 +28,81 @@
|
|||
#define MSG(x) movw $x, %si; call LOCAL(message)
|
||||
#define ERR(x) movw $x, %si; jmp LOCAL(error_message)
|
||||
|
||||
.macro floppy
|
||||
part_start:
|
||||
|
||||
probe_values:
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
|
||||
movw $probe_values - 1, %si
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int $0x13
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
cmpb $0, %cl
|
||||
jne 1f
|
||||
|
||||
/*
|
||||
* Floppy disk probe failure.
|
||||
*/
|
||||
MSG(fd_probe_error_string)
|
||||
jmp LOCAL(general_error)
|
||||
|
||||
/* "Floppy" */
|
||||
fd_probe_error_string: .asciz "Floppy"
|
||||
|
||||
1:
|
||||
/* perform read */
|
||||
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw $0x201, %ax
|
||||
movb $0, %ch
|
||||
movb $0, %dh
|
||||
int $0x13
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb $1, %dh
|
||||
movb $79, %ch
|
||||
|
||||
jmp LOCAL(final_init)
|
||||
.endm
|
||||
|
||||
.macro scratch
|
||||
|
||||
/* scratch space */
|
||||
mode:
|
||||
.byte 0
|
||||
disk_address_packet:
|
||||
sectors:
|
||||
.long 0
|
||||
heads:
|
||||
.long 0
|
||||
cylinders:
|
||||
.word 0
|
||||
sector_start:
|
||||
.byte 0
|
||||
head_start:
|
||||
.byte 0
|
||||
cylinder_start:
|
||||
.word 0
|
||||
/* more space... */
|
||||
.endm
|
||||
|
||||
.file "boot.S"
|
||||
|
||||
.text
|
||||
|
@ -51,6 +126,34 @@ start:
|
|||
jmp LOCAL(after_BPB)
|
||||
nop /* do I care about this ??? */
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
jmp LOCAL(after_BPB)
|
||||
#else
|
||||
/*
|
||||
* This space is for the BIOS parameter block!!!! Don't change
|
||||
* the first jump, nor start the code anywhere but right after
|
||||
|
@ -59,27 +162,14 @@ start:
|
|||
|
||||
. = _start + GRUB_BOOT_MACHINE_BPB_START
|
||||
. = _start + 4
|
||||
|
||||
/* scratch space */
|
||||
mode:
|
||||
.byte 0
|
||||
disk_address_packet:
|
||||
sectors:
|
||||
.long 0
|
||||
heads:
|
||||
.long 0
|
||||
cylinders:
|
||||
.word 0
|
||||
sector_start:
|
||||
.byte 0
|
||||
head_start:
|
||||
.byte 0
|
||||
cylinder_start:
|
||||
.word 0
|
||||
/* more space... */
|
||||
#endif
|
||||
#ifdef HYBRID_BOOT
|
||||
floppy
|
||||
#else
|
||||
scratch
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BPB_END
|
||||
|
||||
/*
|
||||
* End of BIOS parameter block.
|
||||
*/
|
||||
|
@ -87,9 +177,11 @@ cylinder_start:
|
|||
kernel_address:
|
||||
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
|
||||
#ifndef HYBRID_BOOT
|
||||
. = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR
|
||||
kernel_sector:
|
||||
.long 1, 0
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE
|
||||
boot_drive:
|
||||
|
@ -410,6 +502,11 @@ LOCAL(message):
|
|||
* number here.
|
||||
*/
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
. = _start + 0x1b0
|
||||
kernel_sector:
|
||||
.long 1, 0
|
||||
#endif
|
||||
. = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
|
||||
nt_magic:
|
||||
.long 0
|
||||
|
@ -419,62 +516,17 @@ nt_magic:
|
|||
* This is where an MBR would go if on a hard disk. The code
|
||||
* here isn't even referenced unless we're on a floppy. Kinda
|
||||
* sneaky, huh?
|
||||
*/
|
||||
*/
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_PART_START
|
||||
part_start:
|
||||
|
||||
probe_values:
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
|
||||
movw $probe_values - 1, %si
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int $0x13
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
cmpb $0, %cl
|
||||
jne 1f
|
||||
|
||||
/*
|
||||
* Floppy disk probe failure.
|
||||
*/
|
||||
MSG(fd_probe_error_string)
|
||||
jmp LOCAL(general_error)
|
||||
|
||||
/* "Floppy" */
|
||||
fd_probe_error_string: .asciz "Floppy"
|
||||
|
||||
1:
|
||||
/* perform read */
|
||||
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw $0x201, %ax
|
||||
movb $0, %ch
|
||||
movb $0, %dh
|
||||
int $0x13
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb $1, %dh
|
||||
movb $79, %ch
|
||||
|
||||
jmp LOCAL(final_init)
|
||||
#ifndef HYBRID_BOOT
|
||||
floppy
|
||||
#else
|
||||
scratch
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_PART_END
|
||||
|
||||
|
||||
/* the last 2 bytes in the sector 0 contain the signature */
|
||||
.word GRUB_BOOT_MACHINE_SIGNATURE
|
||||
|
|
|
@ -93,11 +93,12 @@ LOCAL(read_cdrom):
|
|||
pushw $CDBLK_LENG
|
||||
|
||||
/* Block number. */
|
||||
incl %esi
|
||||
pushl %eax
|
||||
pushl %esi
|
||||
|
||||
/* Buffer address. */
|
||||
pushw $((DATA_ADDR - 0x400)>> 4)
|
||||
pushw $((DATA_ADDR - 0x200)>> 4)
|
||||
pushl %eax
|
||||
pushw $0x10
|
||||
|
||||
|
@ -167,6 +168,6 @@ err_noboot_msg:
|
|||
err_cdfail_msg:
|
||||
.ascii "cdrom read fails\0"
|
||||
|
||||
. = start + 0x1FF
|
||||
. = start + 0x7FF
|
||||
|
||||
.byte 0
|
||||
|
|
|
@ -196,6 +196,21 @@ do_check:
|
|||
argfw:
|
||||
not $s7, $a2
|
||||
cmdlinedone:
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
lui $t0, %hi(_start - 256)
|
||||
addiu $t0, $t0, %lo(_start - 256)
|
||||
addiu $t3, $t0, 255
|
||||
lw $t1, 0($a1)
|
||||
1:
|
||||
bne $t0, $t3, 2f
|
||||
lb $t2, 0($t1)
|
||||
move $t2, $zero
|
||||
2:
|
||||
sb $t2, 0($t0)
|
||||
addiu $t0, $t0, 1
|
||||
bnez $t2, 1b
|
||||
addiu $t1, $t1, 1
|
||||
#endif
|
||||
/* Copy the decompressor. */
|
||||
lui $t1, %hi(base)
|
||||
|
@ -253,10 +268,15 @@ cmdlinedone:
|
|||
lui $t0, %hi(EXT_C(grub_decompress_core))
|
||||
addiu $t0, $t0, %lo(EXT_C(grub_decompress_core))
|
||||
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
lui $sp, %hi(_start - 512)
|
||||
jalr $t0
|
||||
addiu $sp, $sp, %lo(_start - 512)
|
||||
#else
|
||||
lui $sp, %hi(_start - 256)
|
||||
jalr $t0
|
||||
addiu $sp, $sp, %lo(_start - 256)
|
||||
|
||||
#endif
|
||||
move $a0, $s1
|
||||
move $a1, $s6
|
||||
|
||||
|
|
73
grub-core/boot/powerpc/bootinfo.txt.in
Normal file
73
grub-core/boot/powerpc/bootinfo.txt.in
Normal file
|
@ -0,0 +1,73 @@
|
|||
<chrp-boot>
|
||||
<description>@PACKAGE@ @VERSION@</description>
|
||||
<os-name>@PACKAGE@ @VERSION@</os-name>
|
||||
<boot-script>boot &device;:\boot\grub\powerpc.elf</boot-script>
|
||||
<icon size=64,64 color-space=3,3,2>
|
||||
<bitmap>
|
||||
FF FF FF FF FF FF FF FF FF FF 92 6D 6D 6D 6D 6D 6D 6D 6D 6D DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 92 6D 92 92 92 DB FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF DB 6D 92 DB FF FF FF FF FF DB B6 FF FF 92 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 DB FF FF FF FF FF B6 6D 92 DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF 49 92 FF FF B6 B6 24 00 24 00 00 00 00 49 6D DB 6D 92 DB B6 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 6D DB 92 6D 24 49 92 6D 6D FF FF FF 92 6D FF FF FF FF FF FF
|
||||
FF FF FF FF B6 49 DB FF FF 24 00 00 00 92 92 B6 FF DB DB FF DB B6 FF DB 92 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 6D B6 FF 6D B6 6D 6D 92 24 24 00 00 24 6D FF FF 49 DB FF FF FF FF
|
||||
FF FF FF B6 49 FF DB 49 24 00 49 6D B6 FF B6 92 6D 6D 6D 92 DB DB DB B6 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB FF FF FF FF DB B6 B6 B6 FF DB 24 00 00 92 B6 FF 49 FF FF FF FF
|
||||
FF FF DB 49 FF FF 49 00 00 24 FF FF 6D 49 92 DB FF FF FF DB 92 92 92 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 92 6D 6D B6 DB DB B6 6D 6D FF FF 24 00 00 DB FF 49 FF FF FF
|
||||
FF FF 49 FF FF 49 00 00 6D DB DB 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 B6 24 00 24 DB DB 6D FF FF
|
||||
FF B6 92 FF B6 00 00 24 FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF 00 00 49 FF 92 B6 FF
|
||||
FF 6D FF FF 92 00 00 49 FF 6D FF FF FF FF FF FF FF FF FF FF FF FF FF B6 92 92 6D 6D 6D 6D DB FF FF FF FF FF FF B6 92 92 92 92 92 FF FF FF FF FF FF FF FF FF FF FF FF 6D FF 24 00 24 FF FF 6D FF
|
||||
DB 92 FF DB 00 00 49 FF 92 DB FF FF FF FF FF FF FF FF FF FF FF DB 6D B6 FF FF FF FF FF FF 92 6D FF FF FF FF 6D B6 FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF 92 DB 00 00 92 FF 92 DB
|
||||
92 FF FF B6 00 00 6D FF 6D FF FF FF FF FF FF FF FF FF FF FF DB 6D FF FF FF 92 49 49 49 92 FF FF 49 DB DB 24 DB FF B6 49 49 92 FF FF DB 92 FF FF FF FF FF FF FF FF FF FF 92 FF 00 00 6D FF DB 92
|
||||
6D FF FF FF 00 00 49 92 DB FF FF FF FF FF FF FF FF FF FF DB 6D FF FF 6D 00 00 00 00 00 00 00 B6 FF 49 00 24 24 49 24 00 00 00 00 6D FF DB 92 FF FF FF FF FF FF FF FF FF DB B6 00 00 92 FF FF 6D
|
||||
6D FF FF 24 00 00 DB 6D FF FF FF FF FF FF FF FF FF FF DB 6D FF DB 00 00 00 00 00 00 00 00 00 00 B6 FF DB B6 49 92 24 24 00 00 00 00 24 FF DB 92 FF FF FF FF FF FF FF FF FF 92 6D 00 00 DB FF 6D
|
||||
6D FF FF 24 00 00 FF 6D FF FF FF FF FF FF FF FF FF FF 49 FF B6 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF 92 DB DB 24 24 00 00 00 00 24 FF 92 DB FF FF FF FF FF FF FF FF 92 92 00 00 FF FF 6D
|
||||
6D FF FF B6 00 00 92 6D FF FF FF FF FF FF FF FF FF 49 FF DB 00 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF B6 B6 FF 92 24 00 00 00 00 00 49 FF 6D FF FF FF FF FF FF FF FF 92 24 00 49 FF FF 6D
|
||||
6D FF FF 00 00 00 DB 6D FF FF FF FF FF FF FF FF 6D DB DB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF DB B6 FF B6 49 00 00 00 00 00 00 6D FF 6D FF FF FF FF FF FF FF 92 92 00 00 DB FF 6D
|
||||
6D FF FF DB 00 00 B6 6D FF FF FF FF FF FF FF 6D B6 FF 24 00 00 00 00 00 00 00 00 00 00 00 24 B6 DB 6D FF FF FF FF FF 6D 49 24 00 00 00 00 00 00 B6 DB B6 FF FF FF FF FF B6 DB 24 00 92 FF FF 6D
|
||||
6D FF FF 6D 00 00 24 DB 92 FF FF FF FF FF 92 92 FF 49 00 00 00 00 00 49 B6 FF FF DB B6 DB FF FF FF B6 92 FF FF DB 92 FF FF FF 49 6D 92 24 00 00 00 DB B6 DB FF FF FF FF 6D FF 00 00 00 DB FF 6D
|
||||
6D FF FF 92 24 00 49 FF 6D B6 FF FF FF 6D 92 FF 49 00 00 49 DB FF FF FF FF FF FF B6 FF FF FF FF FF FF B6 6D 92 92 FF FF FF FF 6D FF FF FF DB 24 00 24 FF 92 B6 FF FF 92 B6 FF 00 00 B6 FF FF 6D
|
||||
92 FF FF FF 00 00 24 92 FF 92 6D 92 49 B6 DB 24 00 24 DB FF FF FF FF FF DB 92 24 00 FF FF FF FF 6D 6D FF FF FF 6D 6D FF FF B6 DB 6D FF FF FF FF 00 00 24 DB B6 6D 6D B6 DB 00 00 00 6D FF FF 6D
|
||||
DB 92 FF DB 49 00 00 00 B6 FF FF DB FF 6D 00 00 6D FF FF FF FF FF FF FF 24 92 00 49 FF FF FF FF FF 6D B6 FF FF 6D 6D FF 6D 00 DB DB 92 FF FF FF DB 00 00 00 6D FF FF DB 6D 00 00 24 FF FF 92 DB
|
||||
FF 49 FF FF 6D 00 00 00 24 49 B6 FF 24 00 00 6D FF FF FF FF FF FF FF 49 92 B6 00 DB FF FF DB DB FF FF B6 FF FF FF FF FF 00 49 DB FF 92 FF FF FF FF 92 00 00 00 24 6D 00 00 00 00 24 DB FF 49 FF
|
||||
FF 92 B6 FF 92 49 00 00 00 00 00 24 00 00 00 FF FF FF FF FF FF FF 92 6D FF B6 DB FF DB B6 DB B6 B6 FF FF B6 FF FF FF DB 00 B6 DB FF 92 FF FF FF FF FF 24 00 00 00 00 00 00 00 00 B6 FF 92 B6 FF
|
||||
FF FF 49 FF FF 49 24 00 00 00 00 00 00 00 B6 FF FF FF FF FF FF FF B6 FF FF FF FF FF FF FF FF FF 6D FF FF 6D FF FF FF DB 24 FF FF FF 92 FF FF FF FF FF 6D 00 00 00 00 00 00 00 DB FF FF 6D FF FF
|
||||
FF FF DB 6D FF FF 6D 49 00 00 00 00 00 24 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 6D 49 24 24 24 FF FF DB FF FF FF FF 24 24 00 00 92 FF FF FF FF FF DB 00 00 00 00 00 00 FF DB FF 6D FF FF FF
|
||||
FF FF FF 92 B6 FF FF DB 49 24 00 00 00 92 FF FF FF FF FF FF FF FF FF DB FF FF FF 49 49 24 00 24 FF FF FF FF FF FF FF FF 49 6D 00 24 49 FF FF FF FF FF FF 49 00 24 6D 6D B6 FF FF 6D B6 FF FF FF
|
||||
FF FF FF FF 6D B6 FF FF DB 92 B6 49 00 FF FF FF FF FF FF FF FF FF FF B6 FF FF FF 92 DB 92 00 24 FF FF FF FF FF FF FF FF FF 00 00 6D FF FF FF FF FF FF FF DB 00 6D DB FF FF FF 6D B6 FF FF FF FF
|
||||
FF FF FF FF FF 92 6D FF FF FF FF B6 49 FF FF FF FF FF FF FF FF FF FF 6D FF FF FF FF B6 92 92 B6 B6 DB FF FF FF FF FF FF FF B6 6D 49 6D FF FF FF FF FF FF FF 92 24 FF FF B6 6D DB FF FF FF FF FF
|
||||
FF FF FF FF FF FF DB 49 6D B6 FF 6D 92 FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF FF 92 FF FF FF FF FF FF FF FF 6D DB 92 FF FF FF FF FF FF FF FF 6D 49 6D DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF DB 92 49 00 FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 6D FF FF FF FF FF FF FF DB 92 FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF DB 00 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 92 6D B6 FF FF FF FF FF FF 49 DB FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF 49 DB 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 6D FF 92 49 92 FF FF FF FF DB 49 DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF FF FF 6D 92 FF 92 FF FF FF FF FF FF FF FF FF FF B6 6D 49 6D DB FF FF FF FF FF 6D 49 FF FF FF DB 6D 6D 92 92 6D 49 FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF 6D 92 FF FF FF DB FF FF FF FF FF FF FF FF 6D 6D FF FF FF 92 6D FF FF FF FF FF 49 92 B6 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF DB 24 92 FF FF FF FF FF FF FF FF FF FF FF FF FF 49 49 6D DB FF FF DB 6D B6 FF FF FF FF B6 B6 DB 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF 24 B6 FF FF FF FF B6 49 49 24 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF 00 49 FF DB DB FF FF FF B6 92 FF FF FF FF FF FF 92 DB FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF 24 B6 FF FF B6 24 00 6D DB FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB DB 00 00 24 FF FF FF FF B6 FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF B6 B6 DB B6 6D 49 49 92 FF FF FF B6 6D FF FF FF FF FF FF FF 92 92 FF FF FF FF FF FF FF 49 92 DB 49 FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF 92 24 49 49 6D FF 6D 92 FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF DB FF FF FF FF FF FF FF FF B6 FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF B6 DB DB FF FF FF FF FF FF FF DB FF FF FF FF FF FF FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF 24 92 FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF B6 92 FF FF FF FF FF FF FF FF FF FF FF DB 6D 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF DB 49 FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 92 6D FF FF FF FF FF 00 24 DB FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF 92 6D FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF FF FF FF FF FF FF 49 00 DB FF FF FF FF FF FF FF FF FF 6D 6D B6 DB DB DB 92 49 00 00 00 00 00 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 DB FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF FF FF DB 6D 49 49 6D B6 DB FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 FF FF FF FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF DB 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF DB 6D 00 49 FF FF FF FF FF FF FF FF FF FF FF FF DB B6 92 6D 6D 6D 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF 49 00 92 FF FF FF FF FF FF FF FF 49 00 00 00 00 00 49 B6 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF 6D 6D FF B6 B6 FF FF FF FF FF FF 92 92 FF FF 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF DB 00 DB 6D 00 B6 FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 DB FF FF FF FF FF 92 00 FF 24 00 00 49 FF FF FF FF FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 FF FF FF FF FF FF 49 24 24 00 00 6D FF FF FF FF FF FF FF DB FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 FF FF FF FF FF FF 6D 00 24 24 24 FF FF FF FF FF FF DB B6 DB 49 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 00 B6 00 49 DB FF FF FF DB 24 6D 24 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 B6 6D 00 00 DB FF 6D 00 00 00 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 00 6D FF FF 00 00 DB 49 00 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 DB FF FF 6D 00 00 92 24 00 00 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 FF FF 00 6D 00 00 24 00 00 00 00 00 00 24 92 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB 00 00 00 00 00 00 00 00 00 00 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 00 24 00 00 6D 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 92 6D 6D DB B6 92 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
</bitmap>
|
||||
</icon>
|
||||
</chrp-boot>
|
172
grub-core/boot/powerpc/grub.chrp.in
Normal file
172
grub-core/boot/powerpc/grub.chrp.in
Normal file
|
@ -0,0 +1,172 @@
|
|||
<CHRP-BOOT>
|
||||
<COMPATIBLE>
|
||||
MacRISC MacRISC3 MacRISC4
|
||||
</COMPATIBLE>
|
||||
<DESCRIPTION>
|
||||
@PACKAGE@ @VERSION@
|
||||
</DESCRIPTION>
|
||||
<OS-BADGE-ICONS>
|
||||
3434
|
||||
00000000000000F781FB8181818181FBFAF500000000000000000000000000000000000000F6FAFAFAFA81F9F600000000000000
|
||||
0000000000F8FBF9F500F95656FCFB5656FBF800000000000000000000000000000000F5FAF9F5F7F600F6F6F9FAF70000000000
|
||||
000000F5FBFA0056FDFEFEFDFDFAAC81FB56568181560000000000000000000000F9F9F9F7FCFDFEFEFEFFFC81F656FA00000000
|
||||
0000F5AC2BF7FBFEFEFD2BF6568181F9F7F6F6F8FBF50000000000000000000000FAF700F600F5F7F7F6F7FEFFACF82BFB000000
|
||||
0000FC2BF5FEFFFFF5F7FC81F70000F7F9FAFAF8000000000000000000000000000056F9F9FAF9F7F7FA812BF7FFFF56F7FA0000
|
||||
005656F5FEFFAC2BF9FA000000000000000000000000000000000000000000000000000000000000000000FA56FAFEFEF8F9F700
|
||||
00FB00F7FFFF56F9F800000000000000000000F656FAFA56F50000000000F5F8F9F8F5000000000000000000F9F7FCFFFB00FB00
|
||||
F8F800ACFFACF6FA000000000000000000F6FA562BF5F5F781FA000000F9FA2B00F556F9F5000000000000000081F8FFFEF6562B
|
||||
810000FFFFF9FAF500000000000000002B8100F5F9FCACFBF82BFBF6FCFAF6FAFC81F600FA2B000000000000002BF8FEFFF8F5FA
|
||||
FA00F5FEFFFA8100000000000000002B8100F9FEFFFFFFFFFFFBF6FDFEACFDFEFFFFFFFBF581F600000000000000F9FEFFF700FA
|
||||
FA00FBFFFEF6F900000000000000F6FB00FCFFFFFFFFFFFFFFFFFCF600FCF7ACFEFFFFFFFDF6810000000000000056F9FFAC00FA
|
||||
FA00F6FFFFF856000000000000F5FBF5ACFFFFFFFFFFFFFFFFFFFF2B002BF8F5ACFFFFFFFFFDF6FA000000000000F9FCFF560081
|
||||
FA0081FFFFF8F9000000000000FBF6FBFFFFFFFFFFFFFFFFFFFFFFF800F55600FCFFFFFFFFFF81F8F80000000000F981FFAC0081
|
||||
FA0000FEFEF8FB0000000000812BFAFFFFFFFFFFFFFEFFFFFDF92BFA0000F6F981ACFEFFFFFFFF56F9F600000000F9FDFF2B0081
|
||||
FA00FAFFFF81812B000000FAF8F9FFFFFEACFBF80000F500000000F9F900562B0000FCF7F9ACFFFF2BF9F50000F9F6FEFFFB0081
|
||||
810000FCFFFBF6FB56F7FBF8F9FFFE5600000000F5FAAC000000F82BF6FAFBF800F556F80000F9FFFE2BFAFAFAF8FAFFFEF60081
|
||||
FAF6F5ACFFFFAC00F856F7ACFFFCF500000000FAFCFFFC00000056AC00F581F92BFEF9FAF6000081FFFFFBF6F62BFFFFACF6F6FA
|
||||
F6FA00FAFFFFFFACFA56FFFFAC0000000000F6FD2BFEF6F5565600F5F800F60081FEF7F656000000FDFFFFFDFDFFFFFFAC0081F5
|
||||
0081F52BFDFFFFFFFFFFFFFFF60000000000FBF6F6F5F656F52BF900FA000000FCFAF5F656000000F7FFFFFFFFFFFFFDF7F68100
|
||||
00F6FB00F8FDFFFFFFFFFF810000000000F6F5000000F52B56F9FC00F7F70000FCF881FCF500000000FEFFFFFFFFAC5600FBF500
|
||||
000056F900F8ACFDFFFFFFF5000000000000002B0000FDFEFFFE560000F60000F9ACFFFE810000000081FFFEFDFAF800FAF70000
|
||||
000000FAF9002B56FAFDFC0000000000000000F80000FBF5FEFEF5000000000000ACFFFA2B0000000000FEFB2BF5008156000000
|
||||
00000000F9FBF600F6FBF800000000000000F7F8000000F9F9F9F82B0000000000F6ACACF70000000000F7FD2BFA812B00000000
|
||||
0000000000F681FCFBFD0000000000000000FBF6000000000000F52B000000000000F92B810000000000008181F6000000000000
|
||||
0000000000000000F6FC00000000000000F6FF0000000000000000000000000000000081FBFB2B00000000F7F900000000000000
|
||||
000000000000000000FC00000000000000FCFAF600000000000000000000000000000056ACF581FBF700000081FB000000000000
|
||||
0000000000000000FAF90000000000008156F5F8000000000000002BFBFCFBF800000000FD2B000056FB8181FBF8000000000000
|
||||
0000000000000000AC0000000000F5FBF90000F6000000000000F5AC56F6005681F50000F6ACFCFBF70000000000000000000000
|
||||
00000000000000F881000000F5FAFDFD00000000000000000000F7FEFA2B0000F581F70000000000810000000000000000000000
|
||||
000000000000F9FCF500FAFDACFAF5FD00000000000000000000F5ACF5FDFEFA0000F82B00000000810000000000000000000000
|
||||
000000000000FCF8F9AC81FD000000FD000000000000FAF7000000F50081F9FAF800000000000000FB0000000000000000000000
|
||||
000000000000FC81F956F5FD000000FD0000000000000000F800F5000000000056000000000000F7FB0000000000000000000000
|
||||
00000000000000000000F5AC000000ACF800000000000000F5FAF80000000000F50000000000F8ACF50000000000000000000000
|
||||
00000000000000000000F5AC000000F5AC000000000000000056F9000000000000000000F7ACFCF5000000000000000000000000
|
||||
00000000000000000000F5FD00000000AC000000000000000000FB0000000000000000F5F6F5FCF6000000000000000000000000
|
||||
0000000000000000000000FD00000000FBFDF600000000000000F8F900000000000000000000F5FB000000000000000000000000
|
||||
0000000000000000000000FDF500000000F9ACF800000000000000815600000000F656818181AC56000000000000000000000000
|
||||
000000000000000000000081F80000000000F9FC0000000000000000F9ACACACFCFBFAFA81FD2B00000000000000000000000000
|
||||
0000000000000000000000F7FB0000000000FBF70000000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000ACF500000000F9FD56F5000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000F8FA0000000000F6FEFEF5000000000000F55681FCACFDACFC560000000000000000000000000000
|
||||
00000000000000000000000000FBF600000000002BFCFA00F700000000F9FDFDFAFEF90000000000000000000000000000000000
|
||||
00000000000000000000000000F5FB0000000000F5FEF7ACAC0000000000000000FCF50000000000000000000000000000000000
|
||||
0000000000000000000000000000F6FA000000002BFF2BFFFFAC00000000000000F7FA0000000000000000000000000000000000
|
||||
000000000000000000000000000000F65600000000FAFEFFFFAC0000000000F800F6810000000000000000000000000000000000
|
||||
00000000000000000000000000000000F52B00000000F8FEFBFF5600000000FCFAACF60000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F9FCFCFFFB00F8FEFFFDF5000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000F9FDF7F5FFFD56FFFFFFFD00000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000810000FBFFFFFBFFFFFFFFACF9F5F5000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F600FC81FFFEFFFFFFFFFFFE8100000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000F7F6FDFFFFFFFEFFFFACF500000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000F5FC81FC81FAFBF9F500000000000000000000000000000000
|
||||
|
||||
00000000000000F781FB8181818181FBFAF500000000000000000000000000000000000000F6FAFAFAFA81F9F600000000000000
|
||||
0000000000F8FBF9F500F95656FCFB5656FBF800000000000000000000000000000000F5FAF9F5F7F600F6F6F9FAF70000000000
|
||||
000000F5FBFA0056FDFEFEFDFDFAAC81FB56568181560000000000000000000000F9F9F9F7FCFDFEFEFEFFFC81F656FA00000000
|
||||
0000F5AC2BF7FBFEFEFD2BF6568181F9F7F6F6F8FBF50000000000000000000000FAF700F600F5F7F7F6F7FEFFACF82BFB000000
|
||||
0000FC2BF5FEFFFFF5F7FC81F70000F7F9FAFAF8000000000000000000000000000056F9F9FAF9F7F7FA812BF7FFFF56F7FA0000
|
||||
005656F5FEFFAC2BF9FA000000000000000000000000000000000000000000000000000000000000000000FA56FAFEFEF8F9F700
|
||||
00FB00F7FFFF56F9F800000000000000000000F656FAFA56F50000000000F5F8F9F8F5000000000000000000F9F7FCFFFB00FB00
|
||||
F8F800ACFFACF6FA000000000000000000F6FA562BF5F5F781FA000000F9FA2B00F556F9F5000000000000000081F8FFFEF6562B
|
||||
810000FFFFF9FAF500000000000000002B8100F5F9FCACFBF82BFBF6FCFAF6FAFC81F600FA2B000000000000002BF8FEFFF8F5FA
|
||||
FA00F5FEFFFA8100000000000000002B8100F9FEFFFFFFFFFFFBF6FDFEACFDFEFFFFFFFBF581F600000000000000F9FEFFF700FA
|
||||
FA00FBFFFEF6F900000000000000F6FB00FCFFFFFFFFFFFFFFFFFCF600FCF7ACFEFFFFFFFDF6810000000000000056F9FFAC00FA
|
||||
FA00F6FFFFF856000000000000F5FBF5ACFFFFFFFFFFFFFFFFFFFF2B002BF8F5ACFFFFFFFFFDF6FA000000000000F9FCFF560081
|
||||
FA0081FFFFF8F9000000000000FBF6FBFFFFFFFFFFFFFFFFFFFFFFF800F55600FCFFFFFFFFFF81F8F80000000000F981FFAC0081
|
||||
FA0000FEFEF8FB0000000000812BFAFFFFFFFFFFFFFEFFFFFDF92BFA0000F6F981ACFEFFFFFFFF56F9F600000000F9FDFF2B0081
|
||||
FA00FAFFFF81812B000000FAF8F9FFFFFEACFBF80000F500000000F9F900562B0000FCF7F9ACFFFF2BF9F50000F9F6FEFFFB0081
|
||||
810000FCFFFBF6FB56F7FBF8F9FFFE5600000000F5FAAC000000F82BF6FAFBF800F556F80000F9FFFE2BFAFAFAF8FAFFFEF60081
|
||||
FAF6F5ACFFFFAC00F856F7ACFFFCF500000000FAFCFFFC00000056AC00F581F92BFEF9FAF6000081FFFFFBF6F62BFFFFACF6F6FA
|
||||
F6FA00FAFFFFFFACFA56FFFFAC0000000000F6FD2BFEF6F5565600F5F800F60081FEF7F656000000FDFFFFFDFDFFFFFFAC0081F5
|
||||
0081F52BFDFFFFFFFFFFFFFFF60000000000FBF6F6F5F656F52BF900FA000000FCFAF5F656000000F7FFFFFFFFFFFFFDF7F68100
|
||||
00F6FB00F8FDFFFFFFFFFF810000000000F6F5000000F52B56F9FC00F7F70000FCF881FCF500000000FEFFFFFFFFAC5600FBF500
|
||||
000056F900F8ACFDFFFFFFF5000000000000002B0000FDFEFFFE560000F60000F9ACFFFE810000000081FFFEFDFAF800FAF70000
|
||||
000000FAF9002B56FAFDFC0000000000000000F80000FBF5FEFEF5000000000000ACFFFA2B0000000000FEFB2BF5008156000000
|
||||
00000000F9FBF600F6FBF800000000000000F7F8000000F9F9F9F82B0000000000F6ACACF70000000000F7FD2BFA812B00000000
|
||||
0000000000F681FCFBFD0000000000000000FBF6000000000000F52B000000000000F92B810000000000008181F6000000000000
|
||||
0000000000000000F6FC00000000000000F6FF0000000000000000000000000000000081FBFB2B00000000F7F900000000000000
|
||||
000000000000000000FC00000000000000FCFAF600000000000000000000000000000056ACF581FBF700000081FB000000000000
|
||||
0000000000000000FAF90000000000008156F5F8000000000000002BFBFCFBF800000000FD2B000056FB8181FBF8000000000000
|
||||
0000000000000000AC0000000000F5FBF90000F6000000000000F5AC56F6005681F50000F6ACFCFBF70000000000000000000000
|
||||
00000000000000F881000000F5FAFDFD00000000000000000000F7FEFA2B0000F581F70000000000810000000000000000000000
|
||||
000000000000F9FCF500FAFDACFAF5FD00000000000000000000F5ACF5FDFEFA0000F82B00000000810000000000000000000000
|
||||
000000000000FCF8F9AC81FD000000FD000000000000FAF7000000F50081F9FAF800000000000000FB0000000000000000000000
|
||||
000000000000FC81F956F5FD000000FD0000000000000000F800F5000000000056000000000000F7FB0000000000000000000000
|
||||
00000000000000000000F5AC000000ACF800000000000000F5FAF80000000000F50000000000F8ACF50000000000000000000000
|
||||
00000000000000000000F5AC000000F5AC000000000000000056F9000000000000000000F7ACFCF5000000000000000000000000
|
||||
00000000000000000000F5FD00000000AC000000000000000000FB0000000000000000F5F6F5FCF6000000000000000000000000
|
||||
0000000000000000000000FD00000000FBFDF600000000000000F8F900000000000000000000F5FB000000000000000000000000
|
||||
0000000000000000000000FDF500000000F9ACF800000000000000815600000000F656818181AC56000000000000000000000000
|
||||
000000000000000000000081F80000000000F9FC0000000000000000F9ACACACFCFBFAFA81FD2B00000000000000000000000000
|
||||
0000000000000000000000F7FB0000000000FBF70000000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000ACF500000000F9FD56F5000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000F8FA0000000000F6FEFEF5000000000000F55681FCACFDACFC560000000000000000000000000000
|
||||
00000000000000000000000000FBF600000000002BFCFA00F700000000F9FDFDFAFEF90000000000000000000000000000000000
|
||||
00000000000000000000000000F5FB0000000000F5FEF7ACAC0000000000000000FCF50000000000000000000000000000000000
|
||||
0000000000000000000000000000F6FA000000002BFF2BFFFFAC00000000000000F7FA0000000000000000000000000000000000
|
||||
000000000000000000000000000000F65600000000FAFEFFFFAC0000000000F800F6810000000000000000000000000000000000
|
||||
00000000000000000000000000000000F52B00000000F8FEFBFF5600000000FCFAACF60000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F9FCFCFFFB00F8FEFFFDF5000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000F9FDF7F5FFFD56FFFFFFFD00000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000810000FBFFFFFBFFFFFFFFACF9F5F5000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F600FC81FFFEFFFFFFFFFFFE8100000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000F7F6FDFFFFFFFEFFFFACF500000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000F5FC81FC81FAFBF9F500000000000000000000000000000000
|
||||
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
</OS-BADGE-ICONS>
|
||||
<BOOT-SCRIPT>
|
||||
boot &device;:&partition;,\System\Library\CoreServices\grub.elf
|
||||
</BOOT-SCRIPT>
|
||||
</CHRP-BOOT>
|
|
@ -28,6 +28,7 @@ pic_base:
|
|||
call boot_continue
|
||||
mov %o4, CIF_REG
|
||||
|
||||
#ifndef CDBOOT
|
||||
/* The offsets to these locations are defined by the
|
||||
* GRUB_BOOT_MACHINE_foo macros in include/grub/sparc/ieee1275/boot.h,
|
||||
* and grub-setup uses this to patch these next three values as needed.
|
||||
|
@ -43,9 +44,19 @@ pic_base:
|
|||
. = _start + GRUB_BOOT_MACHINE_BOOT_DEVPATH
|
||||
boot_path:
|
||||
. = _start + GRUB_BOOT_MACHINE_KERNEL_BYTE
|
||||
boot_path_end:
|
||||
kernel_byte: .xword (2 << 9)
|
||||
boot_path_end:
|
||||
kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
#else
|
||||
#define boot_path (_start + 512)
|
||||
#define boot_path_end (_start + 1024)
|
||||
#include <grub/offsets.h>
|
||||
|
||||
. = _start + 8
|
||||
kernel_byte: .xword (2 << 9)
|
||||
kernel_size: .word 512
|
||||
kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS
|
||||
#endif
|
||||
|
||||
prom_finddev_name: .asciz "finddevice"
|
||||
prom_chosen_path: .asciz "/chosen"
|
||||
|
@ -158,8 +169,10 @@ boot_continue:
|
|||
mov GRUB_NAME_LEN, %o3
|
||||
|
||||
GET_ABS(boot_path, %o3)
|
||||
#ifndef CDBOOT
|
||||
ldub [%o3], %o1
|
||||
brnz,pn %o1, bootpath_known
|
||||
#endif
|
||||
|
||||
/* getprop(chosen_node, "bootpath", &buffer, buffer_size) */
|
||||
GET_ABS(prom_bootpath_name, %o2)
|
||||
|
@ -194,12 +207,19 @@ bootpath_known:
|
|||
GET_ABS(prom_read_name, %o0)
|
||||
LDUW_ABS(kernel_address, 0x00, %o2)
|
||||
call prom_call_3_1_o1
|
||||
#ifdef CDBOOT
|
||||
LDUW_ABS(kernel_size, 0x00, %o3)
|
||||
#else
|
||||
mov 512, %o3
|
||||
#endif
|
||||
|
||||
LDUW_ABS(kernel_address, 0x00, %o2)
|
||||
jmpl %o2, %o7
|
||||
#ifdef CDBOOT
|
||||
mov CIF_REG, %o4
|
||||
#else
|
||||
nop
|
||||
|
||||
#endif
|
||||
. = _start + GRUB_BOOT_MACHINE_CODE_END
|
||||
|
||||
/* the last 4 bytes in the sector 0 contain the signature */
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <grub/time.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -798,7 +799,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
|||
/* Set ownership of root hub ports to EHCI */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_CONFIG_FLAG, GRUB_EHCI_CF_EHCI_OWNER);
|
||||
|
||||
/* Enable asynchronous list */
|
||||
/* Enable both lists */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND,
|
||||
GRUB_EHCI_CMD_AS_ENABL
|
||||
| GRUB_EHCI_CMD_PS_ENABL
|
||||
|
@ -942,9 +943,9 @@ grub_ehci_setup_qh (grub_ehci_qh_t qh, grub_usb_transfer_t transfer)
|
|||
* SplitCompletionMask - AFAIK it is ignored in asynchronous list,
|
||||
* InterruptScheduleMask - AFAIK it should be zero in async. list */
|
||||
ep_cap |= GRUB_EHCI_MULT_THREE;
|
||||
ep_cap |= (transfer->dev->port << GRUB_EHCI_DEVPORT_OFF)
|
||||
ep_cap |= (transfer->dev->split_hubport << GRUB_EHCI_DEVPORT_OFF)
|
||||
& GRUB_EHCI_DEVPORT_MASK;
|
||||
ep_cap |= (transfer->dev->hubaddr << GRUB_EHCI_HUBADDR_OFF)
|
||||
ep_cap |= (transfer->dev->split_hubaddr << GRUB_EHCI_HUBADDR_OFF)
|
||||
& GRUB_EHCI_HUBADDR_MASK;
|
||||
if (transfer->dev->speed == GRUB_USB_SPEED_LOW
|
||||
&& transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL)
|
||||
|
@ -1261,16 +1262,6 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev,
|
|||
/* XXX: Fix it: Currently we don't do anything to restart EHCI */
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
|
||||
/* Check if transfer is not high speed and connected to root hub.
|
||||
* It should not happened but... */
|
||||
if ((transfer->dev->speed != GRUB_USB_SPEED_HIGH)
|
||||
&& !transfer->dev->hubaddr)
|
||||
{
|
||||
grub_error (GRUB_USB_ERR_BADDEVICE,
|
||||
"FULL/LOW speed device on EHCI port!?!");
|
||||
return GRUB_USB_ERR_BADDEVICE;
|
||||
}
|
||||
|
||||
/* Allocate memory for controller transfer data. */
|
||||
cdata = grub_malloc (sizeof (*cdata));
|
||||
if (!cdata)
|
||||
|
@ -1887,13 +1878,16 @@ grub_ehci_fini_hw (int noreturn __attribute__ ((unused)))
|
|||
/* We should disable all EHCI HW to prevent any DMA access etc. */
|
||||
for (e = ehci; e; e = e->next)
|
||||
{
|
||||
/* Disable both lists */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND,
|
||||
~(GRUB_EHCI_CMD_AS_ENABL | GRUB_EHCI_CMD_PS_ENABL)
|
||||
& grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND));
|
||||
|
||||
/* Check if EHCI is halted and halt it if not */
|
||||
if (grub_ehci_halt (e) != GRUB_USB_ERR_NONE)
|
||||
grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI halt timeout");
|
||||
grub_ehci_halt (e);
|
||||
|
||||
/* Reset EHCI */
|
||||
if (grub_ehci_reset (e) != GRUB_USB_ERR_NONE)
|
||||
grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI reset timeout");
|
||||
grub_ehci_reset (e);
|
||||
}
|
||||
|
||||
return GRUB_USB_ERR_NONE;
|
||||
|
@ -1916,6 +1910,9 @@ GRUB_MOD_INIT (ehci)
|
|||
{
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_td) == 64);
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_qh) == 96);
|
||||
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_boot_time ("Initing EHCI hardware");
|
||||
grub_ehci_inithw ();
|
||||
grub_boot_time ("Registering EHCI driver");
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <grub/time.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -1442,6 +1443,9 @@ GRUB_MOD_INIT(ohci)
|
|||
{
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_td) == 32);
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_ed) == 16);
|
||||
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_ohci_inithw ();
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
fini_hnd = grub_loader_register_preboot_hook (grub_ohci_fini_hw,
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <grub/cpu/io.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/cpu/pci.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -44,12 +45,22 @@ typedef enum
|
|||
GRUB_UHCI_REG_USBLEGSUP = 0xc0
|
||||
} grub_uhci_reg_t;
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_UHCI_DETECT_CHANGED = (1 << 1),
|
||||
GRUB_UHCI_DETECT_HAVE_DEVICE = 1,
|
||||
GRUB_UHCI_DETECT_LOW_SPEED = (1 << 8)
|
||||
};
|
||||
|
||||
/* R/WC legacy support bits */
|
||||
#define GRUB_UHCI_LEGSUP_END_A20GATE (1 << 15)
|
||||
#define GRUB_UHCI_TRAP_BY_64H_WSTAT (1 << 11)
|
||||
#define GRUB_UHCI_TRAP_BY_64H_RSTAT (1 << 10)
|
||||
#define GRUB_UHCI_TRAP_BY_60H_WSTAT (1 << 9)
|
||||
#define GRUB_UHCI_TRAP_BY_60H_RSTAT (1 << 8)
|
||||
enum
|
||||
{
|
||||
GRUB_UHCI_LEGSUP_END_A20GATE = (1 << 15),
|
||||
GRUB_UHCI_TRAP_BY_64H_WSTAT = (1 << 11),
|
||||
GRUB_UHCI_TRAP_BY_64H_RSTAT = (1 << 10),
|
||||
GRUB_UHCI_TRAP_BY_60H_WSTAT = (1 << 9),
|
||||
GRUB_UHCI_TRAP_BY_60H_RSTAT = (1 << 8)
|
||||
};
|
||||
|
||||
/* Reset all legacy support - clear all R/WC bits and all R/W bits */
|
||||
#define GRUB_UHCI_RESET_LEGSUP_SMI ( GRUB_UHCI_LEGSUP_END_A20GATE \
|
||||
|
@ -125,7 +136,7 @@ typedef volatile struct grub_uhci_qh *grub_uhci_qh_t;
|
|||
|
||||
struct grub_uhci
|
||||
{
|
||||
int iobase;
|
||||
grub_port_t iobase;
|
||||
volatile grub_uint32_t *framelist_virt;
|
||||
grub_uint32_t framelist_phys;
|
||||
struct grub_pci_dma_chunk *framelist_chunk;
|
||||
|
@ -213,22 +224,28 @@ grub_uhci_pci_iter (grub_pci_device_t dev,
|
|||
|
||||
/* Set bus master - needed for coreboot or broken BIOSes */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
|
||||
grub_pci_write_word(addr, GRUB_PCI_COMMAND_IO_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER
|
||||
| grub_pci_read_word (addr));
|
||||
|
||||
/* Determine IO base address. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG4);
|
||||
base = grub_pci_read (addr);
|
||||
/* Stop if there is no IO space base address defined. */
|
||||
if (! (base & 1))
|
||||
if ((base & GRUB_PCI_ADDR_SPACE_MASK) != GRUB_PCI_ADDR_SPACE_IO)
|
||||
return 0;
|
||||
|
||||
if ((base & GRUB_UHCI_IOMASK) == 0)
|
||||
return 0;
|
||||
|
||||
grub_dprintf ("uhci", "base = %x\n", base);
|
||||
|
||||
/* Allocate memory for the controller and register it. */
|
||||
u = grub_zalloc (sizeof (*u));
|
||||
if (! u)
|
||||
return 1;
|
||||
|
||||
u->iobase = base & GRUB_UHCI_IOMASK;
|
||||
u->iobase = (base & GRUB_UHCI_IOMASK) + GRUB_MACHINE_PCI_IO_BASE;
|
||||
|
||||
/* Reset PIRQ and SMI */
|
||||
addr = grub_pci_make_address (dev, GRUB_UHCI_REG_USBLEGSUP);
|
||||
|
@ -392,6 +409,7 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td,
|
|||
{
|
||||
grub_uhci_td_t tdprev;
|
||||
|
||||
grub_dprintf ("uhci", "Freeing %p\n", td);
|
||||
/* Check state of TD and possibly set last_trans */
|
||||
if (transfer && (td->linkptr & 1))
|
||||
transfer->last_trans = i;
|
||||
|
@ -400,7 +418,10 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td,
|
|||
|
||||
/* Unlink the queue. */
|
||||
tdprev = td;
|
||||
td = grub_dma_phys2virt (td->linkptr2, u->td_chunk);
|
||||
if (!td->linkptr2)
|
||||
td = 0;
|
||||
else
|
||||
td = grub_dma_phys2virt (td->linkptr2, u->td_chunk);
|
||||
|
||||
/* Free the TD. */
|
||||
grub_free_td (u, tdprev);
|
||||
|
@ -583,10 +604,17 @@ grub_uhci_check_transfer (grub_usb_controller_t dev,
|
|||
|
||||
*actual = 0;
|
||||
|
||||
errtd = grub_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk);
|
||||
if (cdata->qh->elinkptr & ~0x0f)
|
||||
errtd = grub_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk);
|
||||
else
|
||||
errtd = 0;
|
||||
|
||||
grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p\n",
|
||||
errtd->ctrl_status, errtd->buffer & (~15), errtd);
|
||||
if (errtd)
|
||||
{
|
||||
grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p, %x\n",
|
||||
errtd->ctrl_status, errtd->buffer & (~15), errtd,
|
||||
cdata->qh->elinkptr);
|
||||
}
|
||||
|
||||
/* Check if the transaction completed. */
|
||||
if (cdata->qh->elinkptr & 1)
|
||||
|
@ -788,7 +816,7 @@ grub_uhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
|||
grub_dprintf ("uhci", "detect=0x%02x port=%d\n", status, port);
|
||||
|
||||
/* Connect Status Change bit - it detects change of connection */
|
||||
if (status & (1 << 1))
|
||||
if (status & GRUB_UHCI_DETECT_CHANGED)
|
||||
{
|
||||
*changed = 1;
|
||||
/* Reset bit Connect Status Change */
|
||||
|
@ -798,9 +826,9 @@ grub_uhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
|||
else
|
||||
*changed = 0;
|
||||
|
||||
if (! (status & 1))
|
||||
if (! (status & GRUB_UHCI_DETECT_HAVE_DEVICE))
|
||||
return GRUB_USB_SPEED_NONE;
|
||||
else if (status & (1 << 8))
|
||||
else if (status & GRUB_UHCI_DETECT_LOW_SPEED)
|
||||
return GRUB_USB_SPEED_LOW;
|
||||
else
|
||||
return GRUB_USB_SPEED_FULL;
|
||||
|
@ -830,6 +858,8 @@ static struct grub_usb_controller_dev usb_controller =
|
|||
|
||||
GRUB_MOD_INIT(uhci)
|
||||
{
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_uhci_inithw ();
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
grub_dprintf ("uhci", "registered\n");
|
||||
|
|
|
@ -49,7 +49,7 @@ static grub_usb_controller_dev_t grub_usb_list;
|
|||
static grub_usb_device_t
|
||||
grub_usb_hub_add_dev (grub_usb_controller_t controller,
|
||||
grub_usb_speed_t speed,
|
||||
int port, int hubaddr)
|
||||
int split_hubport, int split_hubaddr)
|
||||
{
|
||||
grub_usb_device_t dev;
|
||||
int i;
|
||||
|
@ -63,8 +63,8 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller,
|
|||
|
||||
dev->controller = *controller;
|
||||
dev->speed = speed;
|
||||
dev->port = port;
|
||||
dev->hubaddr = hubaddr;
|
||||
dev->split_hubport = split_hubport;
|
||||
dev->split_hubaddr = split_hubaddr;
|
||||
|
||||
err = grub_usb_device_initialize (dev);
|
||||
if (err)
|
||||
|
@ -108,8 +108,8 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller,
|
|||
|
||||
grub_dprintf ("usb", "Added new usb device: %p, addr=%d\n",
|
||||
dev, i);
|
||||
grub_dprintf ("usb", "speed=%d, port=%d, hubaddr=%d\n",
|
||||
speed, port, hubaddr);
|
||||
grub_dprintf ("usb", "speed=%d, split_hubport=%d, split_hubaddr=%d\n",
|
||||
speed, split_hubport, split_hubaddr);
|
||||
|
||||
/* Wait "recovery interval", spec. says 2ms */
|
||||
grub_millisleep (2);
|
||||
|
@ -219,7 +219,12 @@ attach_root_port (struct grub_usb_hub *hub, int portno,
|
|||
grub_boot_time ("Port enabled");
|
||||
|
||||
/* Enable the port and create a device. */
|
||||
dev = grub_usb_hub_add_dev (hub->controller, speed, portno, 0);
|
||||
/* High speed device needs not transaction translation
|
||||
and full/low speed device cannot be connected to EHCI root hub
|
||||
and full/low speed device connected to OHCI/UHCI needs not
|
||||
transaction translation - e.g. hubport and hubaddr should be
|
||||
always none (zero) for any device connected to any root hub. */
|
||||
dev = grub_usb_hub_add_dev (hub->controller, speed, 0, 0);
|
||||
hub->controller->dev->pending_reset = 0;
|
||||
npending--;
|
||||
if (! dev)
|
||||
|
@ -593,6 +598,8 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
|||
{
|
||||
grub_usb_speed_t speed;
|
||||
grub_usb_device_t next_dev;
|
||||
int split_hubport = 0;
|
||||
int split_hubaddr = 0;
|
||||
|
||||
/* Determine the device speed. */
|
||||
if (status & GRUB_USB_HUB_STATUS_PORT_LOWSPEED)
|
||||
|
@ -608,8 +615,37 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
|||
/* Wait a recovery time after reset, spec. says 10ms */
|
||||
grub_millisleep (10);
|
||||
|
||||
/* Find correct values for SPLIT hubport and hubaddr */
|
||||
if (speed == GRUB_USB_SPEED_HIGH)
|
||||
{
|
||||
/* HIGH speed device needs not transaction translation */
|
||||
split_hubport = 0;
|
||||
split_hubaddr = 0;
|
||||
}
|
||||
else
|
||||
/* FULL/LOW device needs hub port and hub address
|
||||
for transaction translation (if connected to EHCI) */
|
||||
if (dev->speed == GRUB_USB_SPEED_HIGH)
|
||||
{
|
||||
/* This port is the first FULL/LOW speed port
|
||||
in the chain from root hub. Attached device
|
||||
should use its port number and hub address */
|
||||
split_hubport = i;
|
||||
split_hubaddr = dev->addr;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This port is NOT the first FULL/LOW speed port
|
||||
in the chain from root hub. Attached device
|
||||
should use values inherited from some parent
|
||||
HIGH speed hub - if any. */
|
||||
split_hubport = dev->split_hubport;
|
||||
split_hubaddr = dev->split_hubaddr;
|
||||
}
|
||||
|
||||
/* Add the device and assign a device address to it. */
|
||||
next_dev = grub_usb_hub_add_dev (&dev->controller, speed, i, dev->addr);
|
||||
next_dev = grub_usb_hub_add_dev (&dev->controller, speed,
|
||||
split_hubport, split_hubaddr);
|
||||
if (dev->controller.dev->pending_reset)
|
||||
{
|
||||
dev->controller.dev->pending_reset = 0;
|
||||
|
|
|
@ -311,13 +311,13 @@ main (int argc, char **argv)
|
|||
buf = malloc (len);
|
||||
if (!buf)
|
||||
{
|
||||
printf ("Couldn't malloc buffer\n");
|
||||
printf (_("error: %s.\n"), _("out of memory"));
|
||||
fclose (f);
|
||||
return 2;
|
||||
}
|
||||
if (fread (buf, 1, len, f) != len)
|
||||
{
|
||||
printf ("Read failed\n");
|
||||
printf (_("cannot read `%s': %s"), strerror (errno));
|
||||
free (buf);
|
||||
fclose (f);
|
||||
return 2;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/charset.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -39,9 +40,15 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
struct grub_arg_list *state = ctxt->state;
|
||||
int dos = 0;
|
||||
grub_file_t file;
|
||||
char buf[GRUB_DISK_SECTOR_SIZE];
|
||||
unsigned char buf[GRUB_DISK_SECTOR_SIZE];
|
||||
grub_ssize_t size;
|
||||
int key = GRUB_TERM_NO_KEY;
|
||||
grub_uint32_t code = 0;
|
||||
int count = 0;
|
||||
unsigned char utbuf[GRUB_MAX_UTF8_PER_CODEPOINT + 1];
|
||||
int utcount = 0;
|
||||
int is_0d = 0;
|
||||
int j;
|
||||
|
||||
if (state[0].set)
|
||||
dos = 1;
|
||||
|
@ -60,21 +67,65 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
unsigned char c = buf[i];
|
||||
utbuf[utcount++] = buf[i];
|
||||
|
||||
if ((grub_isprint (c) || grub_isspace (c)) && c != '\r')
|
||||
grub_printf ("%c", c);
|
||||
else if (dos && c == '\r' && i + 1 < size && buf[i + 1] == '\n')
|
||||
{
|
||||
grub_printf ("\n");
|
||||
i++;
|
||||
}
|
||||
else
|
||||
if (is_0d && buf[i] != '\n')
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
grub_printf ("<%x>", (int) c);
|
||||
grub_printf ("<%x>", (int) '\r');
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
|
||||
is_0d = 0;
|
||||
|
||||
if (!grub_utf8_process (buf[i], &code, &count))
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount - 1; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
code = 0;
|
||||
count = 0;
|
||||
if (utcount == 1 || !grub_utf8_process (buf[i], &code, &count))
|
||||
{
|
||||
grub_printf ("<%x>", (unsigned int) buf[i]);
|
||||
code = 0;
|
||||
count = 0;
|
||||
utcount = 0;
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
continue;
|
||||
}
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
utcount = 1;
|
||||
}
|
||||
if (count)
|
||||
continue;
|
||||
|
||||
if ((code >= 0xa1 || grub_isprint (code)
|
||||
|| grub_isspace (code)) && code != '\r')
|
||||
{
|
||||
grub_printf ("%C", code);
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dos && code == '\r')
|
||||
{
|
||||
is_0d = 1;
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -82,6 +133,18 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
while (key != GRUB_TERM_ESC && key != GRUB_TERM_NO_KEY);
|
||||
}
|
||||
|
||||
if (is_0d)
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
grub_printf ("<%x>", (unsigned int) '\r');
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
|
||||
grub_xputs ("\n");
|
||||
grub_refresh ();
|
||||
grub_file_close (file);
|
||||
|
|
|
@ -50,7 +50,7 @@ static const char *descs[] = {
|
|||
[0xd] = "assembler",
|
||||
[0xf] = "serial",
|
||||
[GRUB_LINUXBIOS_MEMBER_CONSOLE] = "console",
|
||||
[0x12] = "framebuffer",
|
||||
[GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER] = "framebuffer",
|
||||
[0x13] = "GPIO",
|
||||
[0x15] = "VDAT",
|
||||
[GRUB_LINUXBIOS_MEMBER_TIMESTAMPS] = "timestamps (`coreboot_boottime' to list)",
|
||||
|
@ -77,6 +77,20 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item,
|
|||
|
||||
switch (table_item->tag)
|
||||
{
|
||||
case GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER:
|
||||
{
|
||||
struct grub_linuxbios_table_framebuffer *fb;
|
||||
fb = (struct grub_linuxbios_table_framebuffer *) (table_item + 1);
|
||||
|
||||
grub_printf (": %dx%dx%d pitch=%d lfb=0x%llx %d/%d/%d/%d %d/%d/%d/%d",
|
||||
fb->width, fb->height,
|
||||
fb->bpp, fb->pitch, fb->lfb,
|
||||
fb->red_mask_size, fb->green_mask_size,
|
||||
fb->blue_mask_size, fb->reserved_mask_size,
|
||||
fb->red_field_pos, fb->green_field_pos,
|
||||
fb->blue_field_pos, fb->reserved_field_pos);
|
||||
break;
|
||||
}
|
||||
case GRUB_LINUXBIOS_MEMBER_MAINBOARD:
|
||||
{
|
||||
struct grub_linuxbios_mainboard *mb;
|
||||
|
|
|
@ -132,6 +132,9 @@ map_key_core (int code, int status, int *alt_gr_consumed)
|
|||
{
|
||||
*alt_gr_consumed = 0;
|
||||
|
||||
if (code >= GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE)
|
||||
return 0;
|
||||
|
||||
if (status & GRUB_TERM_STATUS_RALT)
|
||||
{
|
||||
if (status & (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT))
|
||||
|
@ -242,7 +245,7 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_le_to_cpu32 (version) != GRUB_KEYBOARD_LAYOUTS_VERSION)
|
||||
if (version != grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid version");
|
||||
goto fail;
|
||||
|
|
|
@ -43,8 +43,6 @@ static const struct grub_arg_option options[] =
|
|||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static const char grub_human_sizes[] = {' ', 'K', 'M', 'G', 'T'};
|
||||
|
||||
/* Helper for grub_ls_list_devices. */
|
||||
static int
|
||||
grub_ls_print_devices (const char *name, void *data)
|
||||
|
@ -143,34 +141,8 @@ print_files_long (const char *filename, const struct grub_dirhook_info *info,
|
|||
if (! ctx->human)
|
||||
grub_printf ("%-12llu", (unsigned long long) file->size);
|
||||
else
|
||||
{
|
||||
grub_uint64_t fsize = file->size * 100ULL;
|
||||
grub_uint64_t fsz = file->size;
|
||||
int units = 0;
|
||||
char buf[20];
|
||||
|
||||
while (fsz / 1024)
|
||||
{
|
||||
fsize = (fsize + 512) / 1024;
|
||||
fsz /= 1024;
|
||||
units++;
|
||||
}
|
||||
|
||||
if (units)
|
||||
{
|
||||
grub_uint64_t whole, fraction;
|
||||
|
||||
whole = grub_divmod64 (fsize, 100, &fraction);
|
||||
grub_snprintf (buf, sizeof (buf),
|
||||
"%" PRIuGRUB_UINT64_T
|
||||
".%02" PRIuGRUB_UINT64_T "%c", whole, fraction,
|
||||
grub_human_sizes[units]);
|
||||
grub_printf ("%-12s", buf);
|
||||
}
|
||||
else
|
||||
grub_printf ("%-12llu", (unsigned long long) file->size);
|
||||
|
||||
}
|
||||
grub_printf ("%-12s", grub_get_human_size (file->size,
|
||||
GRUB_HUMAN_SIZE_SHORT));
|
||||
grub_file_close (file);
|
||||
grub_free (pathname);
|
||||
}
|
||||
|
|
311
grub-core/commands/nativedisk.c
Normal file
311
grub-core/commands/nativedisk.c
Normal file
|
@ -0,0 +1,311 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/device.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/fs.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/file.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const char *modnames_def[] = {
|
||||
/* FIXME: autogenerate this. */
|
||||
#if defined (__i386__) || defined (__x86_64__) || defined (GRUB_MACHINE_MIPS_LOONGSON)
|
||||
"pata", "ahci", "usbms", "ohci", "uhci", "ehci"
|
||||
#elif defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
"pata"
|
||||
#else
|
||||
#error "Fill this"
|
||||
#endif
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
get_uuid (const char *name, char **uuid, int getnative)
|
||||
{
|
||||
grub_device_t dev;
|
||||
grub_fs_t fs = 0;
|
||||
|
||||
*uuid = 0;
|
||||
|
||||
dev = grub_device_open (name);
|
||||
if (!dev)
|
||||
return grub_errno;
|
||||
|
||||
if (!dev->disk)
|
||||
{
|
||||
grub_dprintf ("nativedisk", "Skipping non-disk\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (dev->disk->dev->id)
|
||||
{
|
||||
/* Firmware disks. */
|
||||
case GRUB_DISK_DEVICE_BIOSDISK_ID:
|
||||
case GRUB_DISK_DEVICE_OFDISK_ID:
|
||||
case GRUB_DISK_DEVICE_EFIDISK_ID:
|
||||
case GRUB_DISK_DEVICE_NAND_ID:
|
||||
case GRUB_DISK_DEVICE_ARCDISK_ID:
|
||||
case GRUB_DISK_DEVICE_HOSTDISK_ID:
|
||||
break;
|
||||
|
||||
/* Native disks. */
|
||||
case GRUB_DISK_DEVICE_ATA_ID:
|
||||
case GRUB_DISK_DEVICE_SCSI_ID:
|
||||
if (getnative)
|
||||
break;
|
||||
|
||||
/* Virtual disks. */
|
||||
case GRUB_DISK_DEVICE_PROCFS_ID:
|
||||
case GRUB_DISK_DEVICE_HOST_ID:
|
||||
/* GRUB-only memdisk. Can't match any of firmware devices. */
|
||||
case GRUB_DISK_DEVICE_MEMDISK_ID:
|
||||
grub_dprintf ("nativedisk", "Skipping native disk %s\n",
|
||||
dev->disk->name);
|
||||
return 0;
|
||||
|
||||
/* FIXME: those probably need special handling. */
|
||||
case GRUB_DISK_DEVICE_LOOPBACK_ID:
|
||||
case GRUB_DISK_DEVICE_DISKFILTER_ID:
|
||||
case GRUB_DISK_DEVICE_CRYPTODISK_ID:
|
||||
break;
|
||||
}
|
||||
if (dev)
|
||||
fs = grub_fs_probe (dev);
|
||||
if (!fs)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
return grub_errno;
|
||||
}
|
||||
if (!fs->uuid || fs->uuid (dev, uuid) || !*uuid)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
N_("%s does not support UUIDs"), fs->name);
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct search_ctx
|
||||
{
|
||||
char *root_uuid;
|
||||
char *prefix_uuid;
|
||||
const char *prefix_path;
|
||||
int prefix_found, root_found;
|
||||
};
|
||||
|
||||
static int
|
||||
iterate_device (const char *name, void *data)
|
||||
{
|
||||
struct search_ctx *ctx = data;
|
||||
char *cur_uuid;
|
||||
|
||||
if (get_uuid (name, &cur_uuid, 1))
|
||||
{
|
||||
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
|
||||
grub_errno = 0;
|
||||
grub_print_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_dprintf ("nativedisk", "checking %s: %s\n", name,
|
||||
cur_uuid);
|
||||
if (ctx->prefix_uuid && grub_strcasecmp (cur_uuid, ctx->prefix_uuid) == 0)
|
||||
{
|
||||
char *prefix;
|
||||
prefix = grub_xasprintf ("(%s)/%s", name, ctx->prefix_path);
|
||||
grub_env_set ("prefix", prefix);
|
||||
grub_free (prefix);
|
||||
ctx->prefix_found = 1;
|
||||
}
|
||||
if (ctx->root_uuid && grub_strcasecmp (cur_uuid, ctx->root_uuid) == 0)
|
||||
{
|
||||
grub_env_set ("root", name);
|
||||
ctx->root_found = 1;
|
||||
}
|
||||
return ctx->prefix_found && ctx->root_found;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args_in)
|
||||
{
|
||||
char *uuid_root = 0, *uuid_prefix, *prefdev = 0;
|
||||
const char *prefix = 0;
|
||||
const char *path_prefix = 0;
|
||||
int mods_loaded = 0;
|
||||
grub_dl_t *mods;
|
||||
const char **args;
|
||||
int i;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
argc = ARRAY_SIZE (modnames_def);
|
||||
args = modnames_def;
|
||||
}
|
||||
else
|
||||
args = (const char **) args_in;
|
||||
|
||||
prefix = grub_env_get ("prefix");
|
||||
|
||||
if (! prefix)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix");
|
||||
|
||||
if (prefix)
|
||||
path_prefix = (prefix[0] == '(') ? grub_strchr (prefix, ')') : NULL;
|
||||
if (path_prefix)
|
||||
path_prefix++;
|
||||
else
|
||||
path_prefix = prefix;
|
||||
|
||||
mods = grub_malloc (argc * sizeof (mods[0]));
|
||||
if (!mods)
|
||||
return grub_errno;
|
||||
|
||||
if (get_uuid (NULL, &uuid_root, 0))
|
||||
return grub_errno;
|
||||
|
||||
prefdev = grub_file_get_device_name (prefix);
|
||||
if (grub_errno)
|
||||
{
|
||||
grub_print_error ();
|
||||
prefdev = 0;
|
||||
}
|
||||
|
||||
if (get_uuid (prefdev, &uuid_prefix, 0))
|
||||
{
|
||||
grub_free (uuid_root);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
grub_dprintf ("nativedisk", "uuid_prefix = %s, uuid_root = %s\n",
|
||||
uuid_prefix, uuid_root);
|
||||
|
||||
for (mods_loaded = 0; mods_loaded < argc; mods_loaded++)
|
||||
{
|
||||
char *filename;
|
||||
grub_dl_t mod;
|
||||
grub_file_t file = NULL;
|
||||
grub_ssize_t size;
|
||||
void *core = 0;
|
||||
|
||||
mod = grub_dl_get (args[mods_loaded]);
|
||||
if (mod)
|
||||
{
|
||||
mods[mods_loaded] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s.mod",
|
||||
prefix, args[mods_loaded]);
|
||||
if (! filename)
|
||||
goto fail;
|
||||
|
||||
file = grub_file_open (filename);
|
||||
grub_free (filename);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
||||
size = grub_file_size (file);
|
||||
core = grub_malloc (size);
|
||||
if (! core)
|
||||
{
|
||||
grub_file_close (file);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_file_read (file, core, size) != (grub_ssize_t) size)
|
||||
{
|
||||
grub_file_close (file);
|
||||
grub_free (core);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_file_close (file);
|
||||
|
||||
mods[mods_loaded] = grub_dl_load_core_noinit (core, size);
|
||||
if (! mods[mods_loaded])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
if (mods[i])
|
||||
grub_dl_init (mods[i]);
|
||||
|
||||
if (uuid_prefix || uuid_root)
|
||||
{
|
||||
struct search_ctx ctx;
|
||||
grub_fs_autoload_hook_t saved_autoload;
|
||||
|
||||
/* No need to autoload FS since obviously we already have the necessary fs modules. */
|
||||
saved_autoload = grub_fs_autoload_hook;
|
||||
grub_fs_autoload_hook = 0;
|
||||
|
||||
ctx.root_uuid = uuid_root;
|
||||
ctx.prefix_uuid = uuid_prefix;
|
||||
ctx.prefix_path = path_prefix;
|
||||
ctx.prefix_found = !uuid_prefix;
|
||||
ctx.root_found = !uuid_root;
|
||||
|
||||
/* FIXME: try to guess the correct values. */
|
||||
grub_device_iterate (iterate_device, &ctx);
|
||||
|
||||
grub_fs_autoload_hook = saved_autoload;
|
||||
}
|
||||
grub_free (uuid_root);
|
||||
grub_free (uuid_prefix);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
fail:
|
||||
grub_free (uuid_root);
|
||||
grub_free (uuid_prefix);
|
||||
|
||||
for (i = 0; i < mods_loaded; i++)
|
||||
if (mods[i])
|
||||
{
|
||||
mods[i]->fini = 0;
|
||||
grub_dl_unload (mods[i]);
|
||||
}
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(nativedisk)
|
||||
{
|
||||
cmd = grub_register_command ("nativedisk", grub_cmd_nativedisk, N_("[MODULE1 MODULE2 ...]"),
|
||||
N_("Switch to native disk drivers. If no modules are specified default set (pata,ahci,usbms,ohci,uhci,ehci) is used"));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(nativedisk)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
|
@ -179,7 +179,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
/* Load modules. */
|
||||
if (! grub_no_autoload)
|
||||
if (! grub_no_modules)
|
||||
{
|
||||
const char *prefix;
|
||||
prefix = grub_env_get ("prefix");
|
||||
|
|
|
@ -83,6 +83,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
grub_env_set (state[0].arg, val);
|
||||
else
|
||||
grub_printf ("%s", val);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[2].set)
|
||||
|
@ -94,6 +95,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
grub_env_set (state[0].arg, val);
|
||||
else
|
||||
grub_printf ("%s", val);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
fs = grub_fs_probe (dev);
|
||||
|
@ -105,6 +107,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
grub_env_set (state[0].arg, fs->name);
|
||||
else
|
||||
grub_printf ("%s", fs->name);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[4].set)
|
||||
|
@ -125,6 +128,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
else
|
||||
grub_printf ("%s", uuid);
|
||||
grub_free (uuid);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[5].set)
|
||||
|
@ -147,8 +151,10 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
else
|
||||
grub_printf ("%s", label);
|
||||
grub_free (label);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
grub_device_close (dev);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised target");
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,8 @@ grub_strtosl (char *arg, char **end, int base)
|
|||
/* Context for test_parse. */
|
||||
struct test_parse_ctx
|
||||
{
|
||||
int ret, discard, invert;
|
||||
int invert;
|
||||
int or, and;
|
||||
int file_exists;
|
||||
struct grub_dirhook_info file_info;
|
||||
char *filename;
|
||||
|
@ -51,9 +52,8 @@ struct test_parse_ctx
|
|||
static void
|
||||
update_val (int val, struct test_parse_ctx *ctx)
|
||||
{
|
||||
if (! ctx->discard)
|
||||
ctx->ret = ctx->invert ? ! val : val;
|
||||
ctx->invert = ctx->discard = 0;
|
||||
ctx->and = ctx->and && (ctx->invert ? ! val : val);
|
||||
ctx->invert = 0;
|
||||
}
|
||||
|
||||
/* A hook for iterating directories. */
|
||||
|
@ -153,8 +153,8 @@ static int
|
|||
test_parse (char **args, int *argn, int argc)
|
||||
{
|
||||
struct test_parse_ctx ctx = {
|
||||
.ret = 0,
|
||||
.discard = 0,
|
||||
.and = 1,
|
||||
.or = 0,
|
||||
.invert = 0
|
||||
};
|
||||
|
||||
|
@ -332,7 +332,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
get_fileinfo (args[*argn + 1], &ctx);
|
||||
update_val (ctx.file_exists && ctx.file_info.dir, &ctx);
|
||||
(*argn) += 2;
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-e") == 0)
|
||||
|
@ -340,7 +340,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
get_fileinfo (args[*argn + 1], &ctx);
|
||||
update_val (ctx.file_exists, &ctx);
|
||||
(*argn) += 2;
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-f") == 0)
|
||||
|
@ -349,7 +349,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
/* FIXME: check for other types. */
|
||||
update_val (ctx.file_exists && ! ctx.file_info.dir, &ctx);
|
||||
(*argn) += 2;
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-s") == 0)
|
||||
|
@ -362,7 +362,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
grub_file_close (file);
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
(*argn) += 2;
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
/* String tests. */
|
||||
|
@ -387,7 +387,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
if (grub_strcmp (args[*argn], ")") == 0)
|
||||
{
|
||||
(*argn)++;
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
/* Recursively invoke if parenthesis. */
|
||||
if (grub_strcmp (args[*argn], "(") == 0)
|
||||
|
@ -405,15 +405,13 @@ test_parse (char **args, int *argn, int argc)
|
|||
}
|
||||
if (grub_strcmp (args[*argn], "-a") == 0)
|
||||
{
|
||||
/* If current value is 0 second value is to be discarded. */
|
||||
ctx.discard = ! ctx.ret;
|
||||
(*argn)++;
|
||||
continue;
|
||||
}
|
||||
if (grub_strcmp (args[*argn], "-o") == 0)
|
||||
{
|
||||
/* If current value is 1 second value is to be discarded. */
|
||||
ctx.discard = ctx.ret;
|
||||
ctx.or = ctx.or || ctx.and;
|
||||
ctx.and = 1;
|
||||
(*argn)++;
|
||||
continue;
|
||||
}
|
||||
|
@ -422,7 +420,7 @@ test_parse (char **args, int *argn, int argc)
|
|||
update_val (args[*argn][0], &ctx);
|
||||
(*argn)++;
|
||||
}
|
||||
return ctx.ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
|
115
grub-core/commands/testspeed.c
Normal file
115
grub-core/commands/testspeed.c
Normal file
|
@ -0,0 +1,115 @@
|
|||
/* testspeed.c - Command to test file read speed */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2012 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/mm.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/normal.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define DEFAULT_BLOCK_SIZE 65536
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"size", 's', 0, N_("Specify size for each read operation"), 0, ARG_TYPE_INT},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_testspeed (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
grub_uint64_t start;
|
||||
grub_uint64_t end;
|
||||
grub_ssize_t block_size;
|
||||
grub_disk_addr_t total_size;
|
||||
char *buffer;
|
||||
grub_file_t file;
|
||||
grub_uint64_t whole, fraction;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
block_size = (state[0].set) ?
|
||||
grub_strtoul (state[0].arg, 0, 0) : DEFAULT_BLOCK_SIZE;
|
||||
|
||||
if (block_size <= 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid block size"));
|
||||
|
||||
buffer = grub_malloc (block_size);
|
||||
if (buffer == NULL)
|
||||
return grub_errno;
|
||||
|
||||
file = grub_file_open (args[0]);
|
||||
if (file == NULL)
|
||||
goto quit;
|
||||
|
||||
total_size = 0;
|
||||
start = grub_get_time_ms ();
|
||||
while (1)
|
||||
{
|
||||
grub_ssize_t size = grub_file_read (file, buffer, block_size);
|
||||
if (size <= 0)
|
||||
break;
|
||||
total_size += size;
|
||||
}
|
||||
end = grub_get_time_ms ();
|
||||
grub_file_close (file);
|
||||
|
||||
grub_printf_ (N_("File size: %s\n"),
|
||||
grub_get_human_size (total_size, GRUB_HUMAN_SIZE_NORMAL));
|
||||
whole = grub_divmod64 (end - start, 1000, &fraction);
|
||||
grub_printf_ (N_("Elapsed time: %d.%03d s \n"),
|
||||
(unsigned) whole,
|
||||
(unsigned) fraction);
|
||||
|
||||
if (end != start)
|
||||
{
|
||||
grub_uint64_t speed =
|
||||
grub_divmod64 (total_size * 100ULL * 1000ULL, end - start, 0);
|
||||
|
||||
grub_printf_ (N_("Speed: %s \n"),
|
||||
grub_get_human_size (speed,
|
||||
GRUB_HUMAN_SIZE_SPEED));
|
||||
}
|
||||
|
||||
quit:
|
||||
grub_free (buffer);
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_extcmd_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(testspeed)
|
||||
{
|
||||
cmd = grub_register_extcmd ("testspeed", grub_cmd_testspeed, 0, N_("[-s SIZE] FILENAME"),
|
||||
N_("Test file read speed."),
|
||||
options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(testspeed)
|
||||
{
|
||||
grub_unregister_extcmd (cmd);
|
||||
}
|
|
@ -73,9 +73,9 @@ hook (const struct grub_video_mode_info *info, void *hook_arg)
|
|||
info->blue_field_pos,
|
||||
info->reserved_field_pos);
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)
|
||||
/* TRANSLATORS: In "packed pixel" mode you write the index of the color
|
||||
in the palette. Synonyms include "paletted color". */
|
||||
grub_xputs (_("Packed pixel "));
|
||||
/* TRANSLATORS: In "paletted color" mode you write the index of the color
|
||||
in the palette. Synonyms include "packed pixel". */
|
||||
grub_xputs (_("Paletted "));
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_YUV)
|
||||
grub_xputs (_("YUV "));
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PLANAR)
|
||||
|
|
|
@ -49,7 +49,6 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (grub_strcmp (cmd->name, "vbetest") == 0)
|
||||
grub_dl_load ("vbe");
|
||||
#endif
|
||||
|
||||
mode = grub_env_get ("gfxmode");
|
||||
if (argc)
|
||||
mode = args[0];
|
||||
|
@ -71,10 +70,10 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_font_t fixed;
|
||||
struct grub_font_glyph *glyph;
|
||||
|
||||
grub_video_create_render_target (&text_layer, width, height,
|
||||
GRUB_VIDEO_MODE_TYPE_RGB
|
||||
| GRUB_VIDEO_MODE_TYPE_ALPHA);
|
||||
if (!text_layer)
|
||||
if (grub_video_create_render_target (&text_layer, width, height,
|
||||
GRUB_VIDEO_MODE_TYPE_RGB
|
||||
| GRUB_VIDEO_MODE_TYPE_ALPHA)
|
||||
|| !text_layer)
|
||||
goto fail;
|
||||
|
||||
grub_video_set_active_render_target (text_layer);
|
||||
|
@ -155,26 +154,38 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
color = grub_video_map_rgb (0, 0, 0);
|
||||
grub_video_fill_rect (color, 0, 0, width, height);
|
||||
|
||||
color = grub_video_map_rgb (255, 0, 0);
|
||||
grub_video_fill_rect (color, 0, 0, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (0, 255, 255);
|
||||
grub_video_fill_rect (color, 100, 100, 100, 100);
|
||||
|
||||
grub_video_set_viewport (x + 150, y + 150,
|
||||
width - 150 * 2, height - 150 * 2);
|
||||
color = grub_video_map_rgb (77, 33, 77);
|
||||
grub_video_fill_rect (color, 0, 0, width, height);
|
||||
grub_video_swap_buffers ();
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
|
||||
if (i == 0 || i == 1)
|
||||
{
|
||||
color = grub_video_map_rgb (0, 0, 0);
|
||||
grub_video_fill_rect (color, 0, 0, width, height);
|
||||
|
||||
color = grub_video_map_rgb (255, 0, 0);
|
||||
grub_video_fill_rect (color, 0, 0, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (0, 255, 0);
|
||||
grub_video_fill_rect (color, 100, 0, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (0, 0, 255);
|
||||
grub_video_fill_rect (color, 200, 0, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (0, 255, 255);
|
||||
grub_video_fill_rect (color, 0, 100, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (255, 0, 255);
|
||||
grub_video_fill_rect (color, 100, 100, 100, 100);
|
||||
|
||||
color = grub_video_map_rgb (255, 255, 0);
|
||||
grub_video_fill_rect (color, 200, 100, 100, 100);
|
||||
|
||||
grub_video_set_viewport (x + 150, y + 150,
|
||||
width - 150 * 2, height - 150 * 2);
|
||||
color = grub_video_map_rgb (77, 33, 77);
|
||||
grub_video_fill_rect (color, 0, 0, width, height);
|
||||
}
|
||||
|
||||
color = grub_video_map_rgb (i, 33, 77);
|
||||
grub_video_fill_rect (color, 0, 0, width, height);
|
||||
grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_BLEND, 0, 0,
|
||||
|
|
|
@ -75,6 +75,8 @@ struct grub_ahci_hba_port
|
|||
enum grub_ahci_hba_port_command
|
||||
{
|
||||
GRUB_AHCI_HBA_PORT_CMD_ST = 0x01,
|
||||
GRUB_AHCI_HBA_PORT_CMD_SPIN_UP = 0x02,
|
||||
GRUB_AHCI_HBA_PORT_CMD_POWER_ON = 0x04,
|
||||
GRUB_AHCI_HBA_PORT_CMD_FRE = 0x10,
|
||||
GRUB_AHCI_HBA_PORT_CMD_CR = 0x8000,
|
||||
GRUB_AHCI_HBA_PORT_CMD_FR = 0x4000,
|
||||
|
@ -136,7 +138,7 @@ struct grub_ahci_device
|
|||
static grub_err_t
|
||||
grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
||||
struct grub_disk_ata_pass_through_parms *parms,
|
||||
int spinup);
|
||||
int spinup, int reset);
|
||||
|
||||
|
||||
enum
|
||||
|
@ -162,8 +164,513 @@ enum
|
|||
static struct grub_ahci_device *grub_ahci_devices;
|
||||
static int numdevs;
|
||||
|
||||
static int
|
||||
grub_ahci_pciinit (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid __attribute__ ((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_uint32_t class;
|
||||
grub_uint32_t bar;
|
||||
unsigned i, nports;
|
||||
volatile struct grub_ahci_hba *hba;
|
||||
|
||||
/* Read class. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
|
||||
class = grub_pci_read (addr);
|
||||
|
||||
/* Check if this class ID matches that of a PCI IDE Controller. */
|
||||
if (class >> 8 != 0x010601)
|
||||
return 0;
|
||||
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG5);
|
||||
|
||||
bar = grub_pci_read (addr);
|
||||
|
||||
if ((bar & (GRUB_PCI_ADDR_SPACE_MASK | GRUB_PCI_ADDR_MEM_TYPE_MASK
|
||||
| GRUB_PCI_ADDR_MEM_PREFETCH))
|
||||
!= (GRUB_PCI_ADDR_SPACE_MEMORY | GRUB_PCI_ADDR_MEM_TYPE_32))
|
||||
return 0;
|
||||
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word (addr, grub_pci_read_word (addr) |
|
||||
GRUB_PCI_COMMAND_IO_ENABLED
|
||||
| GRUB_PCI_COMMAND_MEM_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER);
|
||||
|
||||
hba = grub_pci_device_map_range (dev, bar & GRUB_PCI_ADDR_MEM_MASK,
|
||||
sizeof (hba));
|
||||
grub_dprintf ("ahci", "dev: %x:%x.%x\n", dev.bus, dev.device, dev.function);
|
||||
|
||||
grub_dprintf ("ahci", "tfd[0]: %x\n",
|
||||
hba->ports[0].task_file_data);
|
||||
grub_dprintf ("ahci", "cmd[0]: %x\n",
|
||||
hba->ports[0].command);
|
||||
grub_dprintf ("ahci", "st[0]: %x\n",
|
||||
hba->ports[0].status);
|
||||
grub_dprintf ("ahci", "err[0]: %x\n",
|
||||
hba->ports[0].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "tfd[1]: %x\n",
|
||||
hba->ports[1].task_file_data);
|
||||
grub_dprintf ("ahci", "cmd[1]: %x\n",
|
||||
hba->ports[1].command);
|
||||
grub_dprintf ("ahci", "st[1]: %x\n",
|
||||
hba->ports[1].status);
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
hba->ports[1].sata_error = hba->ports[1].sata_error;
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "BH:%x\n", hba->bios_handoff);
|
||||
|
||||
if (! (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_OS_OWNED))
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
|
||||
grub_dprintf ("ahci", "Requesting AHCI ownership\n");
|
||||
hba->bios_handoff = (hba->bios_handoff & ~GRUB_AHCI_BIOS_HANDOFF_RWC)
|
||||
| GRUB_AHCI_BIOS_HANDOFF_OS_OWNED;
|
||||
grub_dprintf ("ahci", "Waiting for BIOS to give up ownership\n");
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED)
|
||||
&& grub_get_time_ms () < endtime);
|
||||
if (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED)
|
||||
{
|
||||
grub_dprintf ("ahci", "Forcibly taking ownership\n");
|
||||
hba->bios_handoff = GRUB_AHCI_BIOS_HANDOFF_OS_OWNED;
|
||||
hba->bios_handoff |= GRUB_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED;
|
||||
}
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI ownership obtained\n");
|
||||
}
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI is already in OS mode\n");
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
if (!(hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN))
|
||||
grub_dprintf ("ahci", "AHCI is in compat mode. Switching\n");
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI is in AHCI mode.\n");
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
/* {
|
||||
grub_uint64_t endtime;
|
||||
hba->global_control |= 1;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (hba->global_control & 1)
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't reset AHCI\n");
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN;
|
||||
grub_millisleep (1);
|
||||
if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
{
|
||||
grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN;
|
||||
grub_millisleep (1);
|
||||
if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
{
|
||||
grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_dprintf ("ahci", "err[1]: %x\n",
|
||||
hba->ports[1].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "GLC:%x\n", hba->global_control);
|
||||
|
||||
nports = (hba->cap & GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1;
|
||||
|
||||
grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports,
|
||||
hba->ports_implemented);
|
||||
|
||||
struct grub_ahci_device *adevs[GRUB_AHCI_HBA_CAP_NPORTS_MASK + 1];
|
||||
struct grub_ahci_device *failed_adevs[GRUB_AHCI_HBA_CAP_NPORTS_MASK + 1];
|
||||
grub_uint32_t fr_running = 0;
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
failed_adevs[i] = 0;
|
||||
for (i = 0; i < nports; i++)
|
||||
{
|
||||
if (!(hba->ports_implemented & (1 << i)))
|
||||
{
|
||||
adevs[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
adevs[i] = grub_zalloc (sizeof (*adevs[i]));
|
||||
if (!adevs[i])
|
||||
return 1;
|
||||
|
||||
adevs[i]->hba = hba;
|
||||
adevs[i]->port = i;
|
||||
adevs[i]->present = 1;
|
||||
adevs[i]->num = numdevs++;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error = adevs[i]->hba->ports[adevs[i]->port].sata_error;
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head));
|
||||
if (!adevs[i]->command_list_chunk)
|
||||
{
|
||||
adevs[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
adevs[i]->command_table_chunk = grub_memalign_dma32 (1024,
|
||||
sizeof (struct grub_ahci_cmd_table));
|
||||
if (!adevs[i]->command_table_chunk)
|
||||
{
|
||||
grub_dma_free (adevs[i]->command_list_chunk);
|
||||
adevs[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
adevs[i]->command_list = grub_dma_get_virt (adevs[i]->command_list_chunk);
|
||||
adevs[i]->command_table = grub_dma_get_virt (adevs[i]->command_table_chunk);
|
||||
adevs[i]->command_list->command_table_base
|
||||
= grub_dma_get_phys (adevs[i]->command_table_chunk);
|
||||
|
||||
grub_dprintf ("ahci", "found device ahci%d (port %d), command_table = %p, command_list = %p\n",
|
||||
adevs[i]->num, adevs[i]->port, grub_dma_get_virt (adevs[i]->command_table_chunk),
|
||||
grub_dma_get_virt (adevs[i]->command_list_chunk));
|
||||
|
||||
adevs[i]->hba->ports[adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
}
|
||||
|
||||
grub_uint64_t endtime;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop FR on port %d\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
adevs[i]->hba->ports[adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR on port %d\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
adevs[i]->hba->ports[adevs[i]->port].inten = 0;
|
||||
adevs[i]->hba->ports[adevs[i]->port].intstatus = ~0;
|
||||
// adevs[i]->hba->ports[adevs[i]->port].fbs = 0;
|
||||
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
adevs[i]->rfis = grub_memalign_dma32 (4096,
|
||||
sizeof (struct grub_ahci_received_fis));
|
||||
grub_memset ((char *) grub_dma_get_virt (adevs[i]->rfis), 0,
|
||||
sizeof (struct grub_ahci_received_fis));
|
||||
grub_memset ((char *) grub_dma_get_virt (adevs[i]->command_list_chunk), 0,
|
||||
sizeof (struct grub_ahci_cmd_head));
|
||||
grub_memset ((char *) grub_dma_get_virt (adevs[i]->command_table_chunk), 0,
|
||||
sizeof (struct grub_ahci_cmd_table));
|
||||
adevs[i]->hba->ports[adevs[i]->port].fis_base = grub_dma_get_phys (adevs[i]->rfis);
|
||||
adevs[i]->hba->ports[adevs[i]->port].command_list_base
|
||||
= grub_dma_get_phys (adevs[i]->command_list_chunk);
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
}
|
||||
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't start FR on port %d\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
fr_running |= (1 << i);
|
||||
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_SPIN_UP;
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON;
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= 1 << 28;
|
||||
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
}
|
||||
|
||||
/* 10ms should actually be enough. */
|
||||
endtime = grub_get_time_ms () + 100;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].status & 7) != 3)
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].status & 7) != 3)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't detect device on port %d\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_POWER_ON;
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_SPIN_UP;
|
||||
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error = ~0;
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
grub_dprintf ("ahci", "offset: %x, tfd:%x, CMD: %x\n",
|
||||
(int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data -
|
||||
(char *) adevs[i]->hba),
|
||||
adevs[i]->hba->ports[adevs[i]->port].task_file_data,
|
||||
adevs[i]->hba->ports[adevs[i]->port].command);
|
||||
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
grub_dprintf ("ahci", "offset: %x, tfd:%x, CMD: %x\n",
|
||||
(int) ((char *) &adevs[i]->hba->ports[adevs[i]->port].task_file_data -
|
||||
(char *) adevs[i]->hba),
|
||||
adevs[i]->hba->ports[adevs[i]->port].task_file_data,
|
||||
adevs[i]->hba->ports[adevs[i]->port].command);
|
||||
|
||||
grub_dprintf ("ahci", "err: %x\n",
|
||||
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
||||
|
||||
adevs[i]->hba->ports[adevs[i]->port].command
|
||||
= (adevs[i]->hba->ports[adevs[i]->port].command & 0x0fffffff) | (1 << 28) | 2 | 4;
|
||||
|
||||
/* struct grub_disk_ata_pass_through_parms parms2;
|
||||
grub_memset (&parms2, 0, sizeof (parms2));
|
||||
parms2.taskfile.cmd = 8;
|
||||
grub_ahci_readwrite_real (dev, &parms2, 1, 1);*/
|
||||
}
|
||||
|
||||
endtime = grub_get_time_ms () + 10000;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & 0x88))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && (adevs[i]->hba->ports[adevs[i]->port].task_file_data & 0x88))
|
||||
{
|
||||
grub_dprintf ("ahci", "port %d is busy\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
adevs[i]->hba->ports[adevs[i]->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i] && !(adevs[i]->hba->ports[adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't start CR on port %d\n", i);
|
||||
failed_adevs[i] = adevs[i];
|
||||
adevs[i] = 0;
|
||||
}
|
||||
for (i = 0; i < nports; i++)
|
||||
if (failed_adevs[i] && (fr_running & (1 << i)))
|
||||
failed_adevs[i]->hba->ports[failed_adevs[i]->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (grub_get_time_ms () < endtime)
|
||||
{
|
||||
for (i = 0; i < nports; i++)
|
||||
if (failed_adevs[i] && (fr_running & (1 << i)) && (failed_adevs[i]->hba->ports[failed_adevs[i]->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
break;
|
||||
if (i == nports)
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < nports; i++)
|
||||
if (failed_adevs[i])
|
||||
{
|
||||
grub_dma_free (failed_adevs[i]->command_list_chunk);
|
||||
grub_dma_free (failed_adevs[i]->command_table_chunk);
|
||||
grub_dma_free (failed_adevs[i]->rfis);
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
if (adevs[i])
|
||||
{
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_ahci_devices),
|
||||
GRUB_AS_LIST (adevs[i]));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_initialize (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ahci_pciinit, NULL);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_fini_hw (int noreturn __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_ahci_device *dev;
|
||||
|
||||
for (dev = grub_ahci_devices; dev; dev = dev->next)
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop FR\n");
|
||||
break;
|
||||
}
|
||||
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR\n");
|
||||
break;
|
||||
}
|
||||
grub_dma_free (dev->command_list_chunk);
|
||||
grub_dma_free (dev->command_table_chunk);
|
||||
grub_dma_free (dev->rfis);
|
||||
dev->command_list_chunk = NULL;
|
||||
dev->command_table_chunk = NULL;
|
||||
dev->rfis = NULL;
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
init_port (struct grub_ahci_device *dev)
|
||||
reinit_port (struct grub_ahci_device *dev)
|
||||
{
|
||||
struct grub_pci_dma_chunk *command_list;
|
||||
struct grub_pci_dma_chunk *command_table;
|
||||
|
@ -254,194 +761,13 @@ init_port (struct grub_ahci_device *dev)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
grub_ahci_pciinit (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid __attribute__ ((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
grub_uint32_t class;
|
||||
grub_uint32_t bar;
|
||||
unsigned i, nports;
|
||||
volatile struct grub_ahci_hba *hba;
|
||||
|
||||
/* Read class. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
|
||||
class = grub_pci_read (addr);
|
||||
|
||||
/* Check if this class ID matches that of a PCI IDE Controller. */
|
||||
if (class >> 8 != 0x010601)
|
||||
return 0;
|
||||
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG5);
|
||||
bar = grub_pci_read (addr);
|
||||
|
||||
if ((bar & (GRUB_PCI_ADDR_SPACE_MASK | GRUB_PCI_ADDR_MEM_TYPE_MASK
|
||||
| GRUB_PCI_ADDR_MEM_PREFETCH))
|
||||
!= (GRUB_PCI_ADDR_SPACE_MEMORY | GRUB_PCI_ADDR_MEM_TYPE_32))
|
||||
return 0;
|
||||
|
||||
hba = grub_pci_device_map_range (dev, bar & GRUB_PCI_ADDR_MEM_MASK,
|
||||
sizeof (hba));
|
||||
|
||||
if (! (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_OS_OWNED))
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
|
||||
grub_dprintf ("ahci", "Requesting AHCI ownership\n");
|
||||
hba->bios_handoff = (hba->bios_handoff & ~GRUB_AHCI_BIOS_HANDOFF_RWC)
|
||||
| GRUB_AHCI_BIOS_HANDOFF_OS_OWNED;
|
||||
grub_dprintf ("ahci", "Waiting for BIOS to give up ownership\n");
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED)
|
||||
&& grub_get_time_ms () < endtime);
|
||||
if (hba->bios_handoff & GRUB_AHCI_BIOS_HANDOFF_BIOS_OWNED)
|
||||
{
|
||||
grub_dprintf ("ahci", "Forcibly taking ownership\n");
|
||||
hba->bios_handoff = GRUB_AHCI_BIOS_HANDOFF_OS_OWNED;
|
||||
hba->bios_handoff |= GRUB_AHCI_BIOS_HANDOFF_OS_OWNERSHIP_CHANGED;
|
||||
}
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI ownership obtained\n");
|
||||
}
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI is already in OS mode\n");
|
||||
|
||||
if (!(hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN))
|
||||
grub_dprintf ("ahci", "AHCI is in compat mode. Switching\n");
|
||||
else
|
||||
grub_dprintf ("ahci", "AHCI is in AHCI mode.\n");
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN;
|
||||
grub_millisleep (1);
|
||||
if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
{
|
||||
grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
hba->global_control |= 1;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (hba->global_control & 1)
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't reset AHCI\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN;
|
||||
grub_millisleep (1);
|
||||
if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN)
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
{
|
||||
grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n");
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
nports = (hba->cap & GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1;
|
||||
|
||||
grub_dprintf ("ahci", "%d AHCI ports\n", nports);
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
{
|
||||
struct grub_ahci_device *adev;
|
||||
grub_uint32_t st;
|
||||
|
||||
if (!(hba->ports_implemented & (1 << i)))
|
||||
continue;
|
||||
|
||||
grub_dprintf ("ahci", "status %d:%x\n", i, hba->ports[i].status);
|
||||
/* FIXME: support hotplugging. */
|
||||
st = hba->ports[i].status;
|
||||
if ((st & 0xf) != 0x3 && (st & 0xf) != 0x1)
|
||||
continue;
|
||||
|
||||
adev = grub_malloc (sizeof (*adev));
|
||||
if (!adev)
|
||||
return 1;
|
||||
|
||||
adev->hba = hba;
|
||||
adev->port = i;
|
||||
adev->present = 1;
|
||||
adev->num = numdevs++;
|
||||
|
||||
if (init_port (adev))
|
||||
{
|
||||
grub_free (adev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_ahci_devices),
|
||||
GRUB_AS_LIST (adev));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_initialize (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ahci_pciinit, NULL);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_fini_hw (int noreturn __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_ahci_device *dev;
|
||||
|
||||
for (dev = grub_ahci_devices; dev; dev = dev->next)
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_FR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop FR\n");
|
||||
break;
|
||||
}
|
||||
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR\n");
|
||||
break;
|
||||
}
|
||||
grub_dma_free (dev->command_list_chunk);
|
||||
grub_dma_free (dev->command_table_chunk);
|
||||
grub_dma_free (dev->rfis);
|
||||
dev->command_list_chunk = NULL;
|
||||
dev->command_table_chunk = NULL;
|
||||
dev->rfis = NULL;
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_restore_hw (void)
|
||||
{
|
||||
struct grub_ahci_device **pdev;
|
||||
|
||||
for (pdev = &grub_ahci_devices; *pdev; pdev = &((*pdev)->next))
|
||||
if (init_port (*pdev))
|
||||
if (reinit_port (*pdev))
|
||||
{
|
||||
struct grub_ahci_device *odev;
|
||||
odev = *pdev;
|
||||
|
@ -504,10 +830,54 @@ static const int register_map[11] = { 3 /* Features */,
|
|||
9 /* LBA48 mid */,
|
||||
10 /* LBA48 high */ };
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_reset_port (struct grub_ahci_device *dev, int force)
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
|
||||
dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error;
|
||||
|
||||
if (force || (dev->hba->ports[dev->port].command_issue & 1)
|
||||
|| (dev->hba->ports[dev->port].task_file_data & 0x80))
|
||||
{
|
||||
struct grub_disk_ata_pass_through_parms parms2;
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR");
|
||||
return grub_error (GRUB_ERR_IO, "couldn't stop CR");
|
||||
}
|
||||
dev->hba->ports[dev->port].command |= 8;
|
||||
while (dev->hba->ports[dev->port].command & 8)
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't set CLO\n");
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_FRE;
|
||||
return grub_error (GRUB_ERR_IO, "couldn't set CLO");
|
||||
}
|
||||
|
||||
dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR");
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
return grub_error (GRUB_ERR_IO, "couldn't stop CR");
|
||||
}
|
||||
dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error;
|
||||
grub_memset (&parms2, 0, sizeof (parms2));
|
||||
parms2.taskfile.cmd = 8;
|
||||
return grub_ahci_readwrite_real (dev, &parms2, 1, 1);
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
||||
struct grub_disk_ata_pass_through_parms *parms,
|
||||
int spinup)
|
||||
int spinup, int reset)
|
||||
{
|
||||
struct grub_pci_dma_chunk *bufc;
|
||||
grub_uint64_t endtime;
|
||||
|
@ -517,25 +887,15 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
||||
if ((dev->hba->ports[dev->port].task_file_data & 0x80))
|
||||
{
|
||||
dev->hba->ports[dev->port].command &= ~GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't stop CR\n");
|
||||
break;
|
||||
}
|
||||
dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST;
|
||||
endtime = grub_get_time_ms () + (spinup ? 10000 : 1000);
|
||||
while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "couldn't start CR\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!reset)
|
||||
grub_ahci_reset_port (dev, 0);
|
||||
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
dev->hba->ports[dev->port].task_file_data = 0;
|
||||
dev->hba->ports[dev->port].command_issue = 0;
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
||||
dev->hba->ports[dev->port].sata_error = dev->hba->ports[dev->port].sata_error;
|
||||
|
||||
|
@ -551,10 +911,9 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
|
||||
bufc = grub_memalign_dma32 (1024, parms->size + (parms->size & 1));
|
||||
|
||||
dev->hba->ports[dev->port].command |= 8;
|
||||
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x, CL=%p\n",
|
||||
dev->hba->ports[dev->port].task_file_data,
|
||||
dev->command_list);
|
||||
/* FIXME: support port multipliers. */
|
||||
dev->command_list[0].config
|
||||
= (5 << GRUB_AHCI_CONFIG_CFIS_LENGTH_SHIFT)
|
||||
|
@ -564,17 +923,28 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
| (parms->cmdsize ? GRUB_AHCI_CONFIG_ATAPI : 0)
|
||||
| (parms->write ? GRUB_AHCI_CONFIG_WRITE : GRUB_AHCI_CONFIG_READ)
|
||||
| (parms->taskfile.cmd == 8 ? (1 << 8) : 0);
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
||||
dev->command_list[0].transfered = 0;
|
||||
dev->command_list[0].command_table_base
|
||||
= grub_dma_get_phys (dev->command_table_chunk);
|
||||
|
||||
grub_memset ((char *) dev->command_list[0].unused, 0,
|
||||
sizeof (dev->command_list[0].unused));
|
||||
|
||||
grub_memset ((char *) &dev->command_table[0], 0,
|
||||
sizeof (dev->command_table[0]));
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
||||
if (parms->cmdsize)
|
||||
grub_memcpy ((char *) dev->command_table[0].command, parms->cmd,
|
||||
parms->cmdsize);
|
||||
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
||||
dev->command_table[0].cfis[0] = GRUB_AHCI_FIS_REG_H2D;
|
||||
dev->command_table[0].cfis[1] = 0x80;
|
||||
for (i = 0; i < sizeof (parms->taskfile.raw); i++)
|
||||
|
@ -593,8 +963,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
|
||||
dev->command_table[0].prdt[0].data_base = grub_dma_get_phys (bufc);
|
||||
dev->command_table[0].prdt[0].unused = 0;
|
||||
dev->command_table[0].prdt[0].size = (parms->size + (parms->size & 1) - 1)
|
||||
| GRUB_AHCI_INTERRUPT_ON_COMPLETE;
|
||||
dev->command_table[0].prdt[0].size = (parms->size - 1);
|
||||
|
||||
grub_dprintf ("ahci", "PRDT = %" PRIxGRUB_UINT64_T ", %x, %x (%"
|
||||
PRIuGRUB_SIZE ")\n",
|
||||
|
@ -610,11 +979,19 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
grub_dprintf ("ahci", "AHCI command schedulded\n");
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
grub_dprintf ("ahci", "AHCI inten = %x\n",
|
||||
dev->hba->ports[dev->port].inten);
|
||||
grub_dprintf ("ahci", "AHCI intstatus = %x\n",
|
||||
dev->hba->ports[dev->port].intstatus);
|
||||
|
||||
dev->hba->ports[dev->port].inten = 0xffffffff;//(1 << 2) | (1 << 5);
|
||||
dev->hba->ports[dev->port].intstatus = 0xffffffff;//(1 << 2) | (1 << 5);
|
||||
grub_dprintf ("ahci", "AHCI inten = %x\n",
|
||||
dev->hba->ports[dev->port].inten);
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
dev->hba->ports[dev->port].command_issue |= 1;
|
||||
dev->hba->ports[dev->port].sata_active = 1;
|
||||
dev->hba->ports[dev->port].command_issue = 1;
|
||||
grub_dprintf ("ahci", "AHCI sig = %x\n", dev->hba->ports[dev->port].sig);
|
||||
grub_dprintf ("ahci", "AHCI tfd = %x\n",
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
|
@ -623,11 +1000,15 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev,
|
|||
while ((dev->hba->ports[dev->port].command_issue & 1))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
{
|
||||
grub_dprintf ("ahci", "AHCI status <%x %x %x>\n",
|
||||
grub_dprintf ("ahci", "AHCI status <%x %x %x %x>\n",
|
||||
dev->hba->ports[dev->port].command_issue,
|
||||
dev->hba->ports[dev->port].sata_active,
|
||||
dev->hba->ports[dev->port].intstatus,
|
||||
dev->hba->ports[dev->port].task_file_data);
|
||||
dev->hba->ports[dev->port].command_issue = 0;
|
||||
err = grub_error (GRUB_ERR_IO, "AHCI transfer timed out");
|
||||
if (!reset)
|
||||
grub_ahci_reset_port (dev, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -672,7 +1053,7 @@ grub_ahci_readwrite (grub_ata_t disk,
|
|||
struct grub_disk_ata_pass_through_parms *parms,
|
||||
int spinup)
|
||||
{
|
||||
return grub_ahci_readwrite_real (disk->data, parms, spinup);
|
||||
return grub_ahci_readwrite_real (disk->data, parms, spinup, 0);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
@ -713,13 +1094,7 @@ static struct grub_preboot *fini_hnd;
|
|||
|
||||
GRUB_MOD_INIT(ahci)
|
||||
{
|
||||
/* To prevent two drivers operating on the same disks. */
|
||||
grub_disk_firmware_is_tainted = 1;
|
||||
if (grub_disk_firmware_fini)
|
||||
{
|
||||
grub_disk_firmware_fini ();
|
||||
grub_disk_firmware_fini = NULL;
|
||||
}
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
/* AHCI initialization. */
|
||||
grub_ahci_initialize ();
|
||||
|
|
|
@ -95,7 +95,7 @@ grub_arcdisk_iterate_iter (const char *name,
|
|||
struct grub_arcdisk_iterate_ctx *ctx = data;
|
||||
|
||||
if (!(comp->type == GRUB_ARC_COMPONENT_TYPE_DISK
|
||||
|| comp->type == GRUB_ARC_COMPONENT_TYPE_DISK
|
||||
|| comp->type == GRUB_ARC_COMPONENT_TYPE_FLOPPY
|
||||
|| comp->type == GRUB_ARC_COMPONENT_TYPE_TAPE))
|
||||
return 0;
|
||||
return ctx->hook (name, ctx->hook_data);
|
||||
|
@ -113,7 +113,11 @@ grub_arcdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
|
|||
return grub_arc_iterate_devs (grub_arcdisk_iterate_iter, &ctx, 1);
|
||||
}
|
||||
|
||||
#ifdef GRUB_CPU_MIPSEL
|
||||
#define RAW_SUFFIX "partition(0)"
|
||||
#else
|
||||
#define RAW_SUFFIX "partition(10)"
|
||||
#endif
|
||||
|
||||
static grub_err_t
|
||||
reopen (const char *name, int writable)
|
||||
|
@ -153,9 +157,7 @@ reopen (const char *name, int writable)
|
|||
static grub_err_t
|
||||
grub_arcdisk_open (const char *name, grub_disk_t disk)
|
||||
{
|
||||
char *fullname, *optr;
|
||||
const char *iptr;
|
||||
int state = 0;
|
||||
char *fullname;
|
||||
grub_err_t err;
|
||||
grub_arc_err_t r;
|
||||
struct grub_arc_fileinfo info;
|
||||
|
@ -163,35 +165,7 @@ grub_arcdisk_open (const char *name, grub_disk_t disk)
|
|||
|
||||
if (grub_memcmp (name, "arc/", 4) != 0)
|
||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not arc device");
|
||||
fullname = grub_malloc (2 * grub_strlen (name) + sizeof (RAW_SUFFIX));
|
||||
if (!fullname)
|
||||
return grub_errno;
|
||||
optr = fullname;
|
||||
for (iptr = name + 4; *iptr; iptr++)
|
||||
if (state == 0)
|
||||
{
|
||||
if (!grub_isdigit (*iptr))
|
||||
*optr++ = *iptr;
|
||||
else
|
||||
{
|
||||
*optr++ = '(';
|
||||
*optr++ = *iptr;
|
||||
state = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (grub_isdigit (*iptr))
|
||||
*optr++ = *iptr;
|
||||
else
|
||||
{
|
||||
*optr++ = ')';
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
if (state)
|
||||
*optr++ = ')';
|
||||
grub_memcpy (optr, RAW_SUFFIX, sizeof (RAW_SUFFIX));
|
||||
fullname = grub_arc_alt_name_to_norm (name, RAW_SUFFIX);
|
||||
disk->data = fullname;
|
||||
grub_dprintf ("arcdisk", "opening %s\n", fullname);
|
||||
|
||||
|
|
|
@ -382,6 +382,8 @@ grub_ata_real_open (int id, int bus)
|
|||
err = grub_ata_identify (ata);
|
||||
if (err)
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such ATA device");
|
||||
grub_free (ata);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -199,16 +199,8 @@ scan_disk (const char *name, int accept_diskfilter)
|
|||
scan_depth--;
|
||||
return 0;
|
||||
}
|
||||
if (scan_disk_partition_iter (disk, 0, (void *) name))
|
||||
{
|
||||
scan_depth--;
|
||||
return 1;
|
||||
}
|
||||
if (grub_partition_iterate (disk, scan_disk_partition_iter, (void *) name))
|
||||
{
|
||||
scan_depth--;
|
||||
return 1;
|
||||
}
|
||||
scan_disk_partition_iter (disk, 0, (void *) name);
|
||||
grub_partition_iterate (disk, scan_disk_partition_iter, (void *) name);
|
||||
grub_disk_close (disk);
|
||||
scan_depth--;
|
||||
return 0;
|
||||
|
|
|
@ -329,18 +329,28 @@ name_devices (struct grub_efidisk_data *devices)
|
|||
{
|
||||
grub_efi_device_path_t *dp;
|
||||
grub_efi_block_io_media_t *m;
|
||||
int is_floppy = 0;
|
||||
|
||||
dp = d->last_device_path;
|
||||
if (! dp)
|
||||
continue;
|
||||
|
||||
m = d->block_io->media;
|
||||
if (m->logical_partition)
|
||||
if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_ACPI_DEVICE_PATH_TYPE
|
||||
&& GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)
|
||||
== GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE)
|
||||
{
|
||||
grub_efi_acpi_device_path_t *acpi
|
||||
= (grub_efi_acpi_device_path_t *) dp;
|
||||
/* Floppy EISA ID. */
|
||||
if (acpi->hid == 0x60441d0 || acpi->hid == 0x70041d0
|
||||
|| acpi->hid == 0x70141d1)
|
||||
is_floppy = 1;
|
||||
}
|
||||
if (is_floppy)
|
||||
{
|
||||
/* Only one partition in a non-media device. Assume that this
|
||||
is a floppy drive. */
|
||||
#ifdef DEBUG_NAMES
|
||||
grub_printf ("adding a floppy by guessing: ");
|
||||
grub_printf ("adding a floppy: ");
|
||||
grub_efi_print_device_path (d->device_path);
|
||||
#endif
|
||||
add_device (&fd_devices, d);
|
||||
|
@ -528,9 +538,9 @@ grub_efidisk_close (struct grub_disk *disk __attribute__ ((unused)))
|
|||
grub_dprintf ("efidisk", "closing %s\n", disk->name);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
grub_size_t size, char *buf)
|
||||
static grub_efi_status_t
|
||||
grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
grub_size_t size, char *buf, int wr)
|
||||
{
|
||||
/* For now, use the disk io interface rather than the block io's. */
|
||||
struct grub_efidisk_data *d;
|
||||
|
@ -540,14 +550,38 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
|||
d = disk->data;
|
||||
bio = d->block_io;
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
grub_size_t len;
|
||||
len = 0x500;
|
||||
if (len > size)
|
||||
len = size;
|
||||
status = efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio,
|
||||
bio->media->media_id,
|
||||
(grub_efi_uint64_t) sector,
|
||||
(grub_efi_uintn_t) len << disk->log_sector_size,
|
||||
buf);
|
||||
size -= len;
|
||||
buf += len << disk->log_sector_size;
|
||||
sector += len;
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return status;
|
||||
}
|
||||
return GRUB_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
grub_size_t size, char *buf)
|
||||
{
|
||||
grub_efi_status_t status;
|
||||
|
||||
grub_dprintf ("efidisk",
|
||||
"reading 0x%lx sectors at the sector 0x%llx from %s\n",
|
||||
(unsigned long) size, (unsigned long long) sector, disk->name);
|
||||
|
||||
status = efi_call_5 (bio->read_blocks, bio, bio->media->media_id,
|
||||
(grub_efi_uint64_t) sector,
|
||||
(grub_efi_uintn_t) size << disk->log_sector_size,
|
||||
buf);
|
||||
status = grub_efidisk_readwrite (disk, sector, size, buf, 0);
|
||||
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("failure reading sector 0x%llx from `%s'"),
|
||||
|
@ -561,22 +595,14 @@ static grub_err_t
|
|||
grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
grub_size_t size, const char *buf)
|
||||
{
|
||||
/* For now, use the disk io interface rather than the block io's. */
|
||||
struct grub_efidisk_data *d;
|
||||
grub_efi_block_io_t *bio;
|
||||
grub_efi_status_t status;
|
||||
|
||||
d = disk->data;
|
||||
bio = d->block_io;
|
||||
|
||||
grub_dprintf ("efidisk",
|
||||
"writing 0x%lx sectors at the sector 0x%llx to %s\n",
|
||||
(unsigned long) size, (unsigned long long) sector, disk->name);
|
||||
|
||||
status = efi_call_5 (bio->write_blocks, bio, bio->media->media_id,
|
||||
(grub_efi_uint64_t) sector,
|
||||
(grub_efi_uintn_t) size << disk->log_sector_size,
|
||||
(void *) buf);
|
||||
status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1);
|
||||
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return grub_error (GRUB_ERR_WRITE_ERROR,
|
||||
N_("failure writing sector 0x%llx to `%s'"),
|
||||
|
@ -597,22 +623,27 @@ static struct grub_disk_dev grub_efidisk_dev =
|
|||
.next = 0
|
||||
};
|
||||
|
||||
void
|
||||
grub_efidisk_init (void)
|
||||
{
|
||||
enumerate_disks ();
|
||||
grub_disk_dev_register (&grub_efidisk_dev);
|
||||
}
|
||||
|
||||
void
|
||||
grub_efidisk_fini (void)
|
||||
{
|
||||
free_devices (fd_devices);
|
||||
free_devices (hd_devices);
|
||||
free_devices (cd_devices);
|
||||
fd_devices = 0;
|
||||
hd_devices = 0;
|
||||
cd_devices = 0;
|
||||
grub_disk_dev_unregister (&grub_efidisk_dev);
|
||||
}
|
||||
|
||||
void
|
||||
grub_efidisk_init (void)
|
||||
{
|
||||
grub_disk_firmware_fini = grub_efidisk_fini;
|
||||
|
||||
enumerate_disks ();
|
||||
grub_disk_dev_register (&grub_efidisk_dev);
|
||||
}
|
||||
|
||||
/* Some utility functions to map GRUB devices with EFI devices. */
|
||||
grub_efi_handle_t
|
||||
grub_efidisk_get_device_handle (grub_disk_t disk)
|
||||
|
|
|
@ -31,6 +31,8 @@ static grub_ieee1275_ihandle_t last_ihandle;
|
|||
struct ofdisk_hash_ent
|
||||
{
|
||||
char *devpath;
|
||||
int is_boot;
|
||||
int is_cdrom;
|
||||
/* Pointer to shortest available name on nodes representing canonical names,
|
||||
otherwise NULL. */
|
||||
const char *shortest;
|
||||
|
@ -69,17 +71,28 @@ ofdisk_hash_add_real (char *devpath)
|
|||
struct ofdisk_hash_ent *p;
|
||||
struct ofdisk_hash_ent **head = &ofdisk_hash[ofdisk_hash_fn(devpath)];
|
||||
|
||||
p = grub_malloc(sizeof (*p));
|
||||
p = grub_zalloc (sizeof (*p));
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
p->devpath = devpath;
|
||||
p->next = *head;
|
||||
p->shortest = 0;
|
||||
*head = p;
|
||||
return p;
|
||||
}
|
||||
|
||||
static int
|
||||
check_string_cdrom (const char *str)
|
||||
{
|
||||
const char *ptr = grub_strrchr (str, '/');
|
||||
|
||||
if (ptr)
|
||||
ptr++;
|
||||
else
|
||||
ptr = str;
|
||||
return (grub_strncmp (ptr, "cdrom", 5) == 0);
|
||||
}
|
||||
|
||||
static struct ofdisk_hash_ent *
|
||||
ofdisk_hash_add (char *devpath, char *curcan)
|
||||
{
|
||||
|
@ -92,6 +105,8 @@ ofdisk_hash_add (char *devpath, char *curcan)
|
|||
if (!curcan)
|
||||
{
|
||||
p->shortest = devpath;
|
||||
if (check_string_cdrom (devpath))
|
||||
p->is_cdrom = 1;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -101,6 +116,9 @@ ofdisk_hash_add (char *devpath, char *curcan)
|
|||
else
|
||||
grub_free (curcan);
|
||||
|
||||
if (check_string_cdrom (devpath) || check_string_cdrom (curcan))
|
||||
pcan->is_cdrom = 1;
|
||||
|
||||
if (!pcan)
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
else
|
||||
|
@ -267,7 +285,7 @@ grub_ofdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
|
|||
}
|
||||
}
|
||||
|
||||
if (grub_strncmp (ent->shortest, "cdrom", 5) == 0)
|
||||
if (!ent->is_boot && ent->is_cdrom)
|
||||
continue;
|
||||
|
||||
{
|
||||
|
@ -491,10 +509,44 @@ static struct grub_disk_dev grub_ofdisk_dev =
|
|||
.next = 0
|
||||
};
|
||||
|
||||
void
|
||||
grub_ofdisk_init (void)
|
||||
static void
|
||||
insert_bootpath (void)
|
||||
{
|
||||
grub_disk_dev_register (&grub_ofdisk_dev);
|
||||
char *bootpath;
|
||||
grub_ssize_t bootpath_size;
|
||||
char *type;
|
||||
|
||||
if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath",
|
||||
&bootpath_size)
|
||||
|| bootpath_size <= 0)
|
||||
{
|
||||
/* Should never happen. */
|
||||
grub_printf ("/chosen/bootpath property missing!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64);
|
||||
if (! bootpath)
|
||||
{
|
||||
grub_print_error ();
|
||||
return;
|
||||
}
|
||||
grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath,
|
||||
(grub_size_t) bootpath_size + 1, 0);
|
||||
bootpath[bootpath_size] = '\0';
|
||||
|
||||
/* Transform an OF device path to a GRUB path. */
|
||||
|
||||
type = grub_ieee1275_get_device_type (bootpath);
|
||||
if (!(type && grub_strcmp (type, "network") == 0))
|
||||
{
|
||||
struct ofdisk_hash_ent *op;
|
||||
char *device = grub_ieee1275_get_devname (bootpath);
|
||||
op = ofdisk_hash_add (device, NULL);
|
||||
op->is_boot = 1;
|
||||
}
|
||||
grub_free (type);
|
||||
grub_free (bootpath);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -508,6 +560,16 @@ grub_ofdisk_fini (void)
|
|||
grub_disk_dev_unregister (&grub_ofdisk_dev);
|
||||
}
|
||||
|
||||
void
|
||||
grub_ofdisk_init (void)
|
||||
{
|
||||
grub_disk_firmware_fini = grub_ofdisk_fini;
|
||||
|
||||
insert_bootpath ();
|
||||
|
||||
grub_disk_dev_register (&grub_ofdisk_dev);
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size)
|
||||
{
|
||||
|
|
|
@ -530,13 +530,7 @@ static struct grub_ata_dev grub_pata_dev =
|
|||
|
||||
GRUB_MOD_INIT(ata_pthru)
|
||||
{
|
||||
/* To prevent two drivers operating on the same disks. */
|
||||
grub_disk_firmware_is_tainted = 1;
|
||||
if (grub_disk_firmware_fini)
|
||||
{
|
||||
grub_disk_firmware_fini ();
|
||||
grub_disk_firmware_fini = NULL;
|
||||
}
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
/* ATA initialization. */
|
||||
grub_pata_initialize ();
|
||||
|
|
|
@ -293,7 +293,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
|
|||
grub_uint32_t last_code;
|
||||
|
||||
#if FONT_DEBUG >= 2
|
||||
grub_printf ("load_font_index(sect_length=%d)\n", sect_length);
|
||||
grub_dprintf ("font", "load_font_index(sect_length=%d)\n", sect_length);
|
||||
#endif
|
||||
|
||||
/* Sanity check: ensure section length is divisible by the entry size. */
|
||||
|
@ -321,7 +321,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
|
|||
|
||||
|
||||
#if FONT_DEBUG >= 2
|
||||
grub_printf ("num_chars=%d)\n", font->num_chars);
|
||||
grub_dprintf ("font", "num_chars=%d)\n", font->num_chars);
|
||||
#endif
|
||||
|
||||
last_code = 0;
|
||||
|
@ -365,7 +365,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
|
|||
#if FONT_DEBUG >= 5
|
||||
/* Print the 1st 10 characters. */
|
||||
if (i < 10)
|
||||
grub_printf ("c=%d o=%d\n", entry->code, entry->offset);
|
||||
grub_dprintf ("font", "c=%d o=%d\n", entry->code, entry->offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -422,7 +422,7 @@ read_section_as_short (struct font_file_section *section,
|
|||
|
||||
/* Load a font and add it to the beginning of the global font list.
|
||||
Returns 0 upon success, nonzero upon failure. */
|
||||
int
|
||||
grub_font_t
|
||||
grub_font_load (const char *filename)
|
||||
{
|
||||
grub_file_t file = 0;
|
||||
|
@ -431,7 +431,7 @@ grub_font_load (const char *filename)
|
|||
grub_font_t font = 0;
|
||||
|
||||
#if FONT_DEBUG >= 1
|
||||
grub_printf ("add_font(%s)\n", filename);
|
||||
grub_dprintf ("font", "add_font(%s)\n", filename);
|
||||
#endif
|
||||
|
||||
if (filename[0] == '(' || filename[0] == '/' || filename[0] == '+')
|
||||
|
@ -462,7 +462,7 @@ grub_font_load (const char *filename)
|
|||
goto fail;
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("file opened\n");
|
||||
grub_dprintf ("font", "file opened\n");
|
||||
#endif
|
||||
|
||||
/* Read the FILE section. It indicates the file format. */
|
||||
|
@ -470,7 +470,7 @@ grub_font_load (const char *filename)
|
|||
goto fail;
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("opened FILE section\n");
|
||||
grub_dprintf ("font", "opened FILE section\n");
|
||||
#endif
|
||||
if (grub_memcmp (section.name, FONT_FORMAT_SECTION_NAMES_FILE,
|
||||
sizeof (FONT_FORMAT_SECTION_NAMES_FILE) - 1) != 0)
|
||||
|
@ -481,7 +481,7 @@ grub_font_load (const char *filename)
|
|||
}
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("section name ok\n");
|
||||
grub_dprintf ("font", "section name ok\n");
|
||||
#endif
|
||||
if (section.length != 4)
|
||||
{
|
||||
|
@ -492,14 +492,14 @@ grub_font_load (const char *filename)
|
|||
}
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("section length ok\n");
|
||||
grub_dprintf ("font", "section length ok\n");
|
||||
#endif
|
||||
/* Check the file format type code. */
|
||||
if (grub_file_read (file, magic, 4) != 4)
|
||||
goto fail;
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("read magic ok\n");
|
||||
grub_dprintf ("font", "read magic ok\n");
|
||||
#endif
|
||||
|
||||
if (grub_memcmp (magic, FONT_FORMAT_PFF2_MAGIC, 4) != 0)
|
||||
|
@ -510,7 +510,7 @@ grub_font_load (const char *filename)
|
|||
}
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("compare magic ok\n");
|
||||
grub_dprintf ("font", "compare magic ok\n");
|
||||
#endif
|
||||
|
||||
/* Allocate the font object. */
|
||||
|
@ -522,7 +522,7 @@ grub_font_load (const char *filename)
|
|||
font->file = file;
|
||||
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("allocate font ok; loading font info\n");
|
||||
grub_dprintf ("font", "allocate font ok; loading font info\n");
|
||||
#endif
|
||||
|
||||
/* Load the font information. */
|
||||
|
@ -537,7 +537,7 @@ grub_font_load (const char *filename)
|
|||
}
|
||||
|
||||
#if FONT_DEBUG >= 2
|
||||
grub_printf ("opened section %c%c%c%c ok\n",
|
||||
grub_dprintf ("font", "opened section %c%c%c%c ok\n",
|
||||
section.name[0], section.name[1],
|
||||
section.name[2], section.name[3]);
|
||||
#endif
|
||||
|
@ -621,7 +621,7 @@ grub_font_load (const char *filename)
|
|||
{
|
||||
/* Unhandled section type, simply skip past it. */
|
||||
#if FONT_DEBUG >= 3
|
||||
grub_printf ("Unhandled section type, skipping.\n");
|
||||
grub_dprintf ("font", "Unhandled section type, skipping.\n");
|
||||
#endif
|
||||
grub_off_t section_end = grub_file_tell (file) + section.length;
|
||||
if ((int) grub_file_seek (file, section_end) == -1)
|
||||
|
@ -636,7 +636,7 @@ grub_font_load (const char *filename)
|
|||
}
|
||||
|
||||
#if FONT_DEBUG >= 1
|
||||
grub_printf ("Loaded font `%s'.\n"
|
||||
grub_dprintf ("font", "Loaded font `%s'.\n"
|
||||
"Ascent=%d Descent=%d MaxW=%d MaxH=%d Number of characters=%d.\n",
|
||||
font->name,
|
||||
font->ascent, font->descent,
|
||||
|
@ -657,7 +657,7 @@ grub_font_load (const char *filename)
|
|||
if (register_font (font) != 0)
|
||||
goto fail;
|
||||
|
||||
return 0;
|
||||
return font;
|
||||
|
||||
fail:
|
||||
if (file)
|
||||
|
@ -666,7 +666,7 @@ fail:
|
|||
font->file = 0;
|
||||
|
||||
free_font (font);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Read a 16-bit big-endian integer from FILE, convert it to native byte
|
||||
|
@ -1064,6 +1064,7 @@ grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code)
|
|||
return best_glyph;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static struct grub_font_glyph *
|
||||
grub_font_dup_glyph (struct grub_font_glyph *glyph)
|
||||
{
|
||||
|
@ -1075,6 +1076,7 @@ grub_font_dup_glyph (struct grub_font_glyph *glyph)
|
|||
+ (glyph->width * glyph->height + 7) / 8);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* FIXME: suboptimal. */
|
||||
static void
|
||||
|
@ -1202,6 +1204,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
signed above_leftx, above_lefty;
|
||||
signed below_rightx, below_righty;
|
||||
signed min_devwidth = 0;
|
||||
const struct grub_unicode_combining *comb;
|
||||
|
||||
if (glyph)
|
||||
glyph->device_width = main_glyph->device_width;
|
||||
|
@ -1222,6 +1225,8 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
below_rightx = ctx.bounds.x + ctx.bounds.width;
|
||||
below_righty = ctx.bounds.y;
|
||||
|
||||
comb = grub_unicode_get_comb (glyph_id);
|
||||
|
||||
for (i = 0; i < glyph_id->ncomb; i++)
|
||||
{
|
||||
grub_int16_t space = 0;
|
||||
|
@ -1232,10 +1237,10 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
continue;
|
||||
targetx = (ctx.bounds.width - combining_glyphs[i]->width) / 2 + ctx.bounds.x;
|
||||
/* CGJ is to avoid diacritics reordering. */
|
||||
if (glyph_id->combining[i].code
|
||||
if (comb[i].code
|
||||
== GRUB_UNICODE_COMBINING_GRAPHEME_JOINER)
|
||||
continue;
|
||||
switch (glyph_id->combining[i].type)
|
||||
switch (comb[i].type)
|
||||
{
|
||||
case GRUB_UNICODE_COMB_OVERLAY:
|
||||
do_blit (combining_glyphs[i],
|
||||
|
@ -1361,7 +1366,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id,
|
|||
break;
|
||||
|
||||
case GRUB_UNICODE_COMB_MN:
|
||||
switch (glyph_id->combining[i].code)
|
||||
switch (comb[i].code)
|
||||
{
|
||||
case GRUB_UNICODE_THAANA_ABAFILI:
|
||||
case GRUB_UNICODE_THAANA_AABAAFILI:
|
||||
|
@ -1410,17 +1415,14 @@ static struct grub_font_glyph *
|
|||
grub_font_construct_dry_run (grub_font_t hinted_font,
|
||||
const struct grub_unicode_glyph *glyph_id,
|
||||
struct grub_video_signed_rect *bounds,
|
||||
struct grub_font_glyph ***combining_glyphs_out,
|
||||
struct grub_font_glyph **combining_glyphs,
|
||||
int *device_width)
|
||||
{
|
||||
struct grub_font_glyph *main_glyph = NULL;
|
||||
struct grub_font_glyph **combining_glyphs;
|
||||
grub_uint32_t desired_attributes = 0;
|
||||
unsigned i;
|
||||
grub_uint32_t base = glyph_id->base;
|
||||
|
||||
if (combining_glyphs_out)
|
||||
*combining_glyphs_out = NULL;
|
||||
const struct grub_unicode_combining *comb;
|
||||
|
||||
if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED)
|
||||
desired_attributes |= GRUB_FONT_CODE_RIGHT_JOINED;
|
||||
|
@ -1428,11 +1430,12 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
|
|||
if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED)
|
||||
desired_attributes |= GRUB_FONT_CODE_LEFT_JOINED;
|
||||
|
||||
comb = grub_unicode_get_comb (glyph_id);
|
||||
|
||||
if (base == 'i' || base == 'j')
|
||||
{
|
||||
for (i = 0; i < glyph_id->ncomb; i++)
|
||||
if (glyph_id->combining[i].type == GRUB_UNICODE_STACK_ABOVE)
|
||||
if (comb[i].type == GRUB_UNICODE_STACK_ABOVE)
|
||||
break;
|
||||
if (i < glyph_id->ncomb && base == 'i')
|
||||
base = GRUB_UNICODE_DOTLESS_LOWERCASE_I;
|
||||
|
@ -1461,8 +1464,6 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
|
|||
if (!glyph_id->ncomb && !glyph_id->attributes)
|
||||
return main_glyph;
|
||||
|
||||
combining_glyphs = grub_malloc (sizeof (combining_glyphs[0])
|
||||
* glyph_id->ncomb);
|
||||
if (glyph_id->ncomb && !combining_glyphs)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
@ -1472,18 +1473,33 @@ grub_font_construct_dry_run (grub_font_t hinted_font,
|
|||
for (i = 0; i < glyph_id->ncomb; i++)
|
||||
combining_glyphs[i]
|
||||
= grub_font_get_glyph_with_fallback (main_glyph->font,
|
||||
glyph_id->combining[i].code);
|
||||
comb[i].code);
|
||||
|
||||
blit_comb (glyph_id, NULL, bounds, main_glyph, combining_glyphs,
|
||||
device_width);
|
||||
if (combining_glyphs_out)
|
||||
*combining_glyphs_out = combining_glyphs;
|
||||
else
|
||||
grub_free (combining_glyphs);
|
||||
|
||||
return main_glyph;
|
||||
}
|
||||
|
||||
static struct grub_font_glyph **render_combining_glyphs = 0;
|
||||
static grub_size_t render_max_comb_glyphs = 0;
|
||||
|
||||
static void
|
||||
ensure_comb_space (const struct grub_unicode_glyph *glyph_id)
|
||||
{
|
||||
if (glyph_id->ncomb <= render_max_comb_glyphs)
|
||||
return;
|
||||
|
||||
render_max_comb_glyphs = 2 * glyph_id->ncomb;
|
||||
if (render_max_comb_glyphs < 8)
|
||||
render_max_comb_glyphs = 8;
|
||||
grub_free (render_combining_glyphs);
|
||||
render_combining_glyphs = grub_malloc (render_max_comb_glyphs
|
||||
* sizeof (render_combining_glyphs[0]));
|
||||
if (!render_combining_glyphs)
|
||||
grub_errno = 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_font_get_constructed_device_width (grub_font_t hinted_font,
|
||||
const struct grub_unicode_glyph
|
||||
|
@ -1491,8 +1507,11 @@ grub_font_get_constructed_device_width (grub_font_t hinted_font,
|
|||
{
|
||||
int ret;
|
||||
struct grub_font_glyph *main_glyph;
|
||||
|
||||
ensure_comb_space (glyph_id);
|
||||
|
||||
main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id, NULL,
|
||||
NULL, &ret);
|
||||
render_combining_glyphs, &ret);
|
||||
if (!main_glyph)
|
||||
return unknown_glyph->device_width;
|
||||
return ret;
|
||||
|
@ -1504,26 +1523,42 @@ grub_font_construct_glyph (grub_font_t hinted_font,
|
|||
{
|
||||
struct grub_font_glyph *main_glyph;
|
||||
struct grub_video_signed_rect bounds;
|
||||
struct grub_font_glyph *glyph;
|
||||
struct grub_font_glyph **combining_glyphs;
|
||||
static struct grub_font_glyph *glyph = 0;
|
||||
static grub_size_t max_glyph_size = 0;
|
||||
|
||||
ensure_comb_space (glyph_id);
|
||||
|
||||
main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id,
|
||||
&bounds, &combining_glyphs, NULL);
|
||||
&bounds, render_combining_glyphs,
|
||||
NULL);
|
||||
|
||||
if (!main_glyph)
|
||||
return grub_font_dup_glyph (unknown_glyph);
|
||||
return unknown_glyph;
|
||||
|
||||
if (!combining_glyphs)
|
||||
return grub_font_dup_glyph (main_glyph);
|
||||
if (!render_combining_glyphs && glyph_id->ncomb)
|
||||
return main_glyph;
|
||||
|
||||
glyph =
|
||||
grub_zalloc (sizeof (*glyph) + (bounds.width * bounds.height + 7) / 8);
|
||||
if (!glyph_id->ncomb && !glyph_id->attributes)
|
||||
return main_glyph;
|
||||
|
||||
if (max_glyph_size < sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT)
|
||||
{
|
||||
grub_free (glyph);
|
||||
max_glyph_size = (sizeof (*glyph) + (bounds.width * bounds.height + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT) * 2;
|
||||
if (max_glyph_size < 8)
|
||||
max_glyph_size = 8;
|
||||
glyph = grub_malloc (max_glyph_size);
|
||||
}
|
||||
if (!glyph)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
return grub_font_dup_glyph (main_glyph);
|
||||
return main_glyph;
|
||||
}
|
||||
|
||||
grub_memset (glyph, 0, sizeof (*glyph)
|
||||
+ (bounds.width * bounds.height
|
||||
+ GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT);
|
||||
|
||||
glyph->font = main_glyph->font;
|
||||
glyph->width = bounds.width;
|
||||
glyph->height = bounds.height;
|
||||
|
@ -1542,7 +1577,7 @@ grub_font_construct_glyph (grub_font_t hinted_font,
|
|||
(glyph->height + glyph->offset_y)
|
||||
- (main_glyph->height + main_glyph->offset_y));
|
||||
|
||||
blit_comb (glyph_id, glyph, NULL, main_glyph, combining_glyphs, NULL);
|
||||
blit_comb (glyph_id, glyph, NULL, main_glyph, render_combining_glyphs, NULL);
|
||||
|
||||
return glyph;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ loadfont_command (grub_command_t cmd __attribute__ ((unused)),
|
|||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
while (argc--)
|
||||
if (grub_font_load (*args++) != 0)
|
||||
if (grub_font_load (*args++) == 0)
|
||||
{
|
||||
if (!grub_errno)
|
||||
return grub_error (GRUB_ERR_BAD_FONT, "invalid font");
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
/* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */
|
||||
|
||||
#define grub_fshelp_node grub_hfsplus_file
|
||||
#include <grub/err.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/mm.h>
|
||||
|
@ -29,6 +30,7 @@
|
|||
#include <grub/fshelp.h>
|
||||
#include <grub/hfs.h>
|
||||
#include <grub/charset.h>
|
||||
#include <grub/hfsplus.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -36,42 +38,6 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||
#define GRUB_HFSPLUSX_MAGIC 0x4858
|
||||
#define GRUB_HFSPLUS_SBLOCK 2
|
||||
|
||||
/* A HFS+ extent. */
|
||||
struct grub_hfsplus_extent
|
||||
{
|
||||
/* The first block of a file on disk. */
|
||||
grub_uint32_t start;
|
||||
/* The amount of blocks described by this extent. */
|
||||
grub_uint32_t count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The descriptor of a fork. */
|
||||
struct grub_hfsplus_forkdata
|
||||
{
|
||||
grub_uint64_t size;
|
||||
grub_uint32_t clumpsize;
|
||||
grub_uint32_t blocks;
|
||||
struct grub_hfsplus_extent extents[8];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The HFS+ Volume Header. */
|
||||
struct grub_hfsplus_volheader
|
||||
{
|
||||
grub_uint16_t magic;
|
||||
grub_uint16_t version;
|
||||
grub_uint32_t attributes;
|
||||
grub_uint8_t unused1[12];
|
||||
grub_uint32_t utime;
|
||||
grub_uint8_t unused2[16];
|
||||
grub_uint32_t blksize;
|
||||
grub_uint8_t unused3[60];
|
||||
grub_uint64_t num_serial;
|
||||
struct grub_hfsplus_forkdata allocations_file;
|
||||
struct grub_hfsplus_forkdata extents_file;
|
||||
struct grub_hfsplus_forkdata catalog_file;
|
||||
struct grub_hfsplus_forkdata attrib_file;
|
||||
struct grub_hfsplus_forkdata startup_file;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The type of node. */
|
||||
enum grub_hfsplus_btnode_type
|
||||
|
@ -82,16 +48,6 @@ enum grub_hfsplus_btnode_type
|
|||
GRUB_HFSPLUS_BTNODE_TYPE_MAP = 2,
|
||||
};
|
||||
|
||||
struct grub_hfsplus_btnode
|
||||
{
|
||||
grub_uint32_t next;
|
||||
grub_uint32_t prev;
|
||||
grub_int8_t type;
|
||||
grub_uint8_t height;
|
||||
grub_uint16_t count;
|
||||
grub_uint16_t unused;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The header of a HFS+ B+ Tree. */
|
||||
struct grub_hfsplus_btheader
|
||||
{
|
||||
|
@ -111,35 +67,6 @@ struct grub_hfsplus_btheader
|
|||
grub_uint32_t attributes;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The on disk layout of a catalog key. */
|
||||
struct grub_hfsplus_catkey
|
||||
{
|
||||
grub_uint16_t keylen;
|
||||
grub_uint32_t parent;
|
||||
grub_uint16_t namelen;
|
||||
grub_uint16_t name[30];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The on disk layout of an extent overflow file key. */
|
||||
struct grub_hfsplus_extkey
|
||||
{
|
||||
grub_uint16_t keylen;
|
||||
grub_uint8_t type;
|
||||
grub_uint8_t unused;
|
||||
grub_uint32_t fileid;
|
||||
grub_uint32_t start;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_key
|
||||
{
|
||||
union
|
||||
{
|
||||
struct grub_hfsplus_extkey extkey;
|
||||
struct grub_hfsplus_catkey catkey;
|
||||
grub_uint16_t keylen;
|
||||
};
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_catfile
|
||||
{
|
||||
grub_uint16_t type;
|
||||
|
@ -162,9 +89,13 @@ struct grub_hfsplus_catfile
|
|||
#define GRUB_HFSPLUS_FILEMODE_SYMLINK 0120000
|
||||
|
||||
/* Some pre-defined file IDs. */
|
||||
#define GRUB_HFSPLUS_FILEID_ROOTDIR 2
|
||||
#define GRUB_HFSPLUS_FILEID_OVERFLOW 3
|
||||
#define GRUB_HFSPLUS_FILEID_CATALOG 4
|
||||
enum
|
||||
{
|
||||
GRUB_HFSPLUS_FILEID_ROOTDIR = 2,
|
||||
GRUB_HFSPLUS_FILEID_OVERFLOW = 3,
|
||||
GRUB_HFSPLUS_FILEID_CATALOG = 4,
|
||||
GRUB_HFSPLUS_FILEID_ATTR = 8
|
||||
};
|
||||
|
||||
enum grub_hfsplus_filetype
|
||||
{
|
||||
|
@ -177,98 +108,15 @@ enum grub_hfsplus_filetype
|
|||
#define GRUB_HFSPLUSX_BINARYCOMPARE 0xBC
|
||||
#define GRUB_HFSPLUSX_CASEFOLDING 0xCF
|
||||
|
||||
/* Internal representation of a catalog key. */
|
||||
struct grub_hfsplus_catkey_internal
|
||||
{
|
||||
grub_uint32_t parent;
|
||||
const grub_uint16_t *name;
|
||||
grub_size_t namelen;
|
||||
};
|
||||
|
||||
/* Internal representation of an extent overflow key. */
|
||||
struct grub_hfsplus_extkey_internal
|
||||
{
|
||||
grub_uint32_t fileid;
|
||||
grub_uint8_t type;
|
||||
grub_uint32_t start;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_key_internal
|
||||
{
|
||||
union
|
||||
{
|
||||
struct grub_hfsplus_extkey_internal extkey;
|
||||
struct grub_hfsplus_catkey_internal catkey;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct grub_fshelp_node
|
||||
{
|
||||
struct grub_hfsplus_data *data;
|
||||
struct grub_hfsplus_extent extents[8];
|
||||
grub_uint64_t size;
|
||||
grub_uint32_t fileid;
|
||||
grub_int32_t mtime;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_btree
|
||||
{
|
||||
grub_uint32_t root;
|
||||
grub_size_t nodesize;
|
||||
|
||||
/* Catalog file node. */
|
||||
struct grub_fshelp_node file;
|
||||
};
|
||||
|
||||
/* Information about a "mounted" HFS+ filesystem. */
|
||||
struct grub_hfsplus_data
|
||||
{
|
||||
struct grub_hfsplus_volheader volheader;
|
||||
grub_disk_t disk;
|
||||
|
||||
unsigned int log2blksize;
|
||||
|
||||
struct grub_hfsplus_btree catalog_tree;
|
||||
struct grub_hfsplus_btree extoverflow_tree;
|
||||
|
||||
struct grub_fshelp_node dirroot;
|
||||
struct grub_fshelp_node opened_file;
|
||||
|
||||
/* This is the offset into the physical disk for an embedded HFS+
|
||||
filesystem (one inside a plain HFS wrapper). */
|
||||
grub_disk_addr_t embedded_offset;
|
||||
int case_sensitive;
|
||||
};
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
|
||||
/* Return the offset of the record with the index INDEX, in the node
|
||||
NODE which is part of the B+ tree BTREE. */
|
||||
static inline grub_off_t
|
||||
grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_btnode *node, int index)
|
||||
{
|
||||
char *cnode = (char *) node;
|
||||
void *recptr;
|
||||
recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]);
|
||||
return grub_be_to_cpu16 (grub_get_unaligned16 (recptr));
|
||||
}
|
||||
|
||||
/* Return a pointer to the record with the index INDEX, in the node
|
||||
NODE which is part of the B+ tree BTREE. */
|
||||
static inline struct grub_hfsplus_key *
|
||||
grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_btnode *node, int index)
|
||||
{
|
||||
char *cnode = (char *) node;
|
||||
grub_off_t offset;
|
||||
offset = grub_hfsplus_btree_recoffset (btree, node, index);
|
||||
return (struct grub_hfsplus_key *) &cnode[offset];
|
||||
}
|
||||
|
||||
grub_err_t (*grub_hfsplus_open_compressed) (struct grub_fshelp_node *node);
|
||||
grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
|
||||
grub_off_t pos,
|
||||
grub_size_t len,
|
||||
char *buf);
|
||||
|
||||
/* Find the extent that points to FILEBLOCK. If it is not in one of
|
||||
the 8 extents described by EXTENT, return -1. In that case set
|
||||
|
@ -292,14 +140,6 @@ grub_hfsplus_find_block (struct grub_hfsplus_extent *extent,
|
|||
return 0xffffffffffffffffULL;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_key_internal *key,
|
||||
int (*compare_keys) (struct grub_hfsplus_key *keya,
|
||||
struct grub_hfsplus_key_internal *keyb),
|
||||
struct grub_hfsplus_btnode **matchnode,
|
||||
grub_off_t *keyoffset);
|
||||
|
||||
static int grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
|
||||
struct grub_hfsplus_key_internal *keyb);
|
||||
|
||||
|
@ -310,7 +150,8 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||
{
|
||||
struct grub_hfsplus_btnode *nnode = 0;
|
||||
grub_disk_addr_t blksleft = fileblock;
|
||||
struct grub_hfsplus_extent *extents = &node->extents[0];
|
||||
struct grub_hfsplus_extent *extents = node->compressed
|
||||
? &node->resource_extents[0] : &node->extents[0];
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -344,10 +185,11 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||
extoverflow.extkey.fileid = node->fileid;
|
||||
extoverflow.extkey.type = 0;
|
||||
extoverflow.extkey.start = fileblock - blksleft;
|
||||
|
||||
extoverflow.extkey.type = node->compressed ? 0xff : 0;
|
||||
if (grub_hfsplus_btree_search (&node->data->extoverflow_tree,
|
||||
&extoverflow,
|
||||
grub_hfsplus_cmp_extkey, &nnode, &ptr))
|
||||
grub_hfsplus_cmp_extkey, &nnode, &ptr)
|
||||
|| !nnode)
|
||||
{
|
||||
grub_error (GRUB_ERR_READ_ERROR,
|
||||
"no block found for the file id 0x%x and the block offset 0x%x",
|
||||
|
@ -373,7 +215,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||
|
||||
/* Read LEN bytes from the file described by DATA starting with byte
|
||||
POS. Return the amount of read bytes in READ. */
|
||||
static grub_ssize_t
|
||||
grub_ssize_t
|
||||
grub_hfsplus_read_file (grub_fshelp_node_t node,
|
||||
grub_disk_read_hook_t read_hook, void *read_hook_data,
|
||||
grub_off_t pos, grub_size_t len, char *buf)
|
||||
|
@ -460,15 +302,27 @@ grub_hfsplus_mount (grub_disk_t disk)
|
|||
/* Make a new node for the catalog tree. */
|
||||
data->catalog_tree.file.data = data;
|
||||
data->catalog_tree.file.fileid = GRUB_HFSPLUS_FILEID_CATALOG;
|
||||
data->catalog_tree.file.compressed = 0;
|
||||
grub_memcpy (&data->catalog_tree.file.extents,
|
||||
data->volheader.catalog_file.extents,
|
||||
sizeof data->volheader.catalog_file.extents);
|
||||
data->catalog_tree.file.size =
|
||||
grub_be_to_cpu64 (data->volheader.catalog_file.size);
|
||||
|
||||
data->attr_tree.file.data = data;
|
||||
data->attr_tree.file.fileid = GRUB_HFSPLUS_FILEID_ATTR;
|
||||
grub_memcpy (&data->attr_tree.file.extents,
|
||||
data->volheader.attr_file.extents,
|
||||
sizeof data->volheader.attr_file.extents);
|
||||
|
||||
data->attr_tree.file.size =
|
||||
grub_be_to_cpu64 (data->volheader.attr_file.size);
|
||||
data->attr_tree.file.compressed = 0;
|
||||
|
||||
/* Make a new node for the extent overflow file. */
|
||||
data->extoverflow_tree.file.data = data;
|
||||
data->extoverflow_tree.file.fileid = GRUB_HFSPLUS_FILEID_OVERFLOW;
|
||||
data->extoverflow_tree.file.compressed = 0;
|
||||
grub_memcpy (&data->extoverflow_tree.file.extents,
|
||||
data->volheader.extents_file.extents,
|
||||
sizeof data->volheader.catalog_file.extents);
|
||||
|
@ -501,6 +355,20 @@ grub_hfsplus_mount (grub_disk_t disk)
|
|||
data->extoverflow_tree.root = grub_be_to_cpu32 (header.root);
|
||||
data->extoverflow_tree.nodesize = grub_be_to_cpu16 (header.nodesize);
|
||||
|
||||
if (grub_hfsplus_read_file (&data->attr_tree.file, 0, 0,
|
||||
sizeof (struct grub_hfsplus_btnode),
|
||||
sizeof (header), (char *) &header) <= 0)
|
||||
{
|
||||
grub_errno = 0;
|
||||
data->attr_tree.root = 0;
|
||||
data->attr_tree.nodesize = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data->attr_tree.root = grub_be_to_cpu32 (header.root);
|
||||
data->attr_tree.nodesize = grub_be_to_cpu16 (header.nodesize);
|
||||
}
|
||||
|
||||
data->dirroot.data = data;
|
||||
data->dirroot.fileid = GRUB_HFSPLUS_FILEID_ROOTDIR;
|
||||
|
||||
|
@ -586,6 +454,12 @@ grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
|
|||
return 1;
|
||||
if (extkey_a->type < extkey_b->type)
|
||||
return -1;
|
||||
|
||||
if (extkey_a->type > extkey_b->type)
|
||||
return +1;
|
||||
|
||||
if (extkey_a->type < extkey_b->type)
|
||||
return -1;
|
||||
|
||||
akey = grub_be_to_cpu32 (extkey_a->start);
|
||||
if (akey > extkey_b->start)
|
||||
|
@ -668,7 +542,7 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree,
|
|||
keys using the function COMPARE_KEYS. When a match is found,
|
||||
return the node in MATCHNODE and a pointer to the data in this node
|
||||
in KEYOFFSET. MATCHNODE should be freed by the caller. */
|
||||
static grub_err_t
|
||||
grub_err_t
|
||||
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_key_internal *key,
|
||||
int (*compare_keys) (struct grub_hfsplus_key *keya,
|
||||
|
@ -683,6 +557,12 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
|||
grub_uint64_t save_node;
|
||||
grub_uint64_t node_count = 0;
|
||||
|
||||
if (!btree->nodesize)
|
||||
{
|
||||
*matchnode = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
node = grub_malloc (btree->nodesize);
|
||||
if (! node)
|
||||
return grub_errno;
|
||||
|
@ -760,7 +640,7 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
|||
{
|
||||
*matchnode = 0;
|
||||
grub_free (node);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -872,11 +752,17 @@ list_nodes (void *record, void *hook_arg)
|
|||
if (!node)
|
||||
return 1;
|
||||
node->data = ctx->dir->data;
|
||||
node->compressed = 0;
|
||||
node->cbuf = 0;
|
||||
node->compress_index = 0;
|
||||
|
||||
grub_memcpy (node->extents, fileinfo->data.extents,
|
||||
sizeof (node->extents));
|
||||
grub_memcpy (node->resource_extents, fileinfo->resource.extents,
|
||||
sizeof (node->resource_extents));
|
||||
node->mtime = grub_be_to_cpu32 (fileinfo->mtime) - 2082844800;
|
||||
node->size = grub_be_to_cpu64 (fileinfo->data.size);
|
||||
node->resource_size = grub_be_to_cpu64 (fileinfo->resource.size);
|
||||
node->fileid = grub_be_to_cpu32 (fileinfo->fileid);
|
||||
|
||||
ctx->ret = ctx->hook (filename, type, node, ctx->hook_data);
|
||||
|
@ -919,7 +805,8 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
|
|||
|
||||
/* First lookup the first entry. */
|
||||
if (grub_hfsplus_btree_search (&dir->data->catalog_tree, &intern,
|
||||
grub_hfsplus_cmp_catkey, &node, &ptr))
|
||||
grub_hfsplus_cmp_catkey, &node, &ptr)
|
||||
|| !node)
|
||||
return 0;
|
||||
|
||||
/* Iterate over all entries in this directory. */
|
||||
|
@ -950,6 +837,14 @@ grub_hfsplus_open (struct grub_file *file, const char *name)
|
|||
if (grub_errno)
|
||||
goto fail;
|
||||
|
||||
if (grub_hfsplus_open_compressed)
|
||||
{
|
||||
grub_err_t err;
|
||||
err = grub_hfsplus_open_compressed (fdiro);
|
||||
if (err)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file->size = fdiro->size;
|
||||
data->opened_file = *fdiro;
|
||||
grub_free (fdiro);
|
||||
|
@ -973,7 +868,13 @@ grub_hfsplus_open (struct grub_file *file, const char *name)
|
|||
static grub_err_t
|
||||
grub_hfsplus_close (grub_file_t file)
|
||||
{
|
||||
grub_free (file->data);
|
||||
struct grub_hfsplus_data *data =
|
||||
(struct grub_hfsplus_data *) file->data;
|
||||
|
||||
grub_free (data->opened_file.cbuf);
|
||||
grub_free (data->opened_file.compress_index);
|
||||
|
||||
grub_free (data);
|
||||
|
||||
grub_dl_unref (my_mod);
|
||||
|
||||
|
@ -987,6 +888,10 @@ grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len)
|
|||
struct grub_hfsplus_data *data =
|
||||
(struct grub_hfsplus_data *) file->data;
|
||||
|
||||
if (grub_hfsplus_read_compressed && data->opened_file.compressed)
|
||||
return grub_hfsplus_read_compressed (&data->opened_file,
|
||||
file->offset, len, buf);
|
||||
|
||||
return grub_hfsplus_read_file (&data->opened_file,
|
||||
file->read_hook, file->read_hook_data,
|
||||
file->offset, len, buf);
|
||||
|
@ -1076,7 +981,8 @@ grub_hfsplus_label (grub_device_t device, char **label)
|
|||
|
||||
/* First lookup the first entry. */
|
||||
if (grub_hfsplus_btree_search (&data->catalog_tree, &intern,
|
||||
grub_hfsplus_cmp_catkey_id, &node, &ptr))
|
||||
grub_hfsplus_cmp_catkey_id, &node, &ptr)
|
||||
|| !node)
|
||||
{
|
||||
grub_free (data);
|
||||
return 0;
|
||||
|
|
302
grub-core/fs/hfspluscomp.c
Normal file
302
grub-core/fs/hfspluscomp.c
Normal file
|
@ -0,0 +1,302 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2012 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/>.
|
||||
*/
|
||||
|
||||
/* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */
|
||||
|
||||
#include <grub/hfsplus.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/deflate.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* big-endian. */
|
||||
struct grub_hfsplus_compress_header1
|
||||
{
|
||||
grub_uint32_t header_size;
|
||||
grub_uint32_t end_descriptor_offset;
|
||||
grub_uint32_t total_compressed_size_including_seek_blocks_and_header2;
|
||||
grub_uint32_t value_0x32;
|
||||
grub_uint8_t unused[0xf0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* big-endian. */
|
||||
struct grub_hfsplus_compress_header2
|
||||
{
|
||||
grub_uint32_t total_compressed_size_including_seek_blocks;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* little-endian. */
|
||||
struct grub_hfsplus_compress_header3
|
||||
{
|
||||
grub_uint32_t num_chunks;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* little-endian. */
|
||||
struct grub_hfsplus_compress_block_descriptor
|
||||
{
|
||||
grub_uint32_t offset;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_compress_end_descriptor
|
||||
{
|
||||
grub_uint8_t always_the_same[50];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_attr_header
|
||||
{
|
||||
grub_uint8_t unused[3];
|
||||
grub_uint8_t type;
|
||||
grub_uint32_t unknown[1];
|
||||
grub_uint64_t size;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_compress_attr
|
||||
{
|
||||
grub_uint32_t magic;
|
||||
grub_uint32_t type;
|
||||
grub_uint32_t uncompressed_inline_size;
|
||||
grub_uint32_t always_0;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum
|
||||
{
|
||||
HFSPLUS_COMPRESSION_INLINE = 3,
|
||||
HFSPLUS_COMPRESSION_RESOURCE = 4
|
||||
};
|
||||
|
||||
static int
|
||||
grub_hfsplus_cmp_attrkey (struct grub_hfsplus_key *keya,
|
||||
struct grub_hfsplus_key_internal *keyb)
|
||||
{
|
||||
struct grub_hfsplus_attrkey *attrkey_a = &keya->attrkey;
|
||||
struct grub_hfsplus_attrkey_internal *attrkey_b = &keyb->attrkey;
|
||||
grub_uint32_t aparent = grub_be_to_cpu32 (attrkey_a->cnid);
|
||||
grub_size_t len;
|
||||
int diff;
|
||||
|
||||
if (aparent > attrkey_b->cnid)
|
||||
return 1;
|
||||
if (aparent < attrkey_b->cnid)
|
||||
return -1;
|
||||
|
||||
len = grub_be_to_cpu16 (attrkey_a->namelen);
|
||||
if (len > attrkey_b->namelen)
|
||||
len = attrkey_b->namelen;
|
||||
/* Since it's big-endian memcmp gives the same result as manually comparing
|
||||
uint16_t but may be faster. */
|
||||
diff = grub_memcmp (attrkey_a->name, attrkey_b->name,
|
||||
len * sizeof (attrkey_a->name[0]));
|
||||
if (diff == 0)
|
||||
diff = grub_be_to_cpu16 (attrkey_a->namelen) - attrkey_b->namelen;
|
||||
return diff;
|
||||
}
|
||||
|
||||
#define HFSPLUS_COMPRESS_BLOCK_SIZE 65536
|
||||
|
||||
static grub_ssize_t
|
||||
hfsplus_read_compressed_real (struct grub_hfsplus_file *node,
|
||||
grub_off_t pos, grub_size_t len, char *buf)
|
||||
{
|
||||
char *tmp_buf = 0;
|
||||
grub_size_t len0 = len;
|
||||
|
||||
if (node->compressed == 1)
|
||||
{
|
||||
grub_memcpy (buf, node->cbuf + pos, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
while (len)
|
||||
{
|
||||
grub_uint32_t block = pos / HFSPLUS_COMPRESS_BLOCK_SIZE;
|
||||
grub_size_t curlen = HFSPLUS_COMPRESS_BLOCK_SIZE
|
||||
- (pos % HFSPLUS_COMPRESS_BLOCK_SIZE);
|
||||
|
||||
if (curlen > len)
|
||||
curlen = len;
|
||||
|
||||
if (node->cbuf_block != block)
|
||||
{
|
||||
grub_uint32_t sz = grub_le_to_cpu32 (node->compress_index[block].size);
|
||||
grub_size_t ts;
|
||||
if (!tmp_buf)
|
||||
tmp_buf = grub_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE);
|
||||
if (!tmp_buf)
|
||||
return -1;
|
||||
if (grub_hfsplus_read_file (node, 0, 0,
|
||||
grub_le_to_cpu32 (node->compress_index[block].start) + 0x104,
|
||||
sz, tmp_buf)
|
||||
!= (grub_ssize_t) sz)
|
||||
{
|
||||
grub_free (tmp_buf);
|
||||
return -1;
|
||||
}
|
||||
ts = HFSPLUS_COMPRESS_BLOCK_SIZE;
|
||||
if (ts > node->size - (pos & ~(HFSPLUS_COMPRESS_BLOCK_SIZE)))
|
||||
ts = node->size - (pos & ~(HFSPLUS_COMPRESS_BLOCK_SIZE));
|
||||
if (grub_zlib_decompress (tmp_buf, sz, 0,
|
||||
node->cbuf, ts) < 0)
|
||||
{
|
||||
grub_free (tmp_buf);
|
||||
return -1;
|
||||
}
|
||||
node->cbuf_block = block;
|
||||
}
|
||||
grub_memcpy (buf, node->cbuf + (pos % HFSPLUS_COMPRESS_BLOCK_SIZE),
|
||||
curlen);
|
||||
buf += curlen;
|
||||
pos += curlen;
|
||||
len -= curlen;
|
||||
}
|
||||
grub_free (tmp_buf);
|
||||
return len0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
hfsplus_open_compressed_real (struct grub_hfsplus_file *node)
|
||||
{
|
||||
grub_err_t err;
|
||||
struct grub_hfsplus_btnode *attr_node;
|
||||
grub_off_t attr_off;
|
||||
struct grub_hfsplus_key_internal key;
|
||||
struct grub_hfsplus_attr_header *attr_head;
|
||||
struct grub_hfsplus_compress_attr *cmp_head;
|
||||
#define c grub_cpu_to_be16_compile_time
|
||||
const grub_uint16_t compress_attr_name[] =
|
||||
{
|
||||
c('c'), c('o'), c('m'), c('.'), c('a'), c('p'), c('p'), c('l'), c('e'),
|
||||
c('.'), c('d'), c('e'), c('c'), c('m'), c('p'), c('f'), c('s') };
|
||||
#undef c
|
||||
if (node->size)
|
||||
return 0;
|
||||
|
||||
key.attrkey.cnid = node->fileid;
|
||||
key.attrkey.namelen = sizeof (compress_attr_name) / sizeof (compress_attr_name[0]);
|
||||
key.attrkey.name = compress_attr_name;
|
||||
|
||||
err = grub_hfsplus_btree_search (&node->data->attr_tree, &key,
|
||||
grub_hfsplus_cmp_attrkey,
|
||||
&attr_node, &attr_off);
|
||||
if (err || !attr_node)
|
||||
{
|
||||
grub_errno = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
attr_head = (struct grub_hfsplus_attr_header *)
|
||||
((char *) grub_hfsplus_btree_recptr (&node->data->attr_tree,
|
||||
attr_node, attr_off)
|
||||
+ sizeof (struct grub_hfsplus_attrkey) + sizeof (compress_attr_name));
|
||||
if (attr_head->type != 0x10
|
||||
|| !(attr_head->size & grub_cpu_to_be64_compile_time(~0xfULL)))
|
||||
{
|
||||
grub_free (attr_node);
|
||||
return 0;
|
||||
}
|
||||
cmp_head = (struct grub_hfsplus_compress_attr *) (attr_head + 1);
|
||||
if (cmp_head->magic != grub_cpu_to_be32_compile_time (0x66706d63))
|
||||
{
|
||||
grub_free (attr_node);
|
||||
return 0;
|
||||
}
|
||||
node->size = grub_le_to_cpu32 (cmp_head->uncompressed_inline_size);
|
||||
|
||||
if (cmp_head->type == grub_cpu_to_le32_compile_time (HFSPLUS_COMPRESSION_RESOURCE))
|
||||
{
|
||||
grub_uint32_t index_size;
|
||||
node->compressed = 2;
|
||||
|
||||
if (grub_hfsplus_read_file (node, 0, 0,
|
||||
0x104, sizeof (index_size),
|
||||
(char *) &index_size)
|
||||
!= 4)
|
||||
{
|
||||
node->compressed = 0;
|
||||
grub_free (attr_node);
|
||||
grub_errno = 0;
|
||||
return 0;
|
||||
}
|
||||
node->compress_index_size = grub_le_to_cpu32 (index_size);
|
||||
node->compress_index = grub_malloc (node->compress_index_size
|
||||
* sizeof (node->compress_index[0]));
|
||||
if (!node->compress_index)
|
||||
{
|
||||
node->compressed = 0;
|
||||
grub_free (attr_node);
|
||||
return grub_errno;
|
||||
}
|
||||
if (grub_hfsplus_read_file (node, 0, 0,
|
||||
0x104 + sizeof (index_size),
|
||||
node->compress_index_size
|
||||
* sizeof (node->compress_index[0]),
|
||||
(char *) node->compress_index)
|
||||
!= (grub_ssize_t) (node->compress_index_size
|
||||
* sizeof (node->compress_index[0])))
|
||||
{
|
||||
node->compressed = 0;
|
||||
grub_free (attr_node);
|
||||
grub_free (node->compress_index);
|
||||
grub_errno = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
node->cbuf_block = -1;
|
||||
|
||||
node->cbuf = grub_malloc (HFSPLUS_COMPRESS_BLOCK_SIZE);
|
||||
grub_free (attr_node);
|
||||
if (!node->cbuf)
|
||||
{
|
||||
node->compressed = 0;
|
||||
grub_free (node->compress_index);
|
||||
return grub_errno;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (cmp_head->type != HFSPLUS_COMPRESSION_INLINE)
|
||||
{
|
||||
grub_free (attr_node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
node->cbuf = grub_malloc (node->size);
|
||||
if (!node->cbuf)
|
||||
return grub_errno;
|
||||
|
||||
if (grub_zlib_decompress ((char *) (cmp_head + 1),
|
||||
grub_cpu_to_be64 (attr_head->size)
|
||||
- sizeof (*cmp_head), 0,
|
||||
node->cbuf, node->size) < 0)
|
||||
return grub_errno;
|
||||
node->compressed = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
GRUB_MOD_INIT(hfspluscomp)
|
||||
{
|
||||
grub_hfsplus_open_compressed = hfsplus_open_compressed_real;
|
||||
grub_hfsplus_read_compressed = hfsplus_read_compressed_real;
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(hfspluscomp)
|
||||
{
|
||||
grub_hfsplus_open_compressed = 0;
|
||||
grub_hfsplus_read_compressed = 0;
|
||||
}
|
|
@ -263,8 +263,8 @@ algo_decrypt (grub_crypto_cipher_handle_t cipher, grub_uint64_t algo,
|
|||
return grub_gcm_decrypt (cipher, out, in, psize, mac_out, nonce,
|
||||
15 - l, m);
|
||||
default:
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "algorithm %"
|
||||
PRIuGRUB_UINT64_T " is not supported yet", algo);
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "algorithm %lld is not supported yet",
|
||||
(long long) algo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ EOF
|
|||
| grep -v '^#' \
|
||||
| sed -n \
|
||||
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/ {"\1", \1, 1},/;p;}' \
|
||||
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/ {"\1", \&\1, 0},/;p;}' \
|
||||
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/ {"\1", (void *) \&\1, 0},/;p;}' \
|
||||
| sort -u
|
||||
|
||||
cat <<EOF
|
||||
|
|
|
@ -355,19 +355,30 @@ grub_mofile_open_lang (struct grub_gettext_context *ctx,
|
|||
return grub_errno;
|
||||
|
||||
err = grub_mofile_open (ctx, mo_file);
|
||||
grub_free (mo_file);
|
||||
|
||||
/* Will try adding .gz as well. */
|
||||
if (err)
|
||||
{
|
||||
char *mo_file_old;
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
mo_file_old = mo_file;
|
||||
mo_file = grub_xasprintf ("%s.gz", mo_file);
|
||||
grub_free (mo_file_old);
|
||||
mo_file = grub_xasprintf ("%s%s/%s.mo.gz", part1, part2, locale);
|
||||
if (!mo_file)
|
||||
return grub_errno;
|
||||
err = grub_mofile_open (ctx, mo_file);
|
||||
grub_free (mo_file);
|
||||
}
|
||||
|
||||
/* Will try adding .gmo as well. */
|
||||
if (err)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
mo_file = grub_xasprintf ("%s%s/%s.gmo", part1, part2, locale);
|
||||
if (!mo_file)
|
||||
return grub_errno;
|
||||
err = grub_mofile_open (ctx, mo_file);
|
||||
grub_free (mo_file);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ grub_font_draw_string (const char *str, grub_font_t font,
|
|||
int left_x, int baseline_y)
|
||||
{
|
||||
int x;
|
||||
struct grub_font_glyph *glyph;
|
||||
grub_uint32_t *logical;
|
||||
grub_ssize_t logical_len, visual_len;
|
||||
struct grub_unicode_glyph *visual, *ptr;
|
||||
|
@ -60,16 +59,18 @@ grub_font_draw_string (const char *str, grub_font_t font,
|
|||
for (ptr = visual, x = left_x; ptr < visual + visual_len; ptr++)
|
||||
{
|
||||
grub_err_t err;
|
||||
struct grub_font_glyph *glyph;
|
||||
glyph = grub_font_construct_glyph (font, ptr);
|
||||
if (!glyph)
|
||||
return grub_errno;
|
||||
err = grub_font_draw_glyph (glyph, color, x, baseline_y);
|
||||
x += glyph->device_width;
|
||||
grub_free (glyph);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
for (ptr = visual; ptr < visual + visual_len; ptr++)
|
||||
grub_unicode_destroy_glyph (ptr);
|
||||
grub_free (visual);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
@ -102,7 +103,7 @@ grub_font_get_string_width (grub_font_t font, const char *str)
|
|||
&glyph);
|
||||
width += grub_font_get_constructed_device_width (font, &glyph);
|
||||
|
||||
grub_free (glyph.combining);
|
||||
grub_unicode_destroy_glyph (&glyph);
|
||||
}
|
||||
grub_free (logical);
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
|
|||
{
|
||||
grub_gfxmenu_view_t view = NULL;
|
||||
const char *theme_path;
|
||||
char *full_theme_path = 0;
|
||||
struct grub_menu_viewer *instance;
|
||||
grub_err_t err;
|
||||
struct grub_video_mode_info mode_info;
|
||||
|
@ -70,15 +71,27 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
if (!cached_view || grub_strcmp (cached_view->theme_path, theme_path) != 0
|
||||
if (theme_path[0] != '/' && theme_path[0] != '(')
|
||||
{
|
||||
const char *prefix;
|
||||
prefix = grub_env_get ("prefix");
|
||||
full_theme_path = grub_xasprintf ("%s/themes/%s",
|
||||
prefix,
|
||||
theme_path);
|
||||
}
|
||||
|
||||
if (!cached_view || grub_strcmp (cached_view->theme_path,
|
||||
full_theme_path ? : theme_path) != 0
|
||||
|| cached_view->screen.width != mode_info.width
|
||||
|| cached_view->screen.height != mode_info.height)
|
||||
{
|
||||
grub_free (cached_view);
|
||||
grub_gfxmenu_view_destroy (cached_view);
|
||||
/* Create the view. */
|
||||
cached_view = grub_gfxmenu_view_new (theme_path, mode_info.width,
|
||||
cached_view = grub_gfxmenu_view_new (full_theme_path ? : theme_path,
|
||||
mode_info.width,
|
||||
mode_info.height);
|
||||
}
|
||||
grub_free (full_theme_path);
|
||||
|
||||
if (! cached_view)
|
||||
{
|
||||
|
|
|
@ -223,6 +223,25 @@ circprog_set_state (void *vself, int visible, int start,
|
|||
self->end = end;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_angle (const char *value)
|
||||
{
|
||||
char *ptr;
|
||||
int angle;
|
||||
|
||||
angle = grub_strtol (value, &ptr, 10);
|
||||
if (grub_errno)
|
||||
return 0;
|
||||
while (grub_isspace (*ptr))
|
||||
ptr++;
|
||||
if (grub_strcmp (ptr, "deg") == 0
|
||||
/* Unicode symbol of degrees (a circle, U+b0). Put here in UTF-8 to
|
||||
avoid potential problem with text file reesncoding */
|
||||
|| grub_strcmp (ptr, "\xc2\xb0") == 0)
|
||||
angle = (angle * 64 + 45) / 90;
|
||||
return angle;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
circprog_set_property (void *vself, const char *name, const char *value)
|
||||
{
|
||||
|
@ -233,7 +252,7 @@ circprog_set_property (void *vself, const char *name, const char *value)
|
|||
}
|
||||
else if (grub_strcmp (name, "start_angle") == 0)
|
||||
{
|
||||
self->start_angle = grub_strtol (value, 0, 10);
|
||||
self->start_angle = parse_angle (value);
|
||||
}
|
||||
else if (grub_strcmp (name, "ticks_disappear") == 0)
|
||||
{
|
||||
|
|
|
@ -83,7 +83,11 @@ list_destroy (void *vself)
|
|||
self->selected_item_box->destroy (self->selected_item_box);
|
||||
if (self->icon_manager)
|
||||
grub_gfxmenu_icon_manager_destroy (self->icon_manager);
|
||||
|
||||
if (self->scrollbar_thumb)
|
||||
self->scrollbar_thumb->destroy (self->scrollbar_thumb);
|
||||
if (self->scrollbar_frame)
|
||||
self->scrollbar_frame->destroy (self->scrollbar_frame);
|
||||
grub_free (self->scrollbar_thumb_pattern);
|
||||
grub_free (self);
|
||||
}
|
||||
|
||||
|
@ -541,6 +545,16 @@ list_set_view_info (void *vself,
|
|||
self->view = view;
|
||||
}
|
||||
|
||||
/* Refresh list variables */
|
||||
static void
|
||||
list_refresh_info (void *vself,
|
||||
grub_gfxmenu_view_t view)
|
||||
{
|
||||
list_impl_t self = vself;
|
||||
if (view->nested)
|
||||
self->first_shown_index = 0;
|
||||
}
|
||||
|
||||
static struct grub_gui_component_ops list_comp_ops =
|
||||
{
|
||||
.destroy = list_destroy,
|
||||
|
@ -557,7 +571,8 @@ static struct grub_gui_component_ops list_comp_ops =
|
|||
|
||||
static struct grub_gui_list_ops list_ops =
|
||||
{
|
||||
.set_view_info = list_set_view_info
|
||||
.set_view_info = list_set_view_info,
|
||||
.refresh_list = list_refresh_info
|
||||
};
|
||||
|
||||
grub_gui_component_t
|
||||
|
|
|
@ -59,6 +59,9 @@ static void
|
|||
progress_bar_destroy (void *vself)
|
||||
{
|
||||
grub_gui_progress_bar_t self = vself;
|
||||
grub_free (self->theme_dir);
|
||||
grub_free (self->template);
|
||||
grub_free (self->id);
|
||||
grub_gfxmenu_timeout_unregister ((grub_gui_component_t) self);
|
||||
grub_free (self);
|
||||
}
|
||||
|
@ -185,6 +188,7 @@ draw_text (grub_gui_progress_bar_t self)
|
|||
int y = ((height - grub_font_get_descent (font)) / 2
|
||||
+ grub_font_get_ascent (font) / 2);
|
||||
grub_font_draw_string (text, font, text_color, x, y);
|
||||
grub_free (text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,14 @@ grub_gfxmenu_view_new (const char *theme_path,
|
|||
if (! view)
|
||||
return 0;
|
||||
|
||||
while (grub_gfxmenu_timeout_notifications)
|
||||
{
|
||||
struct grub_gfxmenu_timeout_notify *p;
|
||||
p = grub_gfxmenu_timeout_notifications;
|
||||
grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next;
|
||||
grub_free (p);
|
||||
}
|
||||
|
||||
view->screen.x = 0;
|
||||
view->screen.y = 0;
|
||||
view->screen.width = width;
|
||||
|
@ -105,6 +113,13 @@ grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view)
|
|||
{
|
||||
if (!view)
|
||||
return;
|
||||
while (grub_gfxmenu_timeout_notifications)
|
||||
{
|
||||
struct grub_gfxmenu_timeout_notify *p;
|
||||
p = grub_gfxmenu_timeout_notifications;
|
||||
grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next;
|
||||
grub_free (p);
|
||||
}
|
||||
grub_video_bitmap_destroy (view->desktop_image);
|
||||
if (view->terminal_box)
|
||||
view->terminal_box->destroy (view->terminal_box);
|
||||
|
@ -236,6 +251,27 @@ update_menu_components (grub_gfxmenu_view_t view)
|
|||
update_menu_visit, view);
|
||||
}
|
||||
|
||||
static void
|
||||
refresh_menu_visit (grub_gui_component_t component,
|
||||
void *userdata)
|
||||
{
|
||||
grub_gfxmenu_view_t view;
|
||||
view = userdata;
|
||||
if (component->ops->is_instance (component, "list"))
|
||||
{
|
||||
grub_gui_list_t list = (grub_gui_list_t) component;
|
||||
list->ops->refresh_list (list, view);
|
||||
}
|
||||
}
|
||||
|
||||
/* Refresh list information (useful for submenus) */
|
||||
static void
|
||||
refresh_menu_components (grub_gfxmenu_view_t view)
|
||||
{
|
||||
grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
|
||||
refresh_menu_visit, view);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_message (grub_gfxmenu_view_t view)
|
||||
{
|
||||
|
@ -294,6 +330,7 @@ grub_gfxmenu_view_draw (grub_gfxmenu_view_t view)
|
|||
view->screen.x, view->screen.y,
|
||||
view->screen.width, view->screen.height);
|
||||
|
||||
refresh_menu_components (view);
|
||||
update_menu_components (view);
|
||||
|
||||
grub_gfxmenu_view_redraw (view, &view->screen);
|
||||
|
|
13
grub-core/gnulib-fix-null-deref.diff
Normal file
13
grub-core/gnulib-fix-null-deref.diff
Normal file
|
@ -0,0 +1,13 @@
|
|||
=== modified file 'grub-core/gnulib/argp-parse.c'
|
||||
--- grub-core/gnulib/argp-parse.c 2010-04-02 22:45:01 +0000
|
||||
+++ grub-core/gnulib/argp-parse.c 2011-04-10 13:25:52 +0000
|
||||
@@ -935,7 +935,7 @@
|
||||
void *
|
||||
__argp_input (const struct argp *argp, const struct argp_state *state)
|
||||
{
|
||||
- if (state)
|
||||
+ if (state && state->pstate)
|
||||
{
|
||||
struct group *group;
|
||||
struct parser *parser = state->pstate;
|
||||
|
231
grub-core/gnulib-fix-width.diff
Normal file
231
grub-core/gnulib-fix-width.diff
Normal file
|
@ -0,0 +1,231 @@
|
|||
diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c
|
||||
index 7aa317c..02406ff 100644
|
||||
--- a/lib/argp-fmtstream.c
|
||||
+++ b/lib/argp-fmtstream.c
|
||||
@@ -29,9 +29,11 @@
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
+#include <wchar.h>
|
||||
|
||||
#include "argp-fmtstream.h"
|
||||
#include "argp-namefrob.h"
|
||||
+#include "mbswidth.h"
|
||||
|
||||
#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
|
||||
|
||||
@@ -116,6 +118,51 @@ weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+
|
||||
+/* Return the pointer to the first character that doesn't fit in l columns. */
|
||||
+static inline const ptrdiff_t
|
||||
+add_width (const char *ptr, const char *end, size_t l)
|
||||
+{
|
||||
+ mbstate_t ps;
|
||||
+ const char *ptr0 = ptr;
|
||||
+
|
||||
+ memset (&ps, 0, sizeof (ps));
|
||||
+
|
||||
+ while (ptr < end)
|
||||
+ {
|
||||
+ wchar_t wc;
|
||||
+ size_t s, k;
|
||||
+
|
||||
+ s = mbrtowc (&wc, ptr, end - ptr, &ps);
|
||||
+ if (s == (size_t) -1)
|
||||
+ break;
|
||||
+ if (s == (size_t) -2)
|
||||
+ {
|
||||
+ if (1 >= l)
|
||||
+ break;
|
||||
+ l--;
|
||||
+ ptr++;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (wc == '\e' && ptr + 3 < end
|
||||
+ && ptr[1] == '[' && (ptr[2] == '0' || ptr[2] == '1')
|
||||
+ && ptr[3] == 'm')
|
||||
+ {
|
||||
+ ptr += 4;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ k = wcwidth (wc);
|
||||
+
|
||||
+ if (k >= l)
|
||||
+ break;
|
||||
+ l -= k;
|
||||
+ ptr += s;
|
||||
+ }
|
||||
+ return ptr - ptr0;
|
||||
+}
|
||||
+
|
||||
/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
|
||||
end of its buffer. This code is mostly from glibc stdio/linewrap.c. */
|
||||
void
|
||||
@@ -168,14 +215,15 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
|
||||
if (!nl)
|
||||
{
|
||||
+ size_t display_width = mbsnwidth (buf, fs->p - buf, MBSW_STOP_AT_NUL);
|
||||
/* The buffer ends in a partial line. */
|
||||
|
||||
- if (fs->point_col + len < fs->rmargin)
|
||||
+ if (fs->point_col + display_width < fs->rmargin)
|
||||
{
|
||||
/* The remaining buffer text is a partial line and fits
|
||||
within the maximum line width. Advance point for the
|
||||
characters to be written and stop scanning. */
|
||||
- fs->point_col += len;
|
||||
+ fs->point_col += display_width;
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -183,14 +231,18 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
the end of the buffer. */
|
||||
nl = fs->p;
|
||||
}
|
||||
- else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
|
||||
- {
|
||||
- /* The buffer contains a full line that fits within the maximum
|
||||
- line width. Reset point and scan the next line. */
|
||||
- fs->point_col = 0;
|
||||
- buf = nl + 1;
|
||||
- continue;
|
||||
- }
|
||||
+ else
|
||||
+ {
|
||||
+ size_t display_width = mbsnwidth (buf, nl - buf, MBSW_STOP_AT_NUL);
|
||||
+ if (display_width < (ssize_t) fs->rmargin)
|
||||
+ {
|
||||
+ /* The buffer contains a full line that fits within the maximum
|
||||
+ line width. Reset point and scan the next line. */
|
||||
+ fs->point_col = 0;
|
||||
+ buf = nl + 1;
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* This line is too long. */
|
||||
r = fs->rmargin - 1;
|
||||
@@ -226,7 +278,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
char *p, *nextline;
|
||||
int i;
|
||||
|
||||
- p = buf + (r + 1 - fs->point_col);
|
||||
+ p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col));
|
||||
while (p >= buf && !isblank ((unsigned char) *p))
|
||||
--p;
|
||||
nextline = p + 1; /* This will begin the next line. */
|
||||
@@ -244,7 +296,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
{
|
||||
/* A single word that is greater than the maximum line width.
|
||||
Oh well. Put it on an overlong line by itself. */
|
||||
- p = buf + (r + 1 - fs->point_col);
|
||||
+ p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col));
|
||||
/* Find the end of the long word. */
|
||||
if (p < nl)
|
||||
do
|
||||
@@ -278,7 +330,8 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
&& fs->p > nextline)
|
||||
{
|
||||
/* The margin needs more blanks than we removed. */
|
||||
- if (fs->end - fs->p > fs->wmargin + 1)
|
||||
+ if (mbsnwidth (fs->p, fs->end - fs->p, MBSW_STOP_AT_NUL)
|
||||
+ > fs->wmargin + 1)
|
||||
/* Make some space for them. */
|
||||
{
|
||||
size_t mv = fs->p - nextline;
|
||||
diff --git a/lib/argp-help.c b/lib/argp-help.c
|
||||
index 354f1e2..2914f47 100644
|
||||
--- a/lib/argp-help.c
|
||||
+++ b/lib/argp-help.c
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "argp.h"
|
||||
#include "argp-fmtstream.h"
|
||||
#include "argp-namefrob.h"
|
||||
+#include "mbswidth.h"
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t) -1)
|
||||
@@ -1452,7 +1453,7 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state,
|
||||
|
||||
/* Manually do line wrapping so that it (probably) won't get wrapped at
|
||||
any embedded spaces. */
|
||||
- space (stream, 1 + nl - cp);
|
||||
+ space (stream, 1 + mbsnwidth (cp, nl - cp, MBSW_STOP_AT_NUL));
|
||||
|
||||
__argp_fmtstream_write (stream, cp, nl - cp);
|
||||
}
|
||||
diff --git a/lib/mbswidth.c b/lib/mbswidth.c
|
||||
index 7c2dfce..baa4f27 100644
|
||||
--- a/lib/mbswidth.c
|
||||
+++ b/lib/mbswidth.c
|
||||
@@ -90,6 +90,9 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
|
||||
p++;
|
||||
width++;
|
||||
break;
|
||||
+ case '\0':
|
||||
+ if (flags & MBSW_STOP_AT_NUL)
|
||||
+ return width;
|
||||
default:
|
||||
/* If we have a multibyte sequence, scan it up to its end. */
|
||||
{
|
||||
@@ -168,6 +171,9 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
|
||||
{
|
||||
unsigned char c = (unsigned char) *p++;
|
||||
|
||||
+ if (c == 0 && (flags & MBSW_STOP_AT_NUL))
|
||||
+ return width;
|
||||
+
|
||||
if (isprint (c))
|
||||
{
|
||||
if (width == INT_MAX)
|
||||
diff --git a/lib/mbswidth.h b/lib/mbswidth.h
|
||||
index e9c0b03..d7207c5 100644
|
||||
--- a/lib/mbswidth.h
|
||||
+++ b/lib/mbswidth.h
|
||||
@@ -45,6 +45,9 @@ extern "C" {
|
||||
control characters and 1 otherwise. */
|
||||
#define MBSW_REJECT_UNPRINTABLE 2
|
||||
|
||||
+/* If this bit is set \0 is treated as the end of string.
|
||||
+ Otherwise it's treated as a normal one column width character. */
|
||||
+#define MBSW_STOP_AT_NUL 4
|
||||
|
||||
/* Returns the number of screen columns needed for STRING. */
|
||||
#define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */
|
||||
diff --git a/modules/argp b/modules/argp
|
||||
index 125046a..6f14d10 100644
|
||||
--- a/modules/argp
|
||||
+++ b/modules/argp
|
||||
@@ -40,6 +40,7 @@ stdalign
|
||||
strerror
|
||||
memchr
|
||||
memmove
|
||||
+mbswidth
|
||||
|
||||
configure.ac:
|
||||
gl_ARGP
|
||||
diff --git a/modules/argp-tests b/modules/argp-tests
|
||||
index 8f92a4d..0463927 100644
|
||||
--- a/modules/argp-tests
|
||||
+++ b/modules/argp-tests
|
||||
@@ -1,11 +1,13 @@
|
||||
Files:
|
||||
tests/test-argp.c
|
||||
tests/test-argp-2.sh
|
||||
+tests/test-argp-2-utf.sh
|
||||
|
||||
Depends-on:
|
||||
progname
|
||||
|
||||
Makefile.am:
|
||||
TESTS += test-argp test-argp-2.sh
|
||||
-check_PROGRAMS += test-argp
|
||||
+TESTS += test-argp test-argp-2.sh test-argp-2-utf.sh
|
||||
+check_PROGRAMS += test-argp test-argp-utf8
|
||||
test_argp_LDADD = $(LDADD) @LIBINTL@
|
30
grub-core/gnulib-no-abort.diff
Normal file
30
grub-core/gnulib-no-abort.diff
Normal file
|
@ -0,0 +1,30 @@
|
|||
=== modified file 'grub-core/gnulib/regcomp.c'
|
||||
--- grub-core/gnulib/regcomp.c 2010-09-20 10:35:33 +0000
|
||||
+++ grub-core/gnulib/regcomp.c 2012-03-10 11:31:42 +0000
|
||||
@@ -549,13 +549,9 @@ regerror (int errcode, const regex_t *_R
|
||||
if (BE (errcode < 0
|
||||
|| errcode >= (int) (sizeof (__re_error_msgid_idx)
|
||||
/ sizeof (__re_error_msgid_idx[0])), 0))
|
||||
- /* Only error codes returned by the rest of the code should be passed
|
||||
- to this routine. If we are given anything else, or if other regex
|
||||
- code generates an invalid error code, then the program has a bug.
|
||||
- Dump core so we can fix it. */
|
||||
- abort ();
|
||||
-
|
||||
- msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
|
||||
+ msg = gettext ("unknown regexp error");
|
||||
+ else
|
||||
+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
|
||||
|
||||
msg_size = strlen (msg) + 1; /* Includes the null. */
|
||||
|
||||
@@ -1119,7 +1119,7 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
- abort ();
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (mb_chars || has_period)
|
||||
|
10
grub-core/gnulib-no-gets.diff
Normal file
10
grub-core/gnulib-no-gets.diff
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- /tmp/x.diff 2013-04-11 16:51:42.777873536 +0200
|
||||
+++ grub-core/gnulib/stdio.in.h 2013-04-11 16:51:49.917873298 +0200
|
||||
@@ -700,7 +700,6 @@
|
||||
removed it. */
|
||||
#undef gets
|
||||
#if HAVE_RAW_DECL_GETS
|
||||
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -93,26 +93,15 @@ long i00afunc ();
|
|||
static int stack_dir; /* 1 or -1 once known. */
|
||||
# define STACK_DIR stack_dir
|
||||
|
||||
static void
|
||||
find_stack_direction (void)
|
||||
static int
|
||||
find_stack_direction (int *addr, int depth)
|
||||
{
|
||||
static char *addr = NULL; /* Address of first `dummy', once known. */
|
||||
auto char dummy; /* To get stack address. */
|
||||
|
||||
if (addr == NULL)
|
||||
{ /* Initial entry. */
|
||||
addr = ADDRESS_FUNCTION (dummy);
|
||||
|
||||
find_stack_direction (); /* Recurse once. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second entry. */
|
||||
if (ADDRESS_FUNCTION (dummy) > addr)
|
||||
stack_dir = 1; /* Stack grew upward. */
|
||||
else
|
||||
stack_dir = -1; /* Stack grew downward. */
|
||||
}
|
||||
int dir, dummy = 0;
|
||||
if (! addr)
|
||||
addr = &dummy;
|
||||
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
|
||||
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
|
||||
return dir + dummy;
|
||||
}
|
||||
|
||||
# endif /* STACK_DIRECTION == 0 */
|
||||
|
@ -155,7 +144,7 @@ alloca (size_t size)
|
|||
|
||||
# if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
find_stack_direction ();
|
||||
STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
|
||||
# endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
|
@ -486,4 +475,4 @@ i00afunc (long address)
|
|||
# endif /* CRAY */
|
||||
|
||||
# endif /* no alloca */
|
||||
#endif /* not GCC version 3 */
|
||||
#endif /* not GCC 2 */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Memory allocation on the stack.
|
||||
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -14,9 +14,9 @@
|
|||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
License along with this program; if not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
|
||||
means there is a real alloca function. */
|
||||
|
@ -44,6 +44,13 @@
|
|||
# define alloca _alloca
|
||||
# elif defined __DECC && defined __VMS
|
||||
# define alloca __ALLOCA
|
||||
# elif defined __TANDEM && defined _TNS_E_TARGET
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *_alloca (unsigned short);
|
||||
# pragma intrinsic (_alloca)
|
||||
# define alloca _alloca
|
||||
# else
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
|
||||
Copyright (C) 1996, 1997, 1999, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1997, 1999, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -19,11 +19,11 @@
|
|||
/* If set by the user program, it should point to string that is the
|
||||
bug-reporting address for the program. It will be printed by argp_help if
|
||||
the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
|
||||
messages), embedded in a sentence that says something like `Report bugs to
|
||||
ADDR.'. */
|
||||
messages), embedded in a sentence that says something like "Report bugs to
|
||||
ADDR." */
|
||||
const char *argp_program_bug_address
|
||||
/* This variable should be zero-initialized. On most systems, putting it into
|
||||
BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
|
||||
BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
|
||||
#if defined __ELF__
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Default definition for ARGP_ERR_EXIT_STATUS
|
||||
Copyright (C) 1997, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Word-wrapping and line-truncating streams
|
||||
Copyright (C) 1997-1999, 2001-2003, 2005, 2009-2010 Free Software
|
||||
Copyright (C) 1997-1999, 2001-2003, 2005, 2009-2013 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
@ -17,7 +17,7 @@
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This package emulates glibc `line_wrap_stream' semantics for systems that
|
||||
/* This package emulates glibc 'line_wrap_stream' semantics for systems that
|
||||
don't have that. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "argp-fmtstream.h"
|
||||
#include "argp-namefrob.h"
|
||||
#include "mbswidth.h"
|
||||
|
||||
#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
|
||||
|
||||
|
@ -118,37 +119,16 @@ weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
|
|||
#endif
|
||||
|
||||
|
||||
size_t
|
||||
__argp_get_display_len (const char *beg, const char *end)
|
||||
/* Return the pointer to the first character that doesn't fit in l columns. */
|
||||
static inline const ptrdiff_t
|
||||
add_width (const char *ptr, const char *end, size_t l)
|
||||
{
|
||||
const char *ptr;
|
||||
size_t r = 0;
|
||||
mbstate_t ps;
|
||||
const char *ptr0 = ptr;
|
||||
|
||||
memset (&ps, 0, sizeof (ps));
|
||||
|
||||
for (ptr = beg; ptr < end && *ptr; )
|
||||
{
|
||||
wchar_t wc;
|
||||
size_t s;
|
||||
|
||||
s = mbrtowc (&wc, ptr, end - ptr, &ps);
|
||||
if (s == (size_t) -1)
|
||||
break;
|
||||
r += wcwidth (wc);
|
||||
ptr += s;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline char *
|
||||
add_length (char *ptr, char *end, size_t l)
|
||||
{
|
||||
mbstate_t ps;
|
||||
|
||||
memset (&ps, 0, sizeof (ps));
|
||||
|
||||
while (ptr < end && *ptr)
|
||||
while (ptr < end)
|
||||
{
|
||||
wchar_t wc;
|
||||
size_t s, k;
|
||||
|
@ -156,13 +136,31 @@ add_length (char *ptr, char *end, size_t l)
|
|||
s = mbrtowc (&wc, ptr, end - ptr, &ps);
|
||||
if (s == (size_t) -1)
|
||||
break;
|
||||
if (s == (size_t) -2)
|
||||
{
|
||||
if (1 >= l)
|
||||
break;
|
||||
l--;
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (wc == '\e' && ptr + 3 < end
|
||||
&& ptr[1] == '[' && (ptr[2] == '0' || ptr[2] == '1')
|
||||
&& ptr[3] == 'm')
|
||||
{
|
||||
ptr += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
k = wcwidth (wc);
|
||||
|
||||
if (k >= l)
|
||||
break;
|
||||
l -= k;
|
||||
ptr += s;
|
||||
}
|
||||
return ptr;
|
||||
return ptr - ptr0;
|
||||
}
|
||||
|
||||
/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
|
||||
|
@ -217,15 +215,15 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
|||
|
||||
if (!nl)
|
||||
{
|
||||
size_t display_len = __argp_get_display_len (buf, fs->p);
|
||||
size_t display_width = mbsnwidth (buf, fs->p - buf, MBSW_STOP_AT_NUL);
|
||||
/* The buffer ends in a partial line. */
|
||||
|
||||
if (fs->point_col + display_len < fs->rmargin)
|
||||
if (fs->point_col + display_width < fs->rmargin)
|
||||
{
|
||||
/* The remaining buffer text is a partial line and fits
|
||||
within the maximum line width. Advance point for the
|
||||
characters to be written and stop scanning. */
|
||||
fs->point_col += display_len;
|
||||
fs->point_col += display_width;
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -235,8 +233,8 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
|||
}
|
||||
else
|
||||
{
|
||||
size_t display_len = __argp_get_display_len (buf, nl);
|
||||
if (display_len < (ssize_t) fs->rmargin)
|
||||
size_t display_width = mbsnwidth (buf, nl - buf, MBSW_STOP_AT_NUL);
|
||||
if (display_width < (ssize_t) fs->rmargin)
|
||||
{
|
||||
/* The buffer contains a full line that fits within the maximum
|
||||
line width. Reset point and scan the next line. */
|
||||
|
@ -280,7 +278,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
|||
char *p, *nextline;
|
||||
int i;
|
||||
|
||||
p = add_length (buf, fs->p, (r + 1 - fs->point_col));
|
||||
p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col));
|
||||
while (p >= buf && !isblank ((unsigned char) *p))
|
||||
--p;
|
||||
nextline = p + 1; /* This will begin the next line. */
|
||||
|
@ -298,7 +296,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
|||
{
|
||||
/* A single word that is greater than the maximum line width.
|
||||
Oh well. Put it on an overlong line by itself. */
|
||||
p = add_length (buf, fs->p, (r + 1 - fs->point_col));
|
||||
p = buf + add_width (buf, fs->p, (r + 1 - fs->point_col));
|
||||
/* Find the end of the long word. */
|
||||
if (p < nl)
|
||||
do
|
||||
|
@ -332,7 +330,8 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
|||
&& fs->p > nextline)
|
||||
{
|
||||
/* The margin needs more blanks than we removed. */
|
||||
if (__argp_get_display_len (fs->p, fs->end) > fs->wmargin + 1)
|
||||
if (mbsnwidth (fs->p, fs->end - fs->p, MBSW_STOP_AT_NUL)
|
||||
> fs->wmargin + 1)
|
||||
/* Make some space for them. */
|
||||
{
|
||||
size_t mv = fs->p - nextline;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Word-wrapping and line-truncating streams.
|
||||
Copyright (C) 1997, 2006-2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2006-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This package emulates glibc `line_wrap_stream' semantics for systems that
|
||||
/* This package emulates glibc 'line_wrap_stream' semantics for systems that
|
||||
don't have that. If the system does have it, it is just a wrapper for
|
||||
that. This header file is only used internally while compiling argp, and
|
||||
shouldn't be installed. */
|
||||
|
@ -28,16 +28,16 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef __attribute__
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
The __-protected variants of the attributes 'format' and 'printf' are
|
||||
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
|
||||
We enable __attribute__ only if these are supported too, because
|
||||
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
|
||||
gnulib and libintl do '#define printf __printf__' when they override
|
||||
the 'printf' function. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
|
||||
#endif
|
||||
|
||||
#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
|
||||
|
@ -128,12 +128,12 @@ extern void argp_fmtstream_free (argp_fmtstream_t __fs);
|
|||
|
||||
extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
|
||||
const char *__fmt, ...)
|
||||
__attribute__ ((__format__ (printf, 2, 3)));
|
||||
_GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
|
||||
extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
|
||||
const char *__fmt, ...)
|
||||
__attribute__ ((__format__ (printf, 2, 3)));
|
||||
_GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
|
||||
|
||||
#if _LIBC || !defined __OPTIMIZE__
|
||||
#if _LIBC
|
||||
extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
|
||||
extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
|
||||
|
||||
|
@ -154,7 +154,7 @@ extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
|
|||
#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
|
||||
#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
|
||||
|
||||
#if _LIBC || !defined __OPTIMIZE__
|
||||
#if _LIBC
|
||||
/* Set __FS's left margin to LMARGIN and return the old value. */
|
||||
extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
|
||||
size_t __lmargin);
|
||||
|
@ -184,7 +184,7 @@ extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
|
|||
extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
|
||||
extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
#if !_LIBC || defined __OPTIMIZE__
|
||||
/* Inline versions of above routines. */
|
||||
|
||||
#if !_LIBC
|
||||
|
@ -197,6 +197,10 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
|
|||
#define __argp_fmtstream_point argp_fmtstream_point
|
||||
#define __argp_fmtstream_update _argp_fmtstream_update
|
||||
#define __argp_fmtstream_ensure _argp_fmtstream_ensure
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef ARGP_FS_EI
|
||||
# define ARGP_FS_EI _GL_INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ARGP_FS_EI
|
||||
|
@ -335,9 +339,6 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
|
|||
return __fs->point_col >= 0 ? __fs->point_col : 0;
|
||||
}
|
||||
|
||||
size_t
|
||||
__argp_get_display_len (const char *beg, const char *end);
|
||||
|
||||
#if !_LIBC
|
||||
#undef __argp_fmtstream_putc
|
||||
#undef __argp_fmtstream_puts
|
||||
|
@ -348,9 +349,10 @@ __argp_get_display_len (const char *beg, const char *end);
|
|||
#undef __argp_fmtstream_point
|
||||
#undef __argp_fmtstream_update
|
||||
#undef __argp_fmtstream_ensure
|
||||
_GL_INLINE_HEADER_END
|
||||
#endif
|
||||
|
||||
#endif /* __OPTIMIZE__ */
|
||||
#endif /* !_LIBC || __OPTIMIZE__ */
|
||||
|
||||
#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Real definitions for extern inline functions in argp-fmtstream.h
|
||||
Copyright (C) 1997, 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2003-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -20,7 +20,11 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define ARGP_FS_EI
|
||||
#ifdef _LIBC
|
||||
# define ARGP_FS_EI
|
||||
#else
|
||||
# define ARGP_FS_EI _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#undef __OPTIMIZE__
|
||||
#define __OPTIMIZE__ 1
|
||||
#include "argp-fmtstream.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Hierarchial argument parsing help output
|
||||
Copyright (C) 1995-2005, 2007, 2009-2010 Free Software Foundation, Inc.
|
||||
/* Hierarchical argument parsing help output
|
||||
Copyright (C) 1995-2005, 2007, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
@ -49,6 +50,7 @@
|
|||
#include "argp.h"
|
||||
#include "argp-fmtstream.h"
|
||||
#include "argp-namefrob.h"
|
||||
#include "mbswidth.h"
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t) -1)
|
||||
|
@ -56,7 +58,7 @@
|
|||
|
||||
/* User-selectable (using an environment variable) formatting parameters.
|
||||
|
||||
These may be specified in an environment variable called `ARGP_HELP_FMT',
|
||||
These may be specified in an environment variable called 'ARGP_HELP_FMT',
|
||||
with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
|
||||
Where VALn must be a positive integer. The list of variables is in the
|
||||
UPARAM_NAMES vector, below. */
|
||||
|
@ -73,13 +75,13 @@
|
|||
#define RMARGIN 79 /* right margin used for wrapping */
|
||||
|
||||
/* User-selectable (using an environment variable) formatting parameters.
|
||||
They must all be of type `int' for the parsing code to work. */
|
||||
They must all be of type 'int' for the parsing code to work. */
|
||||
struct uparams
|
||||
{
|
||||
/* If true, arguments for an option are shown with both short and long
|
||||
options, even when a given option has both, e.g. `-x ARG, --longx=ARG'.
|
||||
options, even when a given option has both, e.g. '-x ARG, --longx=ARG'.
|
||||
If false, then if an option has both, the argument is only shown with
|
||||
the long one, e.g., `-x, --longx=ARG', and a message indicating that
|
||||
the long one, e.g., '-x, --longx=ARG', and a message indicating that
|
||||
this really means both is printed below the options. */
|
||||
int dup_args;
|
||||
|
||||
|
@ -111,7 +113,7 @@ static struct uparams uparams = {
|
|||
struct uparam_name
|
||||
{
|
||||
const char *name; /* User name. */
|
||||
int is_bool; /* Whether it's `boolean'. */
|
||||
int is_bool; /* Whether it's 'boolean'. */
|
||||
size_t uparams_offs; /* Location of the (int) field in UPARAMS. */
|
||||
};
|
||||
|
||||
|
@ -154,7 +156,7 @@ ARGP_HELP_FMT: %s value is less than or equal to %s"),
|
|||
uparams.valid = 1;
|
||||
}
|
||||
|
||||
/* Read user options from the environment, and fill in UPARAMS appropiately. */
|
||||
/* Read user options from the environment, and fill in UPARAMS appropriately. */
|
||||
static void
|
||||
fill_in_uparams (const struct argp_state *state)
|
||||
{
|
||||
|
@ -259,7 +261,7 @@ fill_in_uparams (const struct argp_state *state)
|
|||
/* Returns true if OPT is an alias for an earlier option. */
|
||||
#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
|
||||
|
||||
/* Returns true if OPT is an documentation-only entry. */
|
||||
/* Returns true if OPT is a documentation-only entry. */
|
||||
#define odoc(opt) ((opt)->flags & OPTION_DOC)
|
||||
|
||||
/* Returns true if OPT should not be translated */
|
||||
|
@ -277,11 +279,11 @@ fill_in_uparams (const struct argp_state *state)
|
|||
-xARG, -yARG, --long1=ARG, --long2=ARG Documentation...
|
||||
|
||||
Where ARG will be omitted if there's no argument, for this option, or
|
||||
will be surrounded by "[" and "]" appropiately if the argument is
|
||||
optional. The documentation string is word-wrapped appropiately, and if
|
||||
will be surrounded by "[" and "]" appropriately if the argument is
|
||||
optional. The documentation string is word-wrapped appropriately, and if
|
||||
the list of options is long enough, it will be started on a separate line.
|
||||
If there are no short options for a given option, the first long option is
|
||||
indented slighly in a way that's supposed to make most long options appear
|
||||
indented slightly in a way that's supposed to make most long options appear
|
||||
to be in a separate column.
|
||||
|
||||
For example, the following output (from ps):
|
||||
|
@ -359,7 +361,7 @@ struct hol_entry
|
|||
/* A pointers into the HOL's short_options field, to the first short option
|
||||
letter for this entry. The order of the characters following this point
|
||||
corresponds to the order of options pointed to by OPT, and there are at
|
||||
most NUM. A short option recorded in a option following OPT is only
|
||||
most NUM. A short option recorded in an option following OPT is only
|
||||
valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
|
||||
probably been shadowed by some other entry). */
|
||||
char *short_options;
|
||||
|
@ -570,7 +572,9 @@ hol_entry_short_iterate (const struct hol_entry *entry,
|
|||
}
|
||||
|
||||
static inline int
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((always_inline))
|
||||
#endif
|
||||
hol_entry_long_iterate (const struct hol_entry *entry,
|
||||
int (*func)(const struct argp_option *opt,
|
||||
const struct argp_option *real,
|
||||
|
@ -711,7 +715,7 @@ hol_cluster_is_child (const struct hol_cluster *cl1,
|
|||
return cl1 == cl2;
|
||||
}
|
||||
|
||||
/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail
|
||||
/* Given the name of an OPTION_DOC option, modifies NAME to start at the tail
|
||||
that should be used for comparisons, and returns true iff it should be
|
||||
treated as a non-option. */
|
||||
static int
|
||||
|
@ -726,7 +730,7 @@ canon_doc_option (const char **name)
|
|||
/* Skip initial whitespace. */
|
||||
while (isspace ((unsigned char) **name))
|
||||
(*name)++;
|
||||
/* Decide whether this looks like an option (leading `-') or not. */
|
||||
/* Decide whether this looks like an option (leading '-') or not. */
|
||||
non_opt = (**name != '-');
|
||||
/* Skip until part of name used for sorting. */
|
||||
while (**name && !isalnum ((unsigned char) **name))
|
||||
|
@ -751,9 +755,9 @@ hol_entry_cmp (const struct hol_entry *entry1,
|
|||
if (entry1->cluster != entry2->cluster)
|
||||
{
|
||||
/* The entries are not within the same cluster, so we can't compare them
|
||||
directly, we have to use the appropiate clustering level too. */
|
||||
directly, we have to use the appropriate clustering level too. */
|
||||
if (! entry1->cluster)
|
||||
/* ENTRY1 is at the `base level', not in a cluster, so we have to
|
||||
/* ENTRY1 is at the "base level", not in a cluster, so we have to
|
||||
compare it's group number with that of the base cluster in which
|
||||
ENTRY2 resides. Note that if they're in the same group, the
|
||||
clustered option always comes laster. */
|
||||
|
@ -783,7 +787,7 @@ hol_entry_cmp (const struct hol_entry *entry1,
|
|||
doc2 = canon_doc_option (&long2);
|
||||
|
||||
if (doc1 != doc2)
|
||||
/* `documentation' options always follow normal options (or
|
||||
/* "documentation" options always follow normal options (or
|
||||
documentation options that *look* like normal options). */
|
||||
return doc1 - doc2;
|
||||
else if (!short1 && !short2 && long1 && long2)
|
||||
|
@ -889,7 +893,8 @@ hol_append (struct hol *hol, struct hol *more)
|
|||
|
||||
/* Fix up the short options pointers from HOL. */
|
||||
for (e = entries, left = hol->num_entries; left > 0; e++, left--)
|
||||
e->short_options += (short_options - hol->short_options);
|
||||
e->short_options =
|
||||
short_options + (e->short_options - hol->short_options);
|
||||
|
||||
/* Now add the short options from MORE, fixing up its entries
|
||||
too. */
|
||||
|
@ -1020,7 +1025,7 @@ filter_doc (const char *doc, int key, const struct argp *argp,
|
|||
return doc;
|
||||
}
|
||||
|
||||
/* Prints STR as a header line, with the margin lines set appropiately, and
|
||||
/* Prints STR as a header line, with the margin lines set appropriately, and
|
||||
notes the fact that groups should be separated with a blank line. ARGP is
|
||||
the argp that should dictate any user doc filtering to take place. Note
|
||||
that the previous wrap margin isn't restored, but the left margin is reset
|
||||
|
@ -1142,7 +1147,7 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
|
|||
|
||||
/* Now, long options. */
|
||||
if (odoc (real))
|
||||
/* A `documentation' option. */
|
||||
/* A "documentation" option. */
|
||||
{
|
||||
__argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
|
||||
for (opt = real, num = entry->num; num > 0; opt++, num--)
|
||||
|
@ -1436,7 +1441,7 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state,
|
|||
const char *cp = fdoc;
|
||||
nl = __strchrnul (cp, '\n');
|
||||
if (*nl != '\0')
|
||||
/* This is a `multi-level' args doc; advance to the correct position
|
||||
/* This is a "multi-level" args doc; advance to the correct position
|
||||
as determined by our state in LEVELS, and update LEVELS. */
|
||||
{
|
||||
int i;
|
||||
|
@ -1448,7 +1453,7 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state,
|
|||
|
||||
/* Manually do line wrapping so that it (probably) won't get wrapped at
|
||||
any embedded spaces. */
|
||||
space (stream, 1 + __argp_get_display_len (cp, nl));
|
||||
space (stream, 1 + mbsnwidth (cp, nl - cp, MBSW_STOP_AT_NUL));
|
||||
|
||||
__argp_fmtstream_write (stream, cp, nl - cp);
|
||||
}
|
||||
|
@ -1477,9 +1482,9 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state,
|
|||
}
|
||||
|
||||
/* Print the documentation for ARGP to STREAM; if POST is false, then
|
||||
everything preceeding a `\v' character in the documentation strings (or
|
||||
everything preceding a '\v' character in the documentation strings (or
|
||||
the whole string, for those with none) is printed, otherwise, everything
|
||||
following the `\v' character (nothing for strings without). Each separate
|
||||
following the '\v' character (nothing for strings without). Each separate
|
||||
bit of documentation is separated a blank line, and if PRE_BLANK is true,
|
||||
then the first is as well. If FIRST_ONLY is true, only the first
|
||||
occurrence is output. Returns true if anything was output. */
|
||||
|
@ -1549,7 +1554,7 @@ argp_doc (const struct argp *argp, const struct argp_state *state,
|
|||
free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */
|
||||
|
||||
if (post && argp->help_filter)
|
||||
/* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */
|
||||
/* Now see if we have to output an ARGP_KEY_HELP_EXTRA text. */
|
||||
{
|
||||
text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
|
||||
if (text)
|
||||
|
@ -1576,8 +1581,8 @@ argp_doc (const struct argp *argp, const struct argp_state *state,
|
|||
}
|
||||
|
||||
/* Output a usage message for ARGP to STREAM. If called from
|
||||
argp_state_help, STATE is the relevent parsing state. FLAGS are from the
|
||||
set ARGP_HELP_*. NAME is what to use wherever a `program name' is
|
||||
argp_state_help, STATE is the relevant parsing state. FLAGS are from the
|
||||
set ARGP_HELP_*. NAME is what to use wherever a "program name" is
|
||||
needed. */
|
||||
static void
|
||||
_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
|
||||
|
@ -1618,7 +1623,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
|
|||
}
|
||||
|
||||
if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
|
||||
/* Print a short `Usage:' message. */
|
||||
/* Print a short "Usage:" message. */
|
||||
{
|
||||
int first_pattern = 1, more_patterns;
|
||||
size_t num_pattern_levels = argp_args_levels (argp);
|
||||
|
@ -1678,7 +1683,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
|
|||
if (flags & ARGP_HELP_SEE)
|
||||
{
|
||||
__argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\
|
||||
Try `%s --help' or `%s --usage' for more information.\n"),
|
||||
Try '%s --help' or '%s --usage' for more information.\n"),
|
||||
name, name);
|
||||
anything = 1;
|
||||
}
|
||||
|
@ -1721,7 +1726,7 @@ Try `%s --help' or `%s --usage' for more information.\n"),
|
|||
}
|
||||
|
||||
/* Output a usage message for ARGP to STREAM. FLAGS are from the set
|
||||
ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */
|
||||
ARGP_HELP_*. NAME is what to use wherever a "program name" is needed. */
|
||||
void __argp_help (const struct argp *argp, FILE *stream,
|
||||
unsigned flags, char *name)
|
||||
{
|
||||
|
@ -1779,7 +1784,7 @@ weak_alias (__argp_state_help, argp_state_help)
|
|||
#endif
|
||||
|
||||
/* If appropriate, print the printf string FMT and following args, preceded
|
||||
by the program name and `:', to stderr, and followed by a `Try ... --help'
|
||||
by the program name and ':', to stderr, and followed by a "Try ... --help"
|
||||
message, then exit (1). */
|
||||
void
|
||||
__argp_error (const struct argp_state *state, const char *fmt, ...)
|
||||
|
@ -1915,7 +1920,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
|
|||
char const *s = NULL;
|
||||
putc_unlocked (':', stream);
|
||||
putc_unlocked (' ', stream);
|
||||
#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P)
|
||||
#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P && !defined strerror_r)
|
||||
s = __strerror_r (errnum, buf, sizeof buf);
|
||||
#elif HAVE_DECL_STRERROR_R
|
||||
if (__strerror_r (errnum, buf, sizeof buf) == 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Name frobnication for compiling argp outside of glibc
|
||||
Copyright (C) 1997, 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2003, 2007, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -100,45 +100,45 @@
|
|||
#endif
|
||||
#if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
|
||||
# define feof_unlocked(x) feof (x)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
|
||||
# define ferror_unlocked(x) ferror (x)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
|
||||
# define fflush_unlocked(x) fflush (x)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
|
||||
# define fgets_unlocked(x,y,z) fgets (x,y,z)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED
|
||||
# define fputc_unlocked(x,y) fputc (x,y)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
|
||||
# define fputs_unlocked(x,y) fputs (x,y)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
|
||||
# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
|
||||
# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED
|
||||
# define getc_unlocked(x) getc (x)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED
|
||||
# define getchar_unlocked() getchar ()
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED
|
||||
# define putc_unlocked(x,y) putc (x,y)
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED
|
||||
# define putchar_unlocked(x) putchar (x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* !_LIBC */
|
||||
|
||||
#ifndef __set_errno
|
||||
#define __set_errno(e) (errno = (e))
|
||||
# define __set_errno(e) (errno = (e))
|
||||
#endif
|
||||
|
||||
#if defined GNULIB_ARGP_DISABLE_DIRNAME
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Hierarchial argument parsing, layered over getopt
|
||||
Copyright (C) 1995-2000, 2002-2004, 2009-2010 Free Software Foundation, Inc.
|
||||
/* Hierarchical argument parsing, layered over getopt
|
||||
Copyright (C) 1995-2000, 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
|||
#endif
|
||||
|
||||
#include <alloca.h>
|
||||
#include <stdalign.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -42,7 +43,6 @@
|
|||
#include "argp.h"
|
||||
#include "argp-namefrob.h"
|
||||
|
||||
#define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d))
|
||||
|
||||
/* Getopt return values. */
|
||||
|
@ -154,8 +154,9 @@ argp_version_parser (int key, char *arg, struct argp_state *state)
|
|||
else if (argp_program_version)
|
||||
fprintf (state->out_stream, "%s\n", argp_program_version);
|
||||
else
|
||||
__argp_error (state, dgettext (state->root_argp->argp_domain,
|
||||
"(PROGRAM ERROR) No version known!?"));
|
||||
__argp_error (state, "%s",
|
||||
dgettext (state->root_argp->argp_domain,
|
||||
"(PROGRAM ERROR) No version known!?"));
|
||||
if (! (state->flags & ARGP_NO_EXIT))
|
||||
exit (0);
|
||||
break;
|
||||
|
@ -187,7 +188,7 @@ find_long_option (struct option *long_options, const char *name)
|
|||
}
|
||||
|
||||
|
||||
/* The state of a `group' during parsing. Each group corresponds to a
|
||||
/* The state of a "group" during parsing. Each group corresponds to a
|
||||
particular argp structure from the tree of such descending from the top
|
||||
level argp passed to argp_parse. */
|
||||
struct group
|
||||
|
@ -203,7 +204,7 @@ struct group
|
|||
particular short options is from. */
|
||||
char *short_end;
|
||||
|
||||
/* The number of non-option args sucessfully handled by this parser. */
|
||||
/* The number of non-option args successfully handled by this parser. */
|
||||
unsigned args_processed;
|
||||
|
||||
/* This group's parser's parent's group. */
|
||||
|
@ -254,7 +255,7 @@ struct parser
|
|||
struct group *groups;
|
||||
/* The end of the GROUPS array. */
|
||||
struct group *egroup;
|
||||
/* An vector containing storage for the CHILD_INPUTS field in all groups. */
|
||||
/* A vector containing storage for the CHILD_INPUTS field in all groups. */
|
||||
void **child_inputs;
|
||||
|
||||
/* True if we think using getopt is still useful; if false, then
|
||||
|
@ -385,7 +386,7 @@ convert_options (const struct argp *argp,
|
|||
return group;
|
||||
}
|
||||
|
||||
/* Find the merged set of getopt options, with keys appropiately prefixed. */
|
||||
/* Find the merged set of getopt options, with keys appropriately prefixed. */
|
||||
static void
|
||||
parser_convert (struct parser *parser, const struct argp *argp, int flags)
|
||||
{
|
||||
|
@ -439,7 +440,7 @@ calc_sizes (const struct argp *argp, struct parser_sizes *szs)
|
|||
int num_opts = 0;
|
||||
while (!__option_is_end (opt++))
|
||||
num_opts++;
|
||||
szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */
|
||||
szs->short_len += num_opts * 3; /* opt + up to 2 ':'s */
|
||||
szs->long_len += num_opts;
|
||||
}
|
||||
}
|
||||
|
@ -781,7 +782,7 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
|
|||
|
||||
if (parser->state.quoted && parser->state.next < parser->state.quoted)
|
||||
/* The next argument pointer has been moved to before the quoted
|
||||
region, so pretend we never saw the quoting `--', and give getopt
|
||||
region, so pretend we never saw the quoting "--", and give getopt
|
||||
another chance. If the user hasn't removed it, getopt will just
|
||||
process it again. */
|
||||
parser->state.quoted = 0;
|
||||
|
@ -813,7 +814,7 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
|
|||
&& strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
|
||||
== 0)
|
||||
/* Not only is this the end of the options, but it's a
|
||||
`quoted' region, which may have args that *look* like
|
||||
"quoted" region, which may have args that *look* like
|
||||
options, so we definitely shouldn't try to use getopt past
|
||||
here, whatever happens. */
|
||||
parser->state.quoted = parser->state.next;
|
||||
|
@ -879,11 +880,11 @@ __argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
|
|||
#ifndef _LIBC
|
||||
if (!(flags & ARGP_PARSE_ARGV0))
|
||||
{
|
||||
#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
|
||||
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
|
||||
if (!program_invocation_name)
|
||||
program_invocation_name = argv[0];
|
||||
#endif
|
||||
#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
|
||||
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
|
||||
if (!program_invocation_short_name)
|
||||
program_invocation_short_name = __argp_base_name (argv[0]);
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Full and short program names for argp module
|
||||
Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -24,4 +24,3 @@ char *program_invocation_short_name = 0;
|
|||
#ifndef HAVE_PROGRAM_INVOCATION_NAME
|
||||
char *program_invocation_name = 0;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Default definition for ARGP_PROGRAM_VERSION.
|
||||
Copyright (C) 1996, 1997, 1999, 2006, 2009, 2010 Free Software Foundation,
|
||||
Copyright (C) 1996-1997, 1999, 2006, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
@ -23,7 +23,7 @@
|
|||
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
|
||||
const char *argp_program_version
|
||||
/* This variable should be zero-initialized. On most systems, putting it into
|
||||
BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
|
||||
BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
|
||||
#if defined __ELF__
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
|
||||
Copyright (C) 1996, 1997, 1999, 2004, 2009, 2010 Free Software Foundation,
|
||||
Copyright (C) 1996-1997, 1999, 2004, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Real definitions for extern inline functions in argp.h
|
||||
Copyright (C) 1997, 1998, 2004, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-1998, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -27,7 +27,11 @@
|
|||
#ifndef __USE_EXTERN_INLINES
|
||||
# define __USE_EXTERN_INLINES 1
|
||||
#endif
|
||||
#define ARGP_EI
|
||||
#ifdef _LIBC
|
||||
# define ARGP_EI
|
||||
#else
|
||||
# define ARGP_EI _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#undef __OPTIMIZE__
|
||||
#define __OPTIMIZE__ 1
|
||||
#include "argp.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Hierarchial argument parsing, layered over getopt.
|
||||
Copyright (C) 1995-1999, 2003-2010 Free Software Foundation, Inc.
|
||||
/* Hierarchical argument parsing, layered over getopt.
|
||||
Copyright (C) 1995-1999, 2003-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
|
@ -34,16 +34,16 @@
|
|||
# define __NTH(fct) fct __THROW
|
||||
#endif
|
||||
|
||||
#ifndef __attribute__
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
The __-protected variants of the attributes 'format' and 'printf' are
|
||||
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
|
||||
We enable __attribute__ only if these are supported too, because
|
||||
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
|
||||
gnulib and libintl do '#define printf __printf__' when they override
|
||||
the 'printf' function. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
|
||||
#endif
|
||||
|
||||
/* GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
|
@ -94,7 +94,7 @@ struct argp_option
|
|||
/* The doc string for this option. If both NAME and KEY are 0, This string
|
||||
will be printed outdented from the normal option column, making it
|
||||
useful as a group header (it will be the first thing printed in its
|
||||
group); in this usage, it's conventional to end the string with a `:'.
|
||||
group); in this usage, it's conventional to end the string with a ':'.
|
||||
|
||||
Write the initial value as N_("TEXT") if you want xgettext to collect
|
||||
it into a POT file. */
|
||||
|
@ -124,21 +124,21 @@ struct argp_option
|
|||
/* This option isn't actually an option (and so should be ignored by the
|
||||
actual option parser), but rather an arbitrary piece of documentation that
|
||||
should be displayed in much the same manner as the options. If this flag
|
||||
is set, then the option NAME field is displayed unmodified (e.g., no `--'
|
||||
is set, then the option NAME field is displayed unmodified (e.g., no '--'
|
||||
prefix is added) at the left-margin (where a *short* option would normally
|
||||
be displayed), and the documentation string in the normal place. The NAME
|
||||
field will be translated using gettext, unless OPTION_NO_TRANS is set (see
|
||||
below). For purposes of sorting, any leading whitespace and punctuation is
|
||||
ignored, except that if the first non-whitespace character is not `-', this
|
||||
ignored, except that if the first non-whitespace character is not '-', this
|
||||
entry is displayed after all options (and OPTION_DOC entries with a leading
|
||||
`-') in the same group. */
|
||||
'-') in the same group. */
|
||||
#define OPTION_DOC 0x8
|
||||
|
||||
/* This option shouldn't be included in `long' usage messages (but is still
|
||||
/* This option shouldn't be included in "long" usage messages (but is still
|
||||
included in help messages). This is mainly intended for options that are
|
||||
completely documented in an argp's ARGS_DOC field, in which case including
|
||||
the option in the generic usage list would be redundant. For instance,
|
||||
if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
|
||||
if ARGS_DOC is "FOO BAR\n-x BLAH", and the '-x' option's purpose is to
|
||||
distinguish these two cases, -x should probably be marked
|
||||
OPTION_NO_USAGE. */
|
||||
#define OPTION_NO_USAGE 0x10
|
||||
|
@ -167,7 +167,7 @@ typedef error_t (*argp_parser_t) (int key, char *arg,
|
|||
ARGP_ERR_UNKNOWN should be returned if they aren't understood.
|
||||
|
||||
The sequence of keys to a parsing function is either (where each
|
||||
uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
|
||||
uppercased word should be prefixed by 'ARGP_KEY_' and opt is a user key):
|
||||
|
||||
INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
|
||||
or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
|
||||
|
@ -238,15 +238,15 @@ struct argp
|
|||
argp_parser_t parser;
|
||||
|
||||
/* A string describing what other arguments are wanted by this program. It
|
||||
is only used by argp_usage to print the `Usage:' message. If it
|
||||
is only used by argp_usage to print the "Usage:" message. If it
|
||||
contains newlines, the strings separated by them are considered
|
||||
alternative usage patterns, and printed on separate lines (lines after
|
||||
the first are prefix by ` or: ' instead of `Usage:'). */
|
||||
the first are prefix by " or: " instead of "Usage:"). */
|
||||
const char *args_doc;
|
||||
|
||||
/* If non-NULL, a string containing extra text to be printed before and
|
||||
after the options in a long help message (separated by a vertical tab
|
||||
`\v' character).
|
||||
'\v' character).
|
||||
Write the initial value as N_("BEFORE-TEXT") "\v" N_("AFTER-TEXT") if
|
||||
you want xgettext to collect the two pieces of text into a POT file. */
|
||||
const char *doc;
|
||||
|
@ -265,7 +265,7 @@ struct argp
|
|||
defines, below, describing which other help text TEXT is. The function
|
||||
should return either TEXT, if it should be used as-is, a replacement
|
||||
string, which should be malloced, and will be freed by argp, or NULL,
|
||||
meaning `print nothing'. The value for TEXT is *after* any translation
|
||||
meaning "print nothing". The value for TEXT is *after* any translation
|
||||
has been done, so if any of the replacement text also needs translation,
|
||||
that should be done by the filter function. INPUT is either the input
|
||||
supplied to argp_parse, or NULL, if argp_help was called directly. */
|
||||
|
@ -278,7 +278,7 @@ struct argp
|
|||
};
|
||||
|
||||
/* Possible KEY arguments to a help filter function. */
|
||||
#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
|
||||
#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceding options. */
|
||||
#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
|
||||
#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
|
||||
#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
|
||||
|
@ -304,7 +304,7 @@ struct argp_child
|
|||
printing a header string, use a value of "". */
|
||||
const char *header;
|
||||
|
||||
/* Where to group the child options relative to the other (`consolidated')
|
||||
/* Where to group the child options relative to the other ("consolidated")
|
||||
options in the parent argp; the values are the same as the GROUP field
|
||||
in argp_option structs, but all child-groupings follow parent options at
|
||||
a particular group level. If both this field and HEADER are zero, then
|
||||
|
@ -337,7 +337,7 @@ struct argp_state
|
|||
unsigned arg_num;
|
||||
|
||||
/* If non-zero, the index in ARGV of the first argument following a special
|
||||
`--' argument (which prevents anything following being interpreted as an
|
||||
'--' argument (which prevents anything following being interpreted as an
|
||||
option). Only set once argument parsing has proceeded past this point. */
|
||||
int quoted;
|
||||
|
||||
|
@ -399,7 +399,7 @@ struct argp_state
|
|||
/* Don't exit on errors (they may still result in error messages). */
|
||||
#define ARGP_NO_EXIT 0x20
|
||||
|
||||
/* Use the gnu getopt `long-only' rules for parsing arguments. */
|
||||
/* Use the gnu getopt "long-only" rules for parsing arguments. */
|
||||
#define ARGP_LONG_ONLY 0x40
|
||||
|
||||
/* Turns off any message-printing/exiting options. */
|
||||
|
@ -456,7 +456,7 @@ extern void (*argp_program_version_hook) (FILE *__restrict __stream,
|
|||
the bug-reporting address for the program. It will be printed by
|
||||
argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
|
||||
standard help messages), embedded in a sentence that says something like
|
||||
`Report bugs to ADDR.'. */
|
||||
"Report bugs to ADDR." */
|
||||
extern const char *argp_program_bug_address;
|
||||
|
||||
/* The exit status that argp will use when exiting due to a parsing error.
|
||||
|
@ -467,7 +467,7 @@ extern error_t argp_err_exit_status;
|
|||
/* Flags for argp_help. */
|
||||
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
|
||||
#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
|
||||
#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
|
||||
#define ARGP_HELP_SEE 0x04 /* a "Try ... for more help" message. */
|
||||
#define ARGP_HELP_LONG 0x08 /* a long help message. */
|
||||
#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
|
||||
#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
|
||||
|
@ -506,7 +506,7 @@ extern void __argp_help (const struct argp *__restrict __argp,
|
|||
parsing routine (thus taking an argp_state structure as the first
|
||||
argument). They may or may not print an error message and exit, depending
|
||||
on the flags in STATE -- in any case, the caller should be prepared for
|
||||
them *not* to exit, and should return an appropiate error after calling
|
||||
them *not* to exit, and should return an appropriate error after calling
|
||||
them. [argp_usage & argp_error should probably be called argp_state_...,
|
||||
but they're used often enough that they should be short] */
|
||||
|
||||
|
@ -519,21 +519,21 @@ extern void __argp_state_help (const struct argp_state *__restrict __state,
|
|||
FILE *__restrict __stream,
|
||||
unsigned int __flags);
|
||||
|
||||
#if _LIBC || !defined __USE_EXTERN_INLINES
|
||||
#if _LIBC
|
||||
/* Possibly output the standard usage message for ARGP to stderr and exit. */
|
||||
extern void argp_usage (const struct argp_state *__state);
|
||||
extern void __argp_usage (const struct argp_state *__state);
|
||||
#endif
|
||||
|
||||
/* If appropriate, print the printf string FMT and following args, preceded
|
||||
by the program name and `:', to stderr, and followed by a `Try ... --help'
|
||||
by the program name and ':', to stderr, and followed by a "Try ... --help"
|
||||
message, then exit (1). */
|
||||
extern void argp_error (const struct argp_state *__restrict __state,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
|
||||
extern void __argp_error (const struct argp_state *__restrict __state,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
|
||||
|
||||
/* Similar to the standard gnu error-reporting function error(), but will
|
||||
respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
|
||||
|
@ -546,13 +546,13 @@ extern void __argp_error (const struct argp_state *__restrict __state,
|
|||
extern void argp_failure (const struct argp_state *__restrict __state,
|
||||
int __status, int __errnum,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 4, 5)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
|
||||
extern void __argp_failure (const struct argp_state *__restrict __state,
|
||||
int __status, int __errnum,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 4, 5)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
|
||||
|
||||
#if _LIBC || !defined __USE_EXTERN_INLINES
|
||||
#if _LIBC
|
||||
/* Returns true if the option OPT is a valid short option. */
|
||||
extern int _option_is_short (const struct argp_option *__opt) __THROW;
|
||||
extern int __option_is_short (const struct argp_option *__opt) __THROW;
|
||||
|
@ -572,13 +572,17 @@ extern void *__argp_input (const struct argp *__restrict __argp,
|
|||
const struct argp_state *__restrict __state)
|
||||
__THROW;
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
#if !_LIBC || defined __USE_EXTERN_INLINES
|
||||
|
||||
# if !_LIBC
|
||||
# define __argp_usage argp_usage
|
||||
# define __argp_state_help argp_state_help
|
||||
# define __option_is_short _option_is_short
|
||||
# define __option_is_end _option_is_end
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
# ifndef ARGP_EI
|
||||
# define ARGP_EI _GL_INLINE
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef ARGP_EI
|
||||
|
@ -635,6 +639,7 @@ __NTH (__option_is_end (const struct argp_option *__opt))
|
|||
# undef __argp_state_help
|
||||
# undef __option_is_short
|
||||
# undef __option_is_end
|
||||
_GL_INLINE_HEADER_END
|
||||
# endif
|
||||
#endif /* Use extern inlines. */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Formatted output to strings.
|
||||
Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2002, 2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -12,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* basename.c -- return the last element in a file name
|
||||
|
||||
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2010 Free Software
|
||||
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Convert unibyte character to wide character.
|
||||
Copyright (C) 2008, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2008.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
# Output a system dependent table of character encoding aliases.
|
||||
#
|
||||
# Copyright (C) 2000-2004, 2006-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2004, 2006-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -14,8 +14,7 @@
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# The table consists of lines of the form
|
||||
# ALIAS CANONICAL
|
||||
|
@ -30,6 +29,8 @@
|
|||
# The current list of GNU canonical charset names is as follows.
|
||||
#
|
||||
# name MIME? used by which systems
|
||||
# (darwin = Mac OS X, woe32 = native Windows)
|
||||
#
|
||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
|
||||
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* dirname.c -- return all but the last element in a file name
|
||||
|
||||
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2010 Free Software
|
||||
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
/* Return the length of the prefix of FILE that will be used by
|
||||
dir_name. If FILE is in the working directory, this returns zero
|
||||
even though `dir_name (FILE)' will return ".". Works properly even
|
||||
even though 'dir_name (FILE)' will return ".". Works properly even
|
||||
if there are trailing slashes (by effectively ignoring them). */
|
||||
|
||||
size_t
|
||||
|
@ -53,9 +53,9 @@ dir_len (char const *file)
|
|||
}
|
||||
|
||||
|
||||
/* In general, we can't use the builtin `dirname' function if available,
|
||||
/* In general, we can't use the builtin 'dirname' function if available,
|
||||
since it has different meanings in different environments.
|
||||
In some environments the builtin `dirname' modifies its argument.
|
||||
In some environments the builtin 'dirname' modifies its argument.
|
||||
|
||||
Return the leading directories part of FILE, allocated with malloc.
|
||||
Works properly even if there are trailing slashes (by effectively
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Take file names apart into directory and base names.
|
||||
|
||||
Copyright (C) 1998, 2001, 2003-2006, 2009-2010 Free Software Foundation,
|
||||
Copyright (C) 1998, 2001, 2003-2006, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -21,53 +21,25 @@
|
|||
|
||||
# include <stdbool.h>
|
||||
# include <stddef.h>
|
||||
# include "dosname.h"
|
||||
|
||||
# ifndef DIRECTORY_SEPARATOR
|
||||
# define DIRECTORY_SEPARATOR '/'
|
||||
# endif
|
||||
|
||||
# ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
||||
# endif
|
||||
|
||||
# ifndef FILE_SYSTEM_PREFIX_LEN
|
||||
# if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
|
||||
/* This internal macro assumes ASCII, but all hosts that support drive
|
||||
letters use ASCII. */
|
||||
# define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \
|
||||
<= 'z' - 'a')
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) \
|
||||
(_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
|
||||
# else
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
|
||||
# endif
|
||||
|
||||
# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
|
||||
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
|
||||
# endif
|
||||
|
||||
# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
|
||||
# else
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) \
|
||||
(ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F))
|
||||
# endif
|
||||
# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
|
||||
|
||||
# if GNULIB_DIRNAME
|
||||
char *base_name (char const *file);
|
||||
char *dir_name (char const *file);
|
||||
# endif
|
||||
|
||||
char *mdir_name (char const *file);
|
||||
size_t base_len (char const *file);
|
||||
size_t dir_len (char const *file);
|
||||
char *last_component (char const *file);
|
||||
size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
|
||||
size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
|
||||
char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
|
||||
|
||||
bool strip_trailing_slashes (char *file);
|
||||
|
||||
|
|
53
grub-core/gnulib/dosname.h
Normal file
53
grub-core/gnulib/dosname.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* File names on MS-DOS/Windows systems.
|
||||
|
||||
Copyright (C) 2000-2001, 2004-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
From Paul Eggert and Jim Meyering. */
|
||||
|
||||
#ifndef _DOSNAME_H
|
||||
#define _DOSNAME_H
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__ || \
|
||||
defined __MSDOS__ || defined __CYGWIN__ || \
|
||||
defined __EMX__ || defined __DJGPP__)
|
||||
/* This internal macro assumes ASCII, but all hosts that support drive
|
||||
letters use ASCII. */
|
||||
# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
|
||||
<= 'z' - 'a')
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) \
|
||||
(_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
|
||||
# ifndef __CYGWIN__
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
|
||||
# endif
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
#else
|
||||
# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
|
||||
#endif
|
||||
|
||||
#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
|
||||
# else
|
||||
# define IS_ABSOLUTE_FILE_NAME(F) \
|
||||
(ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
|
||||
#endif
|
||||
#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
|
||||
|
||||
#endif /* DOSNAME_H_ */
|
|
@ -1,6 +1,6 @@
|
|||
/* A POSIX-like <errno.h>.
|
||||
|
||||
Copyright (C) 2008-2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -13,69 +13,137 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_ERRNO_H
|
||||
#ifndef _@GUARD_PREFIX@_ERRNO_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
|
||||
|
||||
#ifndef _GL_ERRNO_H
|
||||
#define _GL_ERRNO_H
|
||||
#ifndef _@GUARD_PREFIX@_ERRNO_H
|
||||
#define _@GUARD_PREFIX@_ERRNO_H
|
||||
|
||||
|
||||
/* On native Windows platforms, many macros are not defined. */
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
|
||||
/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
|
||||
# define EWOULDBLOCK EAGAIN
|
||||
/* These are the same values as defined by MSVC 10, for interoperability. */
|
||||
|
||||
/* Values >= 100 seem safe to use. */
|
||||
# define ETXTBSY 100
|
||||
# define GNULIB_defined_ETXTBSY 1
|
||||
# ifndef ENOMSG
|
||||
# define ENOMSG 122
|
||||
# define GNULIB_defined_ENOMSG 1
|
||||
# endif
|
||||
|
||||
# ifndef EIDRM
|
||||
# define EIDRM 111
|
||||
# define GNULIB_defined_EIDRM 1
|
||||
# endif
|
||||
|
||||
# ifndef ENOLINK
|
||||
# define ENOLINK 121
|
||||
# define GNULIB_defined_ENOLINK 1
|
||||
# endif
|
||||
|
||||
# ifndef EPROTO
|
||||
# define EPROTO 134
|
||||
# define GNULIB_defined_EPROTO 1
|
||||
# endif
|
||||
|
||||
# ifndef EBADMSG
|
||||
# define EBADMSG 104
|
||||
# define GNULIB_defined_EBADMSG 1
|
||||
# endif
|
||||
|
||||
# ifndef EOVERFLOW
|
||||
# define EOVERFLOW 132
|
||||
# define GNULIB_defined_EOVERFLOW 1
|
||||
# endif
|
||||
|
||||
# ifndef ENOTSUP
|
||||
# define ENOTSUP 129
|
||||
# define GNULIB_defined_ENOTSUP 1
|
||||
# endif
|
||||
|
||||
# ifndef ENETRESET
|
||||
# define ENETRESET 117
|
||||
# define GNULIB_defined_ENETRESET 1
|
||||
# endif
|
||||
|
||||
# ifndef ECONNABORTED
|
||||
# define ECONNABORTED 106
|
||||
# define GNULIB_defined_ECONNABORTED 1
|
||||
# endif
|
||||
|
||||
# ifndef ECANCELED
|
||||
# define ECANCELED 105
|
||||
# define GNULIB_defined_ECANCELED 1
|
||||
# endif
|
||||
|
||||
# ifndef EOWNERDEAD
|
||||
# define EOWNERDEAD 133
|
||||
# define GNULIB_defined_EOWNERDEAD 1
|
||||
# endif
|
||||
|
||||
# ifndef ENOTRECOVERABLE
|
||||
# define ENOTRECOVERABLE 127
|
||||
# define GNULIB_defined_ENOTRECOVERABLE 1
|
||||
# endif
|
||||
|
||||
# ifndef EINPROGRESS
|
||||
# define EINPROGRESS 112
|
||||
# define EALREADY 103
|
||||
# define ENOTSOCK 128
|
||||
# define EDESTADDRREQ 109
|
||||
# define EMSGSIZE 115
|
||||
# define EPROTOTYPE 136
|
||||
# define ENOPROTOOPT 123
|
||||
# define EPROTONOSUPPORT 135
|
||||
# define EOPNOTSUPP 130
|
||||
# define EAFNOSUPPORT 102
|
||||
# define EADDRINUSE 100
|
||||
# define EADDRNOTAVAIL 101
|
||||
# define ENETDOWN 116
|
||||
# define ENETUNREACH 118
|
||||
# define ECONNRESET 108
|
||||
# define ENOBUFS 119
|
||||
# define EISCONN 113
|
||||
# define ENOTCONN 126
|
||||
# define ETIMEDOUT 138
|
||||
# define ECONNREFUSED 107
|
||||
# define ELOOP 114
|
||||
# define EHOSTUNREACH 110
|
||||
# define EWOULDBLOCK 140
|
||||
# define GNULIB_defined_ESOCK 1
|
||||
# endif
|
||||
|
||||
# ifndef ETXTBSY
|
||||
# define ETXTBSY 139
|
||||
# define ENODATA 120 /* not required by POSIX */
|
||||
# define ENOSR 124 /* not required by POSIX */
|
||||
# define ENOSTR 125 /* not required by POSIX */
|
||||
# define ETIME 137 /* not required by POSIX */
|
||||
# define EOTHER 131 /* not required by POSIX */
|
||||
# define GNULIB_defined_ESTREAMS 1
|
||||
# endif
|
||||
|
||||
/* These are intentionally the same values as the WSA* error numbers, defined
|
||||
in <winsock2.h>. */
|
||||
# define EINPROGRESS 10036
|
||||
# define EALREADY 10037
|
||||
# define ENOTSOCK 10038
|
||||
# define EDESTADDRREQ 10039
|
||||
# define EMSGSIZE 10040
|
||||
# define EPROTOTYPE 10041
|
||||
# define ENOPROTOOPT 10042
|
||||
# define EPROTONOSUPPORT 10043
|
||||
# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
|
||||
# define EOPNOTSUPP 10045
|
||||
# define EPFNOSUPPORT 10046 /* not required by POSIX */
|
||||
# define EAFNOSUPPORT 10047
|
||||
# define EADDRINUSE 10048
|
||||
# define EADDRNOTAVAIL 10049
|
||||
# define ENETDOWN 10050
|
||||
# define ENETUNREACH 10051
|
||||
# define ENETRESET 10052
|
||||
# define ECONNABORTED 10053
|
||||
# define ECONNRESET 10054
|
||||
# define ENOBUFS 10055
|
||||
# define EISCONN 10056
|
||||
# define ENOTCONN 10057
|
||||
# define ESHUTDOWN 10058 /* not required by POSIX */
|
||||
# define ETOOMANYREFS 10059 /* not required by POSIX */
|
||||
# define ETIMEDOUT 10060
|
||||
# define ECONNREFUSED 10061
|
||||
# define ELOOP 10062
|
||||
# define EHOSTDOWN 10064 /* not required by POSIX */
|
||||
# define EHOSTUNREACH 10065
|
||||
# define EPROCLIM 10067 /* not required by POSIX */
|
||||
# define EUSERS 10068 /* not required by POSIX */
|
||||
# define EDQUOT 10069
|
||||
# define ESTALE 10070
|
||||
# define EREMOTE 10071 /* not required by POSIX */
|
||||
# define GNULIB_defined_ESOCK 1
|
||||
# define GNULIB_defined_EWINSOCK 1
|
||||
|
||||
# endif
|
||||
|
||||
|
@ -98,6 +166,7 @@
|
|||
|
||||
/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
|
||||
EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
|
||||
Likewise, on NonStop Kernel, EDQUOT is not defined.
|
||||
Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
|
||||
HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
|
||||
|
||||
|
@ -145,16 +214,66 @@
|
|||
# define GNULIB_defined_ENOTSUP 1
|
||||
# endif
|
||||
|
||||
# ifndef ENETRESET
|
||||
# define ENETRESET 2011
|
||||
# define GNULIB_defined_ENETRESET 1
|
||||
# endif
|
||||
|
||||
# ifndef ECONNABORTED
|
||||
# define ECONNABORTED 2012
|
||||
# define GNULIB_defined_ECONNABORTED 1
|
||||
# endif
|
||||
|
||||
# ifndef ESTALE
|
||||
# define ESTALE 2009
|
||||
# define GNULIB_defined_ESTALE 1
|
||||
# endif
|
||||
|
||||
# ifndef EDQUOT
|
||||
# define EDQUOT 2010
|
||||
# define GNULIB_defined_EDQUOT 1
|
||||
# endif
|
||||
|
||||
# ifndef ECANCELED
|
||||
# define ECANCELED 2008
|
||||
# define GNULIB_defined_ECANCELED 1
|
||||
# endif
|
||||
|
||||
/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
|
||||
defined. */
|
||||
|
||||
#endif /* _GL_ERRNO_H */
|
||||
#endif /* _GL_ERRNO_H */
|
||||
# ifndef EOWNERDEAD
|
||||
# if defined __sun
|
||||
/* Use the same values as defined for Solaris >= 8, for
|
||||
interoperability. */
|
||||
# define EOWNERDEAD 58
|
||||
# define ENOTRECOVERABLE 59
|
||||
# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
/* We have a conflict here: pthreads-win32 defines these values
|
||||
differently than MSVC 10. It's hairy to decide which one to use. */
|
||||
# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
|
||||
/* Use the same values as defined by pthreads-win32, for
|
||||
interoperability. */
|
||||
# define EOWNERDEAD 43
|
||||
# define ENOTRECOVERABLE 44
|
||||
# else
|
||||
/* Use the same values as defined by MSVC 10, for
|
||||
interoperability. */
|
||||
# define EOWNERDEAD 133
|
||||
# define ENOTRECOVERABLE 127
|
||||
# endif
|
||||
# else
|
||||
# define EOWNERDEAD 2013
|
||||
# define ENOTRECOVERABLE 2014
|
||||
# endif
|
||||
# define GNULIB_defined_EOWNERDEAD 1
|
||||
# define GNULIB_defined_ENOTRECOVERABLE 1
|
||||
# endif
|
||||
|
||||
# ifndef EILSEQ
|
||||
# define EILSEQ 2015
|
||||
# define GNULIB_defined_EILSEQ 1
|
||||
# endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990-1998, 2000-2007, 2009-2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1998, 2000-2007, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -54,7 +54,7 @@
|
|||
function without parameters instead. */
|
||||
void (*error_print_progname) (void);
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
/* This variable is incremented each time 'error' is called. */
|
||||
unsigned int error_message_count;
|
||||
|
||||
#ifdef _LIBC
|
||||
|
@ -65,7 +65,7 @@ unsigned int error_message_count;
|
|||
# include <limits.h>
|
||||
# include <libio/libioP.h>
|
||||
|
||||
/* In GNU libc we want do not want to use the common name `error' directly.
|
||||
/* In GNU libc we want do not want to use the common name 'error' directly.
|
||||
Instead make it a weak alias. */
|
||||
extern void __error (int status, int errnum, const char *message, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
|
@ -89,19 +89,25 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
|
|||
# include <unistd.h>
|
||||
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
/* Get declarations of the Win32 API functions. */
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
/* Get _get_osfhandle. */
|
||||
# include "msvc-nothrow.h"
|
||||
# endif
|
||||
|
||||
/* The gnulib override of fcntl is not needed in this file. */
|
||||
# undef fcntl
|
||||
|
||||
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
|
||||
# if !HAVE_DECL_STRERROR_R
|
||||
# ifndef HAVE_DECL_STRERROR_R
|
||||
"this configure-time declaration test was not run"
|
||||
# endif
|
||||
# if STRERROR_R_CHAR_P
|
||||
char *strerror_r ();
|
||||
# else
|
||||
int strerror_r ();
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
|
@ -115,13 +121,14 @@ extern char *program_name;
|
|||
|
||||
#if !_LIBC
|
||||
/* Return non-zero if FD is open. */
|
||||
static inline int
|
||||
static int
|
||||
is_open (int fd)
|
||||
{
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
/* On Win32: The initial state of unassigned standard file descriptors is
|
||||
that they are open but point to an INVALID_HANDLE_VALUE. There is no
|
||||
fcntl, and the gnulib replacement fcntl does not support F_GETFL. */
|
||||
/* On native Windows: The initial state of unassigned standard file
|
||||
descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
|
||||
There is no fcntl, and the gnulib replacement fcntl does not support
|
||||
F_GETFL. */
|
||||
return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
|
||||
# else
|
||||
# ifndef F_GETFL
|
||||
|
@ -132,7 +139,7 @@ is_open (int fd)
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
static void
|
||||
flush_stdout (void)
|
||||
{
|
||||
#if !_LIBC
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008, 2009, 2010 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1995-1997, 2003, 2006, 2008-2013 Free Software Foundation,
|
||||
Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -19,39 +19,39 @@
|
|||
#ifndef _ERROR_H
|
||||
#define _ERROR_H 1
|
||||
|
||||
#ifndef __attribute__
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
The __-protected variants of the attributes 'format' and 'printf' are
|
||||
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
|
||||
We enable __attribute__ only if these are supported too, because
|
||||
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
|
||||
gnulib and libintl do '#define printf __printf__' when they override
|
||||
the 'printf' function. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Print a message with `fprintf (stderr, FORMAT, ...)';
|
||||
/* Print a message with 'fprintf (stderr, FORMAT, ...)';
|
||||
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
|
||||
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
|
||||
If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
|
||||
|
||||
extern void error (int __status, int __errnum, const char *__format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
|
||||
|
||||
extern void error_at_line (int __status, int __errnum, const char *__fname,
|
||||
unsigned int __lineno, const char *__format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)));
|
||||
_GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
|
||||
|
||||
/* If NULL, error will flush stdout, then print on stderr the program
|
||||
name, a colon and a space. Otherwise, error will call this
|
||||
function without parameters instead. */
|
||||
extern void (*error_print_progname) (void);
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
/* This variable is incremented each time 'error' is called. */
|
||||
extern unsigned int error_message_count;
|
||||
|
||||
/* Sometimes we want to have at most one error per line. This
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Supplemental information about the floating-point formats.
|
||||
Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FLOATPLUS_H
|
||||
#define _FLOATPLUS_H
|
||||
|
@ -141,8 +140,8 @@
|
|||
#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
|
||||
|
||||
/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
|
||||
typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
|
||||
typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
|
||||
typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
|
||||
typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
|
||||
typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
|
||||
typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
|
||||
|
||||
#endif /* _FLOATPLUS_H */
|
||||
|
|
33
grub-core/gnulib/float.c
Normal file
33
grub-core/gnulib/float.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* Auxiliary definitions for <float.h>.
|
||||
Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <float.h>
|
||||
|
||||
#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
|
||||
#elif defined __i386__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
|
||||
#else
|
||||
/* This declaration is solely to ensure that after preprocessing
|
||||
this file is never empty. */
|
||||
typedef int dummy;
|
||||
#endif
|
|
@ -1,6 +1,6 @@
|
|||
/* A correct <float.h>.
|
||||
|
||||
Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -15,19 +15,21 @@
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_FLOAT_H
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
|
||||
|
||||
#ifndef _GL_FLOAT_H
|
||||
#define _GL_FLOAT_H
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
#define _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
/* 'long double' properties. */
|
||||
|
||||
#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
|
@ -58,5 +60,129 @@
|
|||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
#endif /* _GL_FLOAT_H */
|
||||
#endif /* _GL_FLOAT_H */
|
||||
/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
|
||||
precision in the compiler but 64 bits of precision at runtime. See
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */
|
||||
#if defined __i386__ && defined __FreeBSD__
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
/* Number of decimal digits that is sufficient for representing a number. */
|
||||
# undef LDBL_DIG
|
||||
# define LDBL_DIG 18
|
||||
/* x-1 where x is the smallest representable number > 1. */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
|
||||
/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP (-16381)
|
||||
/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
|
||||
# undef LDBL_MAX_EXP
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.3621031431120935E-4932L /* = 0x1p-16382L */
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
|
||||
But the largest literal that GCC allows us to write is
|
||||
0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
Unfortunately, this is not a constant expression. */
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
|
||||
long double ld;
|
||||
};
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
/* Minimum e such that 10^e is in the range of normalized numbers. */
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum e such that 10^e is in the range of representable finite numbers. */
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# define LDBL_MAX_10_EXP 4932
|
||||
#endif
|
||||
|
||||
/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
|
||||
wrong.
|
||||
On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
|
||||
#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
#endif
|
||||
#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
|
||||
It is not easy to define:
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307166e308L
|
||||
is too small, whereas
|
||||
#define LDBL_MAX 1.79769313486231580793728971405302307167e308L
|
||||
is too large. Apparently a bug in GCC decimal-to-binary conversion.
|
||||
Also, I can't get values larger than
|
||||
#define LDBL63 ((long double) (1ULL << 63))
|
||||
#define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
|
||||
#define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
|
||||
which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
|
||||
So, define it like this through a reference to an external variable
|
||||
|
||||
const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
|
||||
extern const long double LDBL_MAX;
|
||||
|
||||
or through a pointer cast
|
||||
|
||||
#define LDBL_MAX \
|
||||
(*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
|
||||
|
||||
Unfortunately, this is not a constant expression, and the latter expression
|
||||
does not work well when GCC is optimizing.. */
|
||||
union gl_long_double_union
|
||||
{
|
||||
struct { double hi; double lo; } dd;
|
||||
long double ld;
|
||||
};
|
||||
extern const union gl_long_double_union gl_LDBL_MAX;
|
||||
# define LDBL_MAX (gl_LDBL_MAX.ld)
|
||||
#endif
|
||||
|
||||
/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
|
||||
On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
|
||||
are wrong. */
|
||||
#if defined __sgi && (LDBL_MANT_DIG >= 106)
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 106
|
||||
# if defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
# undef LDBL_EPSILON
|
||||
# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @REPLACE_ITOLD@
|
||||
/* Pull in a function that fixes the 'int' to 'long double' conversion
|
||||
of glibc 2.7. */
|
||||
extern
|
||||
# ifdef __cplusplus
|
||||
"C"
|
||||
# endif
|
||||
void _Qp_itoq (long double *, int);
|
||||
static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
||||
#endif /* _@GUARD_PREFIX@_FLOAT_H */
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1993, 1996-2007, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -12,8 +11,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <config.h>
|
||||
|
@ -43,7 +41,7 @@
|
|||
(HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \
|
||||
&& HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
|
||||
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
/* For platform which support the ISO C amendment 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if defined _LIBC || WIDE_CHAR_SUPPORT
|
||||
# include <wctype.h>
|
||||
|
@ -79,7 +77,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
|
|||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
program understand 'configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
|
||||
|
@ -93,7 +91,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
|
|||
|
||||
# if defined _LIBC || WIDE_CHAR_SUPPORT
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
and the functions from ISO C amendement 1. */
|
||||
and the functions from ISO C amendment 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||
# else
|
||||
|
@ -120,7 +118,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
|
|||
# endif
|
||||
|
||||
# else
|
||||
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, 'xdigit'. */
|
||||
|
||||
# define IS_CHAR_CLASS(string) \
|
||||
(STREQ (string, "alpha") || STREQ (string, "upper") \
|
||||
|
@ -169,7 +167,6 @@ static int posixly_correct;
|
|||
# endif
|
||||
# endif
|
||||
# define MEMCHR(S, C, N) memchr (S, C, N)
|
||||
# define STRCOLL(S1, S2) strcoll (S1, S2)
|
||||
# include "fnmatch_loop.c"
|
||||
|
||||
|
||||
|
@ -197,7 +194,6 @@ static int posixly_correct;
|
|||
# endif
|
||||
# endif
|
||||
# define MEMCHR(S, C, N) wmemchr (S, C, N)
|
||||
# define STRCOLL(S1, S2) wcscoll (S1, S2)
|
||||
# define WIDE_CHAR_VERSION 1
|
||||
|
||||
# undef IS_CHAR_CLASS
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
|
||||
2005, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2013 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -14,8 +14,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H 1
|
||||
|
@ -32,23 +31,23 @@ extern "C" {
|
|||
#undef FNM_NOESCAPE
|
||||
#undef FNM_PERIOD
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||
/* Bits set in the FLAGS argument to 'fnmatch'. */
|
||||
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match '/'. */
|
||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||
#define FNM_PERIOD (1 << 2) /* Leading '.' is matched only explicitly. */
|
||||
|
||||
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
|
||||
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||
# define FNM_LEADING_DIR (1 << 3) /* Ignore '/...' after a match. */
|
||||
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||
# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
|
||||
#endif
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
/* Value returned by 'fnmatch' if STRING does not match PATTERN. */
|
||||
#define FNM_NOMATCH 1
|
||||
|
||||
/* This value is returned if the implementation does not support
|
||||
`fnmatch'. Since this is not the case here it will never be
|
||||
'fnmatch'. Since this is not the case here it will never be
|
||||
returned but the conformance test suites still require the symbol
|
||||
to be defined. */
|
||||
#ifdef _XOPEN_SOURCE
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1993, 1996-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -13,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Match STRING against the file name pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
|
@ -201,6 +199,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
case L_('['):
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
const CHAR *p_init = p;
|
||||
const CHAR *n_init = n;
|
||||
register bool not;
|
||||
CHAR cold;
|
||||
UCHAR fn;
|
||||
|
@ -215,7 +215,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
return FNM_NOMATCH;
|
||||
|
||||
if (*n == L_('/') && (flags & FNM_FILE_NAME))
|
||||
/* `/' cannot be matched. */
|
||||
/* '/' cannot be matched. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^')));
|
||||
|
@ -381,7 +381,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
{
|
||||
/* We found a table entry. Now see whether the
|
||||
character we are currently at has the same
|
||||
equivalance class value. */
|
||||
equivalence class value. */
|
||||
int len = weights[idx & 0xffffff];
|
||||
int32_t idx2;
|
||||
const UCHAR *np = (const UCHAR *) n;
|
||||
|
@ -411,8 +411,13 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
}
|
||||
#endif
|
||||
else if (c == L_('\0'))
|
||||
/* [ (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
{
|
||||
/* [ unterminated, treat as normal character. */
|
||||
p = p_init;
|
||||
n = n_init;
|
||||
c = L_('[');
|
||||
goto normal_match;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool is_range = false;
|
||||
|
@ -630,7 +635,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
UCHAR cend = *p++;
|
||||
|
||||
# ifdef WIDE_CHAR_VERSION
|
||||
/* Search in the `names' array for the characters. */
|
||||
/* Search in the 'names' array for the characters. */
|
||||
fcollseq = __collseq_table_lookup (collseq, fn);
|
||||
if (fcollseq == ~((uint32_t) 0))
|
||||
/* XXX We don't know anything about the character
|
||||
|
@ -833,7 +838,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
#else
|
||||
/* We use a boring value comparison of the character
|
||||
values. This is better than comparing using
|
||||
`strcoll' since the latter would have surprising
|
||||
'strcoll' since the latter would have surprising
|
||||
and sometimes fatal consequences. */
|
||||
UCHAR cend = *p++;
|
||||
|
||||
|
@ -1150,7 +1155,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
|
||||
case L_('@'):
|
||||
do
|
||||
/* I cannot believe it but `strcat' is actually acceptable
|
||||
/* I cannot believe it but 'strcat' is actually acceptable
|
||||
here. Match the entire string with the prefix from the
|
||||
pattern list and the rest of the pattern following the
|
||||
pattern list. */
|
||||
|
@ -1208,7 +1213,6 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
|||
#undef END
|
||||
#undef MEMPCPY
|
||||
#undef MEMCHR
|
||||
#undef STRCOLL
|
||||
#undef STRLEN
|
||||
#undef STRCAT
|
||||
#undef L_
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* getdelim.c --- Implementation of replacement getdelim function.
|
||||
Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
|
@ -13,18 +13,16 @@
|
|||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Ported from glibc by Simon Josefsson. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
|
||||
optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below. */
|
||||
#define _GL_ARG_NONNULL(params)
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue