From ec4acbbd98891bfa6a3d3d0b0cecb704afb7242e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 27 Feb 2018 13:56:41 -0500 Subject: [PATCH] Update grub2 for f28 - Try to fix things for new compiler madness. I really don't know why gcc decided __attribute__((packed)) on a "typedef struct" should imply __attribute__((align (1))) and that it should have a warning that it does so. The obvious behavior would be to keep the alignment of the first element unless it's used in another object or type that /also/ hask the packed attribute. Why should it change the default alignment at all? - Merge in the BLS patches Javier and I wrote. - Attempt to fix pmtimer initialization failures to not be super duper slow. Signed-off-by: Peter Jones --- 0001-Bump-version-to-2.03.patch | 8 +- 0002-Remove-bashisms-from-tests.patch | 26 +- 0003-fs-tester-make-sh-compatible.patch | 6 +- 0004-support-busybox-date.patch | 8 +- ...retrieve-fstime-when-it-s-not-useful.patch | 6 +- 0006-Support-lseek64.patch | 8 +- 0007-Use-SHELL-rather-than-bin-sh.patch | 6 +- 0008-po-Use-SHELL-rather-than-bin-sh.patch | 6 +- 0009-Add-termux-path-to-dict.patch | 6 +- 0010-Fix-shebang-for-termux.patch | 124 +- 0011-Add-strtoull-test.patch | 6 +- ...x-behaviour-on-chars-between-9-and-a.patch | 8 +- 0013-Add-Virtual-LAN-support.patch | 18 +- ...out-to-mkimage_generate_elfXX-rather.patch | 54 +- ...r-arm-uboot-code-to-make-it-genereic.patch | 427 +- ...-parts-that-are-platform-independent.patch | 50 +- ...-Rename-uboot-halt.c-to-dummy-halt.c.patch | 6 +- ...ame-uboot-datetime-to-dummy-datetime.patch | 8 +- 0019-arm-coreboot-Start-new-port.patch | 522 +- ...upport-for-device-tree-based-drivers.patch | 443 +- ...-coreboot-Support-for-vexpress-timer.patch | 6 +- 0022-arm-coreboot-Export-FDT-routines.patch | 6 +- ...-Split-protocol-from-controller-code.patch | 41 +- ...reboot-Support-keyboard-for-vexpress.patch | 36 +- ...m_coreboot-Support-grub-mkstandalone.patch | 72 +- ...oreboot-Support-loading-linux-images.patch | 8 +- 0027-arm_coreboot-Support-DMA.patch | 90 +- 0028-ehci-Split-core-code-from-PCI-part.patch | 10 +- 0029-arm_coreboot-Support-EHCI.patch | 40 +- ...n-FDT-nodes-with-compatible-property.patch | 6 +- ...ty-to-send-receive-messages-on-paren.patch | 8 +- 0032-rk3288_spi-Add-SPI-driver.patch | 12 +- ...eboot-Add-Chromebook-keyboard-driver.patch | 10 +- 0034-Missing-parts-of-previous-commit.patch | 8 +- ...-cbmemc-to-support-updated-console-f.patch | 6 +- ...t_keyboard-Fix-falco-chromebook-case.patch | 8 +- 0037-sparc64-Close-cdboot-ihandle.patch | 6 +- ...-Fix-Xen-boot-using-GRUB2-on-AARCH64.patch | 6 +- ...p-option-support-in-xen_module-comma.patch | 6 +- ...inux_xen.in-Add-xen_boot-command-sup.patch | 6 +- ...-introduction-of-Xen-boot-commands-i.patch | 6 +- ...se-devspec-to-determine-the-OBP-path.patch | 6 +- ...unt-ext2-3-4-filesystems-that-have-t.patch | 10 +- 0044-ehci-Fix-compilation-for-amd64.patch | 6 +- ...-compilation-for-ppc-sparc-and-arm64.patch | 6 +- 0046-ehci-Fix-compilation-on-i386.patch | 6 +- 0047-crypto-Fix-use-after-free.patch | 6 +- 0048-arm-efi-Fix-compilation.patch | 6 +- 0049-fdt-silence-clang-warning.patch | 6 +- 0050-Fix-a-segfault-in-lsefi.patch | 6 +- ...t-typedef-and-use-grub_size_t-instea.patch | 6 +- ...x-reading-label-lvd.ident-is-dstring.patch | 6 +- ...b-core-fs-udf.c-Add-support-for-UUID.patch | 6 +- ...orriso-presence-before-doing-anythin.patch | 6 +- 0055-Fail-if-xorriso-failed.patch | 6 +- ...efi-refactor-grub_efi_allocate_pages.patch | 8 +- 0057-Remove-grub_efi_allocate_pages.patch | 40 +- 0058-efi-move-fdt-helper-library.patch | 12 +- 0059-efi-Add-GRUB_PE32_MAGIC-definition.patch | 10 +- ...inux-loader-improve-type-portability.patch | 8 +- ...allocation-type-to-GRUB_EFI_LOADER_C.patch | 6 +- ...RM_-definitions-when-handling-term-c.patch | 30 +- ...B_GZ-prefix-to-gzio-specific-defines.patch | 6 +- 0064-info-in-builddir.patch | 6 +- 0065-re-write-.gitignore.patch | 22 +- ...ient-architecture-CAS-reboot-support.patch | 12 +- ...nsole-display-attr-when-clear-screen.patch | 6 +- ...video-support-for-IBM-power-machines.patch | 10 +- ...when-generating-configuration-by-gru.patch | 6 +- 0070-Move-bash-completion-script-922997.patch | 8 +- 0071-Update-to-minilzo-2.08.patch | 8870 ++++++++--------- ...o-include-entries-by-title-not-just-.patch | 6 +- 0073-Add-GRUB_DISABLE_UUID.patch | 10 +- 0074-Make-exit-take-a-return-code.patch | 32 +- ...pot-as-binary-so-git-won-t-try-to-di.patch | 6 +- ...es-load-an-env-block-from-a-variable.patch | 8 +- ...HCP-client-ID-and-UUID-options-added.patch | 8 +- ...-trim-arp-packets-with-abnormal-size.patch | 6 +- ...Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch | 6 +- ...UEFI-operating-systems-returned-by-o.patch | 6 +- 0081-Migrate-PPC-from-Yaboot-to-Grub2.patch | 8 +- 0082-Add-fw_path-variable-revised.patch | 8 +- 0083-Add-support-for-linuxefi.patch | 14 +- ...xefi-and-initrdefi-where-appropriate.patch | 6 +- ...w-insmod-when-secure-boot-is-enabled.patch | 10 +- ...-hex-hex-straight-through-unmolested.patch | 10 +- 0087-Add-X-option-to-printf-functions.patch | 6 +- ...for-specific-config-file-for-netboot.patch | 10 +- ...g-module-to-parse-Boot-Loader-Specif.patch | 8 +- 0090-Don-t-write-messages-to-the-screen.patch | 74 +- 0091-Don-t-print-GNU-GRUB-header.patch | 6 +- 0092-Don-t-add-to-highlighted-row.patch | 6 +- 0093-Message-string-cleanups.patch | 6 +- ...ing-now-that-we-aren-t-displaying-it.patch | 6 +- ...t-indentation-for-the-term-help-text.patch | 6 +- 0096-Indent-menu-entries.patch | 6 +- 0097-Fix-margins.patch | 6 +- ...-1-for-our-right-hand-margin-so-line.patch | 6 +- ...-Use-linux16-when-appropriate-880840.patch | 6 +- 0100-Enable-pager-by-default.-985860.patch | 6 +- ...-on-serial-so-don-t-tell-the-user-to.patch | 6 +- ...n-t-say-GNU-Linux-in-generated-menus.patch | 8 +- ...-Don-t-draw-a-border-around-the-menu.patch | 6 +- ...andard-margin-for-the-timeout-string.patch | 6 +- ...rame-to-list-of-relocations-stripped.patch | 6 +- ...rk-with-our-changes-for-linux16-and-.patch | 6 +- ...on-t-print-during-fdt-loading-method.patch | 6 +- ...spaces-when-we-re-doing-our-cmdline-.patch | 6 +- ...password-to-boot-entries-generated-b.patch | 6 +- 0110-Don-t-emit-Booting-.-message.patch | 8 +- ...f-man-pages-with-slightly-nicer-ones.patch | 146 +- ...ix-when-fallback-searching-for-grub-.patch | 6 +- ...-before-grub.cfg-on-tftp-config-file.patch | 22 +- ...ert-function-to-support-NVMe-devices.patch | 6 +- ...M-Mustang-device-tree-for-hardware-t.patch | 6 +- ...device-tree-from-the-grub-default-fi.patch | 8 +- ...P-protocol-for-exclusive-use-by-grub.patch | 6 +- ...P-protocol-for-exclusive-use-by-grub.patch | 6 +- 0119-Add-grub_util_readlink.patch | 726 +- ...se-symlinks-including-those-across-d.patch | 8 +- ...CLASS-in-10_linux-from-etc-os-releas.patch | 6 +- ...t-ordering-for-.debug-and-rescue-ker.patch | 6 +- 0123-Load-arm-with-SB-enabled.patch | 143 +- 0124-Try-prefix-if-fw_path-doesn-t-work.patch | 36 +- ...-grub.cfg-netboot-selection-order-11.patch | 8 +- ...-Package-Sort-for-grub2-mkconfig-112.patch | 178 +- 0127-Handle-rssd-storage-devices.patch | 8 +- ...x16-initrd16-and-linuxefi-initrdefi-.patch | 8 +- ...fig-construct-titles-that-look-like-.patch | 8 +- ...ly-grub2-password-config-tool-985962.patch | 70 +- ...fig-construct-titles-that-look-like-.patch | 19 +- ...-configure.ac-and-grub-rpm-sort-play.patch | 16 +- 0133-tcp-add-window-scaling-support.patch | 8 +- ...net-retransmit-if-our-device-is-busy.patch | 8 +- ...out-actually-using-the-configured-ne.patch | 16 +- ...r-for-the-first-exclusive-reopen-of-.patch | 8 +- ...ue-when-reading-username-and-passwor.patch | 10 +- ...ub-password-will-not-be-read-1290803.patch | 8 +- ...ub-setpassword-documentation-1290799.patch | 10 +- ...le-issue-in-grub-setpassword-1294243.patch | 8 +- ...rsistent-RAM-and-unknown-possible-fu.patch | 8 +- 0142-efiemu-Fix-compilation-failure.patch | 8 +- ...P-protocol-for-exclusive-use-by-grub.patch | 8 +- 0144-Add-a-url-parser.patch | 16 +- ...net-and-bootp-add-support-for-dhcpv6.patch | 18 +- ...rnel-settings-and-use-it-in-10_linux.patch | 84 +- 0147-Normalize-slashes-in-tftp-paths.patch | 8 +- 0148-Fix-malformed-tftp-packets.patch | 8 +- 0149-Fix-race-in-EFI-validation.patch | 8 +- ...1374141-fix-incorrect-mask-for-ppc64.patch | 8 +- ...art-of-chainloader-target-if-present.patch | 8 +- ...ecureboot-support-on-efi-chainloader.patch | 10 +- ...loaders-that-link-in-efi-mode-honor-.patch | 68 +- 0154-Make-grub_fatal-also-backtrace.patch | 16 +- 0155-Rework-linux-command.patch | 8 +- 0156-Rework-linux16-command.patch | 8 +- 0157-Make-grub-editenv-build-again.patch | 8 +- ...ix-up-some-man-pages-rpmdiff-noticed.patch | 14 +- ...-work-some-intricacies-of-PE-loading.patch | 10 +- ...-of-efi-chainload-so-non-sb-cases-wo.patch | 60 +- ...-double-free-on-verification-failure.patch | 8 +- ...machine-type-test-in-30_os-prober.in.patch | 8 +- ...fix-wrong-sanity-check-in-relocate_c.patch | 8 +- ...truncate-overlong-relocation-section.patch | 8 +- 0165-linuxefi-minor-cleanups.patch | 8 +- ...rch-64-on-32-boot-in-linuxefi-loader.patch | 42 +- 0167-Fix-up-linux-params-usage.patch | 8 +- 0168-Make-exit-take-a-return-code.patch | 10 +- ...fdt-has-address-cells-and-size-cells.patch | 8 +- ...rintf-in-the-secure-boot-verify-code.patch | 8 +- ...fo-pages-say-grub2-where-appropriate.patch | 10 +- ...more-debug-info-in-our-module-loader.patch | 8 +- ...-chainloader-entries-don-t-try-any-x.patch | 8 +- ...-Add-ability-to-boot-from-subvolumes.patch | 71 +- ...port-btrfs_subvol-and-btrfs_subvolid.patch | 8 +- 0176-grub2-btrfs-03-follow_default.patch | 8 +- 0177-grub2-btrfs-04-grub2-install.patch | 42 +- 0178-grub2-btrfs-05-grub2-mkconfig.patch | 16 +- 0179-grub2-btrfs-06-subvol-mount.patch | 46 +- ...ootable-Snapshot-submenu-in-grub.cfg.patch | 8 +- ...subvol-name-scheme-to-support-old-sn.patch | 8 +- ...-correctly-with-btrfs-snapshots-bsc-.patch | 8 +- ...ocate_pool-and-grub_efi_free_pool-wr.patch | 8 +- ...fi_.-memory-helpers-where-reasonable.patch | 8 +- 0185-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch | 10 +- ...c-sized-arrays-since-we-don-t-build-.patch | 8 +- 0187-don-t-ignore-const.patch | 8 +- 0188-don-t-use-int-for-efi-status.patch | 8 +- ...INIT-declare-its-function-prototypes.patch | 8 +- ...p-some-errors-in-the-linuxefi-loader.patch | 8 +- 0191-editenv-handle-relative-symlinks.patch | 8 +- ...e-libgrub.pp-depend-on-config-util.h.patch | 8 +- ...-efi-as-HFS-on-ppc-machines-in-grub-.patch | 8 +- ...20_linux_xen.in-Add-xen_boot-command.patch | 8 +- ...-figure-out-whether-multiboot2-shoul.patch | 8 +- ...d-xen-or-multiboot-2-modules-as-need.patch | 8 +- ...lt-tsc-calibration-method-to-pmtimer.patch | 8 +- ...-calibration-not-take-51-seconds-to-.patch | 181 +- 0199-align-struct-efi_variable-better.patch | 36 + 0200-Add-quicksort-implementation.patch | 325 + ...nd-support-to-parse-BootLoaderSpec-c.patch | 1140 +++ 0202-Add-BLS-support-to-grub-mkconfig.patch | 169 + ...d-grub_exit-definition-for-grub-emu-.patch | 36 + ...-backtrace-on-grub_abort-for-grub-em.patch | 30 + ...-blscfg-command-for-the-emu-platform.patch | 167 + ...nux-and-initrd-commands-for-grub-emu.patch | 354 + grub.patches | 8 + grub2.spec | 13 +- 208 files changed, 9316 insertions(+), 7185 deletions(-) create mode 100644 0199-align-struct-efi_variable-better.patch create mode 100644 0200-Add-quicksort-implementation.patch create mode 100644 0201-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch create mode 100644 0202-Add-BLS-support-to-grub-mkconfig.patch create mode 100644 0203-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch create mode 100644 0204-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch create mode 100644 0205-Enable-blscfg-command-for-the-emu-platform.patch create mode 100644 0206-Add-linux-and-initrd-commands-for-grub-emu.patch diff --git a/0001-Bump-version-to-2.03.patch b/0001-Bump-version-to-2.03.patch index 361f6e2..392d0b8 100644 --- a/0001-Bump-version-to-2.03.patch +++ b/0001-Bump-version-to-2.03.patch @@ -1,7 +1,7 @@ From b0bad6fd9449d3333fe1ab58953c0e6c1ce12c0d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 3 May 2017 11:55:52 +0200 -Subject: [PATCH 001/198] Bump version to 2.03 +Subject: [PATCH 001/206] Bump version to 2.03 --- configure.ac | 2 +- @@ -9,7 +9,7 @@ Subject: [PATCH 001/198] Bump version to 2.03 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/configure.ac b/configure.ac -index edd184154..d10d8adac 100644 +index edd184154f7..d10d8adac58 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables @@ -22,7 +22,7 @@ index edd184154..d10d8adac 100644 AC_CONFIG_AUX_DIR([build-aux]) diff --git a/grub-core/tests/checksums.h b/grub-core/tests/checksums.h -index 68d8ce7c7..921e57ff4 100644 +index 68d8ce7c775..921e57ff48d 100644 --- a/grub-core/tests/checksums.h +++ b/grub-core/tests/checksums.h @@ -1,101 +1,101 @@ @@ -226,5 +226,5 @@ index 68d8ce7c7..921e57ff4 100644 { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, -- -2.14.3 +2.15.0 diff --git a/0002-Remove-bashisms-from-tests.patch b/0002-Remove-bashisms-from-tests.patch index 13c7601..9294e3f 100644 --- a/0002-Remove-bashisms-from-tests.patch +++ b/0002-Remove-bashisms-from-tests.patch @@ -1,7 +1,7 @@ From 5a0c548ba388b343b0bb6d2a38888e7eac5bbb96 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 03:47:13 +0300 -Subject: [PATCH 002/198] Remove bashisms from tests. +Subject: [PATCH 002/206] Remove bashisms from tests. Those tests don't actually need bash. Just use common shebang. --- @@ -19,7 +19,7 @@ Those tests don't actually need bash. Just use common shebang. 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in -index a459353e8..0d8162e98 100644 +index a459353e8a5..0d8162e98b0 100644 --- a/tests/grub_cmd_date.in +++ b/tests/grub_cmd_date.in @@ -1,4 +1,4 @@ @@ -29,7 +29,7 @@ index a459353e8..0d8162e98 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_regexp.in b/tests/grub_cmd_regexp.in -index e7e625701..7e9ab86aa 100644 +index e7e62570115..7e9ab86aabb 100644 --- a/tests/grub_cmd_regexp.in +++ b/tests/grub_cmd_regexp.in @@ -1,4 +1,4 @@ @@ -39,7 +39,7 @@ index e7e625701..7e9ab86aa 100644 # Run GRUB script in a Qemu instance diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in -index c594ae3fc..2f518dd9e 100644 +index c594ae3fc14..2f518dd9e34 100644 --- a/tests/grub_cmd_set_date.in +++ b/tests/grub_cmd_set_date.in @@ -1,4 +1,4 @@ @@ -49,7 +49,7 @@ index c594ae3fc..2f518dd9e 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in -index eb362aa24..05b8f6b73 100644 +index eb362aa2439..05b8f6b73fa 100644 --- a/tests/grub_cmd_sleep.in +++ b/tests/grub_cmd_sleep.in @@ -1,4 +1,4 @@ @@ -59,7 +59,7 @@ index eb362aa24..05b8f6b73 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.in -index 6269891c9..49ae8a9c8 100644 +index 6269891c9ee..49ae8a9c830 100644 --- a/tests/grub_cmd_test.in +++ b/tests/grub_cmd_test.in @@ -1,4 +1,4 @@ @@ -69,7 +69,7 @@ index 6269891c9..49ae8a9c8 100644 # create a randome file empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 diff --git a/tests/grub_cmd_tr.in b/tests/grub_cmd_tr.in -index 3fb15e35c..0e8d645eb 100644 +index 3fb15e35c8a..0e8d645eb6b 100644 --- a/tests/grub_cmd_tr.in +++ b/tests/grub_cmd_tr.in @@ -1,4 +1,4 @@ @@ -79,7 +79,7 @@ index 3fb15e35c..0e8d645eb 100644 # Run GRUB script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/tests/grub_func_test.in b/tests/grub_func_test.in -index c8cc26376..b32f24466 100644 +index c8cc2637633..b32f2446659 100644 --- a/tests/grub_func_test.in +++ b/tests/grub_func_test.in @@ -1,4 +1,4 @@ @@ -89,7 +89,7 @@ index c8cc26376..b32f24466 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_script_blockarg.in b/tests/grub_script_blockarg.in -index 2765b61ac..63b60a2ea 100644 +index 2765b61acbb..63b60a2ea06 100644 --- a/tests/grub_script_blockarg.in +++ b/tests/grub_script_blockarg.in @@ -1,4 +1,4 @@ @@ -99,7 +99,7 @@ index 2765b61ac..63b60a2ea 100644 # Run GRUB script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/tests/grub_script_expansion.in b/tests/grub_script_expansion.in -index e46401c4c..2b7829568 100644 +index e46401c4c9f..2b782956838 100644 --- a/tests/grub_script_expansion.in +++ b/tests/grub_script_expansion.in @@ -1,4 +1,4 @@ @@ -109,7 +109,7 @@ index e46401c4c..2b7829568 100644 # Run GRUB script in a Qemu instance diff --git a/tests/help_test.in b/tests/help_test.in -index e780924ef..aa9645835 100644 +index e780924ef7b..aa96458355b 100644 --- a/tests/help_test.in +++ b/tests/help_test.in @@ -1,4 +1,4 @@ @@ -119,7 +119,7 @@ index e780924ef..aa9645835 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/test_sha512sum.in b/tests/test_sha512sum.in -index d5ef7f9ea..80ebdc59f 100644 +index d5ef7f9ea62..80ebdc59fd5 100644 --- a/tests/test_sha512sum.in +++ b/tests/test_sha512sum.in @@ -1,4 +1,4 @@ @@ -129,5 +129,5 @@ index d5ef7f9ea..80ebdc59f 100644 # create a randome file file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 -- -2.14.3 +2.15.0 diff --git a/0003-fs-tester-make-sh-compatible.patch b/0003-fs-tester-make-sh-compatible.patch index b46edaf..8f8e1f6 100644 --- a/0003-fs-tester-make-sh-compatible.patch +++ b/0003-fs-tester-make-sh-compatible.patch @@ -1,14 +1,14 @@ From 37865c2c4ad26cd5e947b08abf1fde8145699919 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 14:35:59 +0300 -Subject: [PATCH 003/198] fs-tester: make sh-compatible +Subject: [PATCH 003/206] fs-tester: make sh-compatible --- tests/util/grub-fs-tester.in | 306 ++++++++++++++++++++++++------------------- 1 file changed, 169 insertions(+), 137 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in -index 2337771a1..4515d165e 100644 +index 2337771a1b9..4515d165e6e 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -1,4 +1,4 @@ @@ -742,5 +742,5 @@ index 2337771a1..4515d165e 100644 if [ x"$fs" = x"zfs" ]; then rmdir "$MNTPOINTRW"/"grub fs" || true -- -2.14.3 +2.15.0 diff --git a/0004-support-busybox-date.patch b/0004-support-busybox-date.patch index bc17c60..40cfeed 100644 --- a/0004-support-busybox-date.patch +++ b/0004-support-busybox-date.patch @@ -1,7 +1,7 @@ From b43b8cacc813c2c15347de1e35cc88d9aa912d22 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 14:31:36 +0300 -Subject: [PATCH 004/198] support busybox date. +Subject: [PATCH 004/206] support busybox date. Busybox date doesn't understand weekdays in -d input, so strip them beforehand. @@ -11,7 +11,7 @@ so strip them beforehand. 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in -index 0d8162e98..60f039ebc 100644 +index 0d8162e98b0..60f039ebc8b 100644 --- a/tests/grub_cmd_date.in +++ b/tests/grub_cmd_date.in @@ -9,7 +9,7 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; @@ -24,7 +24,7 @@ index 0d8162e98..60f039ebc 100644 ndt="$(date -u +%s)" diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in -index 05b8f6b73..ac51d4209 100644 +index 05b8f6b73fa..ac51d42098e 100644 --- a/tests/grub_cmd_sleep.in +++ b/tests/grub_cmd_sleep.in @@ -11,8 +11,8 @@ fi @@ -39,5 +39,5 @@ index 05b8f6b73..ac51d4209 100644 # Ignore QEMU bug if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then -- -2.14.3 +2.15.0 diff --git a/0005-Don-t-retrieve-fstime-when-it-s-not-useful.patch b/0005-Don-t-retrieve-fstime-when-it-s-not-useful.patch index 9d409d7..3fa9c32 100644 --- a/0005-Don-t-retrieve-fstime-when-it-s-not-useful.patch +++ b/0005-Don-t-retrieve-fstime-when-it-s-not-useful.patch @@ -1,14 +1,14 @@ From 6dec3a26b37e128ded5d912e08abc5cee1592499 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 21:24:05 +0300 -Subject: [PATCH 005/198] Don't retrieve fstime when it's not useful. +Subject: [PATCH 005/206] Don't retrieve fstime when it's not useful. --- tests/util/grub-fs-tester.in | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in -index 4515d165e..bf47305f3 100644 +index 4515d165e6e..bf47305f3e8 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -1328,31 +1328,31 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do @@ -68,5 +68,5 @@ index 4515d165e..bf47305f3 100644 if [ x$NOHARDLINK != xy ]; then -- -2.14.3 +2.15.0 diff --git a/0006-Support-lseek64.patch b/0006-Support-lseek64.patch index 6d01bd3..c97be55 100644 --- a/0006-Support-lseek64.patch +++ b/0006-Support-lseek64.patch @@ -1,7 +1,7 @@ From 608bec51128008afb81c9e3f297283e9f830a146 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 20:21:05 +0300 -Subject: [PATCH 006/198] Support lseek64. +Subject: [PATCH 006/206] Support lseek64. Android doesn't have 64-bit off_t, so use off64_t instead. --- @@ -10,7 +10,7 @@ Android doesn't have 64-bit off_t, so use off64_t instead. 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index d10d8adac..e0262e159 100644 +index d10d8adac58..e0262e159f0 100644 --- a/configure.ac +++ b/configure.ac @@ -373,7 +373,10 @@ case "$host_os" in @@ -26,7 +26,7 @@ index d10d8adac..e0262e159 100644 if test x$USE_NLS = xno; then diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c -index 2a8c5882e..5450cf416 100644 +index 2a8c5882e3d..5450cf4166e 100644 --- a/grub-core/osdep/unix/hostdisk.c +++ b/grub-core/osdep/unix/hostdisk.c @@ -77,11 +77,19 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz @@ -50,5 +50,5 @@ index 2a8c5882e..5450cf416 100644 } -- -2.14.3 +2.15.0 diff --git a/0007-Use-SHELL-rather-than-bin-sh.patch b/0007-Use-SHELL-rather-than-bin-sh.patch index 9dbb5ef..5ff446f 100644 --- a/0007-Use-SHELL-rather-than-bin-sh.patch +++ b/0007-Use-SHELL-rather-than-bin-sh.patch @@ -1,7 +1,7 @@ From c2ea443446b7feea868e54f94a87781f69820375 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 00:55:30 +0300 -Subject: [PATCH 007/198] Use $(SHELL) rather than /bin/sh. +Subject: [PATCH 007/206] Use $(SHELL) rather than /bin/sh. /bin/sh doesn't exist under termux. --- @@ -9,7 +9,7 @@ Subject: [PATCH 007/198] Use $(SHELL) rather than /bin/sh. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 04e9395fd..809a8aa26 100644 +index 04e9395fd94..809a8aa26bf 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -278,7 +278,7 @@ BUILT_SOURCES += symlist.h @@ -22,5 +22,5 @@ index 04e9395fd..809a8aa26 100644 CLEANFILES += symlist.c BUILT_SOURCES += symlist.c -- -2.14.3 +2.15.0 diff --git a/0008-po-Use-SHELL-rather-than-bin-sh.patch b/0008-po-Use-SHELL-rather-than-bin-sh.patch index 9543b07..45f7f0a 100644 --- a/0008-po-Use-SHELL-rather-than-bin-sh.patch +++ b/0008-po-Use-SHELL-rather-than-bin-sh.patch @@ -1,7 +1,7 @@ From 4341f82af0b61d3dfbe675670d4105dc759c0df3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 14:54:03 +0300 -Subject: [PATCH 008/198] po: Use @SHELL@ rather than /bin/sh. +Subject: [PATCH 008/206] po: Use @SHELL@ rather than /bin/sh. /bin/sh might not exist. --- @@ -9,7 +9,7 @@ Subject: [PATCH 008/198] po: Use @SHELL@ rather than /bin/sh. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/Makefile.in.in b/po/Makefile.in.in -index 3619458e8..e68e9da84 100644 +index 3619458e85f..e68e9da843d 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -15,7 +15,7 @@ PACKAGE = @PACKAGE@ @@ -22,5 +22,5 @@ index 3619458e8..e68e9da84 100644 srcdir = @srcdir@ -- -2.14.3 +2.15.0 diff --git a/0009-Add-termux-path-to-dict.patch b/0009-Add-termux-path-to-dict.patch index 96cf1a2..6181723 100644 --- a/0009-Add-termux-path-to-dict.patch +++ b/0009-Add-termux-path-to-dict.patch @@ -1,14 +1,14 @@ From 1073ddb12078f3c8edbdb74bb8f5afc674983f40 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 14:52:48 +0300 -Subject: [PATCH 009/198] Add termux path to dict. +Subject: [PATCH 009/206] Add termux path to dict. --- tests/util/grub-fs-tester.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in -index bf47305f3..468d9e785 100644 +index bf47305f3e8..468d9e7856d 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -259,7 +259,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do @@ -21,5 +21,5 @@ index bf47305f3..468d9e785 100644 CFILESRC="$cand" break -- -2.14.3 +2.15.0 diff --git a/0010-Fix-shebang-for-termux.patch b/0010-Fix-shebang-for-termux.patch index a71faf3..065444d 100644 --- a/0010-Fix-shebang-for-termux.patch +++ b/0010-Fix-shebang-for-termux.patch @@ -1,7 +1,7 @@ From a827807a1330d5ad619faa103bc7f12d89fc8bee Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 22 Jan 2017 20:22:34 +0300 -Subject: [PATCH 010/198] Fix shebang for termux. +Subject: [PATCH 010/206] Fix shebang for termux. Termux doesn't have a /bin/sh. So we needto use $SHELL. Keep /bin/sh as much as possible. @@ -69,7 +69,7 @@ Keep /bin/sh as much as possible. 60 files changed, 69 insertions(+), 59 deletions(-) diff --git a/configure.ac b/configure.ac -index e0262e159..ee2c86537 100644 +index e0262e159f0..ee2c86537e9 100644 --- a/configure.ac +++ b/configure.ac @@ -459,6 +459,16 @@ case "$build_os" in @@ -90,7 +90,7 @@ index e0262e159..ee2c86537 100644 gl_INIT diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 03cc3b7f6..3de06ee01 100644 +index 03cc3b7f69e..3de06ee018f 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -1,4 +1,4 @@ @@ -100,7 +100,7 @@ index 03cc3b7f6..3de06ee01 100644 # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/grub-core/gensyminfo.sh.in b/grub-core/gensyminfo.sh.in -index 2e8716b42..9bc767532 100644 +index 2e8716b425c..9bc7675327a 100644 --- a/grub-core/gensyminfo.sh.in +++ b/grub-core/gensyminfo.sh.in @@ -1,4 +1,4 @@ @@ -110,7 +110,7 @@ index 2e8716b42..9bc767532 100644 # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/grub-core/modinfo.sh.in b/grub-core/modinfo.sh.in -index faf0ad30e..f6cd657ce 100644 +index faf0ad30edb..f6cd657ce0f 100644 --- a/grub-core/modinfo.sh.in +++ b/grub-core/modinfo.sh.in @@ -1,4 +1,4 @@ @@ -120,7 +120,7 @@ index faf0ad30e..f6cd657ce 100644 # User-controllable options grub_modinfo_target_cpu=@target_cpu@ diff --git a/tests/ahci_test.in b/tests/ahci_test.in -index 1d01d1f59..7df560462 100644 +index 1d01d1f59a0..7df56046201 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -1,4 +1,4 @@ @@ -130,7 +130,7 @@ index 1d01d1f59..7df560462 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/btrfs_test.in b/tests/btrfs_test.in -index c55d9477f..2b37ddd33 100644 +index c55d9477f78..2b37ddd3324 100644 --- a/tests/btrfs_test.in +++ b/tests/btrfs_test.in @@ -1,4 +1,4 @@ @@ -140,7 +140,7 @@ index c55d9477f..2b37ddd33 100644 set -e diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in -index 1cc901977..75acdfedb 100644 +index 1cc901977c2..75acdfedb7f 100644 --- a/tests/cdboot_test.in +++ b/tests/cdboot_test.in @@ -1,4 +1,4 @@ @@ -150,7 +150,7 @@ index 1cc901977..75acdfedb 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in -index 1003587cc..9d216ebcf 100644 +index 1003587ccca..9d216ebcff6 100644 --- a/tests/core_compress_test.in +++ b/tests/core_compress_test.in @@ -1,4 +1,4 @@ @@ -160,7 +160,7 @@ index 1003587cc..9d216ebcf 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/cpio_test.in b/tests/cpio_test.in -index 0b09db549..5742cf17b 100644 +index 0b09db549f0..5742cf17b9d 100644 --- a/tests/cpio_test.in +++ b/tests/cpio_test.in @@ -1,4 +1,4 @@ @@ -170,7 +170,7 @@ index 0b09db549..5742cf17b 100644 set -e diff --git a/tests/ehci_test.in b/tests/ehci_test.in -index 7dd8d3e8f..b197f8cdc 100644 +index 7dd8d3e8fbd..b197f8cdc92 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -1,4 +1,4 @@ @@ -180,7 +180,7 @@ index 7dd8d3e8f..b197f8cdc 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/example_scripted_test.in b/tests/example_scripted_test.in -index 09633e893..783b7f138 100644 +index 09633e89341..783b7f13853 100644 --- a/tests/example_scripted_test.in +++ b/tests/example_scripted_test.in @@ -1,4 +1,4 @@ @@ -190,7 +190,7 @@ index 09633e893..783b7f138 100644 true diff --git a/tests/exfat_test.in b/tests/exfat_test.in -index fc1a0fe5e..cd3cd4cb2 100644 +index fc1a0fe5ec0..cd3cd4cb2f7 100644 --- a/tests/exfat_test.in +++ b/tests/exfat_test.in @@ -1,4 +1,4 @@ @@ -200,7 +200,7 @@ index fc1a0fe5e..cd3cd4cb2 100644 set -e diff --git a/tests/ext234_test.in b/tests/ext234_test.in -index c986960a8..892b99cbd 100644 +index c986960a8be..892b99cbdf6 100644 --- a/tests/ext234_test.in +++ b/tests/ext234_test.in @@ -1,4 +1,4 @@ @@ -210,7 +210,7 @@ index c986960a8..892b99cbd 100644 set -e diff --git a/tests/fat_test.in b/tests/fat_test.in -index 1d132b517..b6b4748ca 100644 +index 1d132b51703..b6b4748ca69 100644 --- a/tests/fat_test.in +++ b/tests/fat_test.in @@ -1,4 +1,4 @@ @@ -220,7 +220,7 @@ index 1d132b517..b6b4748ca 100644 set -e diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in -index a59645b7f..2d7dfc889 100644 +index a59645b7f87..2d7dfc8891f 100644 --- a/tests/fddboot_test.in +++ b/tests/fddboot_test.in @@ -1,4 +1,4 @@ @@ -230,7 +230,7 @@ index a59645b7f..2d7dfc889 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/file_filter_test.in b/tests/file_filter_test.in -index 8909e4021..bfb638227 100644 +index 8909e4021fb..bfb6382274e 100644 --- a/tests/file_filter_test.in +++ b/tests/file_filter_test.in @@ -1,4 +1,4 @@ @@ -240,7 +240,7 @@ index 8909e4021..bfb638227 100644 # # GRUB is free software: you can redistribute it and/or modify diff --git a/tests/gettext_strings_test.in b/tests/gettext_strings_test.in -index 5c305e75b..813999ebe 100644 +index 5c305e75b7e..813999ebe6e 100644 --- a/tests/gettext_strings_test.in +++ b/tests/gettext_strings_test.in @@ -1,4 +1,4 @@ @@ -250,7 +250,7 @@ index 5c305e75b..813999ebe 100644 cd '@srcdir@' diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in -index 60f039ebc..f7c9ca004 100644 +index 60f039ebc8b..f7c9ca00432 100644 --- a/tests/grub_cmd_date.in +++ b/tests/grub_cmd_date.in @@ -1,4 +1,4 @@ @@ -260,7 +260,7 @@ index 60f039ebc..f7c9ca004 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_regexp.in b/tests/grub_cmd_regexp.in -index 7e9ab86aa..6520bd6d7 100644 +index 7e9ab86aabb..6520bd6d79a 100644 --- a/tests/grub_cmd_regexp.in +++ b/tests/grub_cmd_regexp.in @@ -1,4 +1,4 @@ @@ -270,7 +270,7 @@ index 7e9ab86aa..6520bd6d7 100644 # Run GRUB script in a Qemu instance diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in -index 2f518dd9e..aac120a6c 100644 +index 2f518dd9e34..aac120a6c52 100644 --- a/tests/grub_cmd_set_date.in +++ b/tests/grub_cmd_set_date.in @@ -1,4 +1,4 @@ @@ -280,7 +280,7 @@ index 2f518dd9e..aac120a6c 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in -index ac51d4209..8797f6632 100644 +index ac51d42098e..8797f663284 100644 --- a/tests/grub_cmd_sleep.in +++ b/tests/grub_cmd_sleep.in @@ -1,4 +1,4 @@ @@ -290,7 +290,7 @@ index ac51d4209..8797f6632 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.in -index 49ae8a9c8..3399eb292 100644 +index 49ae8a9c830..3399eb29294 100644 --- a/tests/grub_cmd_test.in +++ b/tests/grub_cmd_test.in @@ -1,4 +1,4 @@ @@ -300,7 +300,7 @@ index 49ae8a9c8..3399eb292 100644 # create a randome file empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 diff --git a/tests/grub_cmd_tr.in b/tests/grub_cmd_tr.in -index 0e8d645eb..bed469c03 100644 +index 0e8d645eb6b..bed469c03dd 100644 --- a/tests/grub_cmd_tr.in +++ b/tests/grub_cmd_tr.in @@ -1,4 +1,4 @@ @@ -310,7 +310,7 @@ index 0e8d645eb..bed469c03 100644 # Run GRUB script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/tests/grub_func_test.in b/tests/grub_func_test.in -index b32f24466..c67f9e422 100644 +index b32f2446659..c67f9e42253 100644 --- a/tests/grub_func_test.in +++ b/tests/grub_func_test.in @@ -1,4 +1,4 @@ @@ -320,7 +320,7 @@ index b32f24466..c67f9e422 100644 . "@builddir@/grub-core/modinfo.sh" diff --git a/tests/grub_script_blanklines.in b/tests/grub_script_blanklines.in -index 89ed763d3..bd8735491 100644 +index 89ed763d3f4..bd8735491be 100644 --- a/tests/grub_script_blanklines.in +++ b/tests/grub_script_blanklines.in @@ -1,4 +1,4 @@ @@ -330,7 +330,7 @@ index 89ed763d3..bd8735491 100644 @builddir@/grub-script-check < Date: Wed, 3 May 2017 12:58:15 +0200 -Subject: [PATCH 011/198] Add strtoull test. +Subject: [PATCH 011/206] Add strtoull test. --- grub-core/Makefile.core.def | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 2dfa22a92..8dcd0e5a9 100644 +index 2dfa22a9271..8dcd0e5a998 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1961,6 +1961,11 @@ module = { @@ -24,5 +24,5 @@ index 2dfa22a92..8dcd0e5a9 100644 name = setjmp_test; common = tests/setjmp_test.c; -- -2.14.3 +2.15.0 diff --git a/0012-strtoull-Fix-behaviour-on-chars-between-9-and-a.patch b/0012-strtoull-Fix-behaviour-on-chars-between-9-and-a.patch index dfb6c45..9eb0a3e 100644 --- a/0012-strtoull-Fix-behaviour-on-chars-between-9-and-a.patch +++ b/0012-strtoull-Fix-behaviour-on-chars-between-9-and-a.patch @@ -1,7 +1,7 @@ From dc6e1b5af83eb1c4290baf97c2d221c0865127be Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 10 Aug 2016 17:49:42 +0200 -Subject: [PATCH 012/198] strtoull: Fix behaviour on chars between '9' and 'a'. +Subject: [PATCH 012/206] strtoull: Fix behaviour on chars between '9' and 'a'. Reported by: Aaron Miller --- @@ -10,7 +10,7 @@ Reported by: Aaron Miller 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index d1a54df6c..3b633d51f 100644 +index d1a54df6c12..3b633d51f4c 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -391,12 +391,13 @@ grub_strtoull (const char *str, char **end, int base) @@ -34,7 +34,7 @@ index d1a54df6c..3b633d51f 100644 found = 1; diff --git a/grub-core/tests/lib/functional_test.c b/grub-core/tests/lib/functional_test.c -index d4822a124..96781fb39 100644 +index d4822a12456..96781fb39b5 100644 --- a/grub-core/tests/lib/functional_test.c +++ b/grub-core/tests/lib/functional_test.c @@ -26,14 +26,23 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -64,5 +64,5 @@ index d4822a124..96781fb39 100644 ok = ok && !grub_test_run (test); grub_errno = 0; -- -2.14.3 +2.15.0 diff --git a/0013-Add-Virtual-LAN-support.patch b/0013-Add-Virtual-LAN-support.patch index 1e71f51..a9cbd4b 100644 --- a/0013-Add-Virtual-LAN-support.patch +++ b/0013-Add-Virtual-LAN-support.patch @@ -1,7 +1,7 @@ From d9f7de0ae3c0c09cff7257c55418450261f3e082 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Mon, 23 Dec 2013 12:32:02 -0200 -Subject: [PATCH 013/198] Add Virtual LAN support. +Subject: [PATCH 013/206] Add Virtual LAN support. This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows multiple VLANs in a bridged network to share the same physical network link @@ -26,7 +26,7 @@ http://en.wikipedia.org/wiki/IEEE_802.1Q 7 files changed, 92 insertions(+), 20 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 4b68c4151..54306e3b1 100644 +index 4b68c4151a1..54306e3b16d 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -111,8 +111,8 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, @@ -56,7 +56,7 @@ index 4b68c4151..54306e3b1 100644 if (grub_net_addr_cmp (&inf->address, &target_addr) == 0 && arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST)) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index a78d164db..002446be1 100644 +index a78d164db1a..002446be1c3 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -153,11 +153,11 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, @@ -96,7 +96,7 @@ index a78d164db..002446be1 100644 if (gateway_addr.ipv4 != 0) diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c -index c397b1b34..4d7ceed6f 100644 +index c397b1b348c..4d7ceed6f93 100644 --- a/grub-core/net/ethernet.c +++ b/grub-core/net/ethernet.c @@ -18,6 +18,7 @@ @@ -192,7 +192,7 @@ index c397b1b34..4d7ceed6f 100644 grub_netbuff_free (nb); return GRUB_ERR_NONE; diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index aba4f8908..7c95cc746 100644 +index aba4f89087b..7c95cc7464a 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -228,12 +228,13 @@ handle_dgram (struct grub_net_buff *nb, @@ -294,7 +294,7 @@ index aba4f8908..7c95cc746 100644 grub_netbuff_free (nb); return GRUB_ERR_NONE; diff --git a/include/grub/net.h b/include/grub/net.h -index 2192fa186..1096b2432 100644 +index 2192fa18628..1096b24322e 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -291,6 +291,7 @@ struct grub_net_network_level_interface @@ -313,7 +313,7 @@ index 2192fa186..1096b2432 100644 + #endif /* ! GRUB_NET_HEADER */ diff --git a/include/grub/net/arp.h b/include/grub/net/arp.h -index bb1703622..8d9d08113 100644 +index bb1703622e1..8d9d081134f 100644 --- a/include/grub/net/arp.h +++ b/include/grub/net/arp.h @@ -22,10 +22,11 @@ @@ -331,7 +331,7 @@ index bb1703622..8d9d08113 100644 #endif diff --git a/include/grub/net/ip.h b/include/grub/net/ip.h -index dcceaa568..ab9d68f98 100644 +index dcceaa56894..ab9d68f9825 100644 --- a/include/grub/net/ip.h +++ b/include/grub/net/ip.h @@ -48,7 +48,8 @@ grub_err_t @@ -345,5 +345,5 @@ index dcceaa568..ab9d68f98 100644 grub_err_t grub_net_send_ip_packet (struct grub_net_network_level_interface *inf, -- -2.14.3 +2.15.0 diff --git a/0014-mkimage-Pass-layout-to-mkimage_generate_elfXX-rather.patch b/0014-mkimage-Pass-layout-to-mkimage_generate_elfXX-rather.patch index a30d8df..9561131 100644 --- a/0014-mkimage-Pass-layout-to-mkimage_generate_elfXX-rather.patch +++ b/0014-mkimage-Pass-layout-to-mkimage_generate_elfXX-rather.patch @@ -1,41 +1,19 @@ From a35ac854308b0af7c86c2c7b199f6abdfa2110b0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 17:32:15 +0200 -Subject: [PATCH 014/198] mkimage: Pass layout to mkimage_generate_elfXX rather +Subject: [PATCH 014/206] mkimage: Pass layout to mkimage_generate_elfXX rather than some fields. This allows easier extension of this function without having too long of arguments list. --- - include/grub/util/mkimage.h | 8 ++++---- util/grub-mkimagexx.c | 35 ++++++++++++++++++----------------- util/mkimage.c | 4 ++-- + include/grub/util/mkimage.h | 8 ++++---- 3 files changed, 24 insertions(+), 23 deletions(-) -diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h -index 1a18708a8..b3a5ca132 100644 ---- a/include/grub/util/mkimage.h -+++ b/include/grub/util/mkimage.h -@@ -51,13 +51,13 @@ grub_mkimage_load_image64 (const char *kernel_path, - void - grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, - int note, char **core_img, size_t *core_size, -- Elf32_Addr target_addr, grub_size_t align, -- size_t kernel_size, size_t bss_size); -+ Elf32_Addr target_addr, -+ struct grub_mkimage_layout *layout); - void - grub_mkimage_generate_elf64 (const struct grub_install_image_target_desc *image_target, - int note, char **core_img, size_t *core_size, -- Elf64_Addr target_addr, grub_size_t align, -- size_t kernel_size, size_t bss_size); -+ Elf64_Addr target_addr, -+ struct grub_mkimage_layout *layout); - - struct grub_install_image_target_desc - { diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index e63f148e4..3fab93e20 100644 +index e63f148e48c..3fab93e2088 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -185,8 +185,8 @@ grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) @@ -147,7 +125,7 @@ index e63f148e4..3fab93e20 100644 shdr->sh_size = grub_host_to_target32 (XEN_NOTE_SIZE); shdr->sh_link = grub_host_to_target32 (0); diff --git a/util/mkimage.c b/util/mkimage.c -index 9ad4cfe42..528166c87 100644 +index 9ad4cfe4223..528166c87ac 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -1638,10 +1638,10 @@ grub_install_generate_image (const char *dir, const char *prefix, @@ -163,6 +141,28 @@ index 9ad4cfe42..528166c87 100644 } break; } +diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h +index 1a18708a89c..b3a5ca132bc 100644 +--- a/include/grub/util/mkimage.h ++++ b/include/grub/util/mkimage.h +@@ -51,13 +51,13 @@ grub_mkimage_load_image64 (const char *kernel_path, + void + grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, +- Elf32_Addr target_addr, grub_size_t align, +- size_t kernel_size, size_t bss_size); ++ Elf32_Addr target_addr, ++ struct grub_mkimage_layout *layout); + void + grub_mkimage_generate_elf64 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, +- Elf64_Addr target_addr, grub_size_t align, +- size_t kernel_size, size_t bss_size); ++ Elf64_Addr target_addr, ++ struct grub_mkimage_layout *layout); + + struct grub_install_image_target_desc + { -- -2.14.3 +2.15.0 diff --git a/0015-Refactor-arm-uboot-code-to-make-it-genereic.patch b/0015-Refactor-arm-uboot-code-to-make-it-genereic.patch index 9983fb9..262141b 100644 --- a/0015-Refactor-arm-uboot-code-to-make-it-genereic.patch +++ b/0015-Refactor-arm-uboot-code-to-make-it-genereic.patch @@ -1,26 +1,26 @@ From d08c9685149e7788001ac9a209baa1d84c3628e0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 17:47:57 +0200 -Subject: [PATCH 015/198] Refactor arm-uboot code to make it genereic. +Subject: [PATCH 015/206] Refactor arm-uboot code to make it genereic. arm-coreboot startup code can be very similar to arm-uboot but current code has U-Boot specific references. So split U-Boot part from generic part. --- grub-core/Makefile.core.def | 4 +- - grub-core/kern/arm/{uboot => }/startup.S | 64 ++++------------------------ grub-core/kern/arm/uboot/init.c | 70 ++++++++++++++++++++++++++++++ - grub-core/kern/arm/uboot/uboot.S | 73 ++++++++++++++++++++++++++++++++ grub-core/kern/uboot/init.c | 16 ------- grub-core/kern/uboot/uboot.c | 35 --------------- include/grub/arm/startup.h | 16 +++++++ - 7 files changed, 170 insertions(+), 108 deletions(-) - rename grub-core/kern/arm/{uboot => }/startup.S (77%) + grub-core/kern/arm/{uboot => }/startup.S | 66 ++++------------------------- + grub-core/kern/arm/uboot/uboot.S | 73 ++++++++++++++++++++++++++++++++ + 7 files changed, 171 insertions(+), 109 deletions(-) create mode 100644 grub-core/kern/arm/uboot/init.c - create mode 100644 grub-core/kern/arm/uboot/uboot.S create mode 100644 include/grub/arm/startup.h + rename grub-core/kern/arm/{uboot => }/startup.S (77%) + create mode 100644 grub-core/kern/arm/uboot/uboot.S diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 8dcd0e5a9..fb59a7b1d 100644 +index 8dcd0e5a998..fb59a7b1d6a 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -105,7 +105,7 @@ kernel = { @@ -41,102 +41,9 @@ index 8dcd0e5a9..fb59a7b1d 100644 terminfoinkernel = term/terminfo.c; terminfoinkernel = term/tparm.c; -diff --git a/grub-core/kern/arm/uboot/startup.S b/grub-core/kern/arm/startup.S -similarity index 77% -rename from grub-core/kern/arm/uboot/startup.S -rename to grub-core/kern/arm/startup.S -index 5efaae16e..640837cba 100644 ---- a/grub-core/kern/arm/uboot/startup.S -+++ b/grub-core/kern/arm/startup.S -@@ -86,7 +86,7 @@ FUNCTION(codestart) - @ Stack pointer used as start address for signature probing - mov r12, sp - adr sp, entry_state -- push {r1-r12,lr} @ store U-Boot context (sp in r12) -+ push {r0-r12,lr} @ store U-Boot context (sp in r12) - - adr r1, _start - ldr r0, bss_start_ptr @ src -@@ -153,69 +153,21 @@ reloc_done: - - b EXT_C(grub_main) - -- /* -- * uboot_syscall(): -- * This function is effectively a veneer, so it cannot -- * modify the stack or corrupt any registers other than -- * r12 (ip). Furthermore it needs to restore r8 for -- * U-Boot (Global Data Pointer) and preserve it for Grub. -- */ --FUNCTION(grub_uboot_syscall) -- str r8, transition_space -- str lr, transition_space + 4 -- str r9, transition_space + 8 -- -- ldr r8, gd_backup -- ldr r9, gd_backup + 4 -- -- bl do_syscall -- -- ldr r8, transition_space -- ldr lr, transition_space + 4 -- ldr r9, transition_space + 8 -- -- bx lr --do_syscall: -- -- ldr ip, grub_uboot_syscall_ptr -- bx ip -- --FUNCTION(grub_uboot_return) -- adr sp, entry_state_end -- pop {r4-r12, lr} -- mov sp, r12 -- bx lr -- -- - .align 3 --@ U-boot context stack space --entry_state_end: --VARIABLE(grub_uboot_machine_type) -+@ U-boot/coreboot context stack space -+VARIABLE(grub_arm_saved_registers) -+ .long 0 @ r0 - .long 0 @ r1 --VARIABLE(grub_uboot_boot_data) - .long 0 @ r2 - .long 0 @ r3 - .long 0 @ r4 - .long 0 @ r5 - .long 0 @ r6 - .long 0 @ r7 --gd_backup: -- .long 0 @ r8 - U-Boot global data pointer up to 2013-09-21 -- .long 0 @ r9 - U-Boot global data pointer 2013-09-21 onwards -+ .long 0 @ r8 -+ .long 0 @ r9 - .long 0 @ r10 - .long 0 @ r11 --VARIABLE(grub_uboot_search_hint)@ U-Boot stack pointer - -- .long 0 @ also API signature address hint. -- .long 0 @ lr --entry_state: @ backup for U-Boot context -- --@ GRUB context stack space --transition_space: -- .long 0 @ r8 -+ .long 0 @ sp - .long 0 @ lr -- .long 0 @ r9 -- --VARIABLE(grub_uboot_syscall_ptr) -- .long 0 @ -- -- END -+entry_state: diff --git a/grub-core/kern/arm/uboot/init.c b/grub-core/kern/arm/uboot/init.c new file mode 100644 -index 000000000..2a6aa3fdd +index 00000000000..2a6aa3fdd3d --- /dev/null +++ b/grub-core/kern/arm/uboot/init.c @@ -0,0 +1,70 @@ @@ -210,9 +117,213 @@ index 000000000..2a6aa3fdd + + return 0; +} +diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c +index 5dcc106ed9b..3e338645c57 100644 +--- a/grub-core/kern/uboot/init.c ++++ b/grub-core/kern/uboot/init.c +@@ -36,30 +36,14 @@ + extern char __bss_start[]; + extern char _end[]; + extern grub_size_t grub_total_module_size; +-extern int (*grub_uboot_syscall_ptr) (int, int *, ...); + static unsigned long timer_start; + +-extern grub_uint32_t grub_uboot_machine_type; +-extern grub_addr_t grub_uboot_boot_data; +- + void + grub_exit (void) + { + grub_uboot_return (0); + } + +-grub_uint32_t +-grub_uboot_get_machine_type (void) +-{ +- return grub_uboot_machine_type; +-} +- +-grub_addr_t +-grub_uboot_get_boot_data (void) +-{ +- return grub_uboot_boot_data; +-} +- + static grub_uint64_t + uboot_timer_ms (void) + { +diff --git a/grub-core/kern/uboot/uboot.c b/grub-core/kern/uboot/uboot.c +index 6800a4beb1c..cf0168e62dd 100644 +--- a/grub-core/kern/uboot/uboot.c ++++ b/grub-core/kern/uboot/uboot.c +@@ -39,48 +39,13 @@ + * returns: 0 if the call not found, 1 if serviced + */ + +-extern int (*grub_uboot_syscall_ptr) (int, int *, ...); + extern int grub_uboot_syscall (int, int *, ...); +-extern grub_addr_t grub_uboot_search_hint; + + static struct sys_info uboot_sys_info; + static struct mem_region uboot_mem_info[5]; + static struct device_info * devices; + static int num_devices; + +-int +-grub_uboot_api_init (void) +-{ +- struct api_signature *start, *end; +- struct api_signature *p; +- +- if (grub_uboot_search_hint) +- { +- /* Extended search range to work around Trim Slice U-Boot issue */ +- start = (struct api_signature *) ((grub_uboot_search_hint & ~0x000fffff) +- - 0x00500000); +- end = +- (struct api_signature *) ((grub_addr_t) start + UBOOT_API_SEARCH_LEN - +- API_SIG_MAGLEN + 0x00500000); +- } +- else +- { +- start = 0; +- end = (struct api_signature *) (256 * 1024 * 1024); +- } +- +- /* Structure alignment is (at least) 8 bytes */ +- for (p = start; p < end; p = (void *) ((grub_addr_t) p + 8)) +- { +- if (grub_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0) +- { +- grub_uboot_syscall_ptr = p->syscall; +- return p->version; +- } +- } +- +- return 0; +-} + + /* + * All functions below are wrappers around the grub_uboot_syscall() function +diff --git a/include/grub/arm/startup.h b/include/grub/arm/startup.h +new file mode 100644 +index 00000000000..9afb6c57c0b +--- /dev/null ++++ b/include/grub/arm/startup.h +@@ -0,0 +1,16 @@ ++#ifndef GRUB_STARTUP_CPU_HEADER ++#define GRUB_STARTUP_CPU_HEADER ++ ++struct grub_arm_startup_registers ++{ ++ /* registers 0-11 */ ++ /* for U-boot r[1] is machine type */ ++ /* for U-boot r[2] is boot data */ ++ grub_uint32_t r[12]; ++ grub_uint32_t sp; ++ grub_uint32_t lr; ++}; ++ ++extern struct grub_arm_startup_registers grub_arm_saved_registers; ++ ++#endif +diff --git a/grub-core/kern/arm/uboot/startup.S b/grub-core/kern/arm/startup.S +similarity index 77% +rename from grub-core/kern/arm/uboot/startup.S +rename to grub-core/kern/arm/startup.S +index 5efaae16e83..640837cba51 100644 +--- a/grub-core/kern/arm/uboot/startup.S ++++ b/grub-core/kern/arm/startup.S +@@ -86,7 +86,7 @@ FUNCTION(codestart) + @ Stack pointer used as start address for signature probing + mov r12, sp + adr sp, entry_state +- push {r1-r12,lr} @ store U-Boot context (sp in r12) ++ push {r0-r12,lr} @ store U-Boot context (sp in r12) + + adr r1, _start + ldr r0, bss_start_ptr @ src +@@ -153,69 +153,21 @@ reloc_done: + + b EXT_C(grub_main) + +- /* +- * uboot_syscall(): +- * This function is effectively a veneer, so it cannot +- * modify the stack or corrupt any registers other than +- * r12 (ip). Furthermore it needs to restore r8 for +- * U-Boot (Global Data Pointer) and preserve it for Grub. +- */ +-FUNCTION(grub_uboot_syscall) +- str r8, transition_space +- str lr, transition_space + 4 +- str r9, transition_space + 8 +- +- ldr r8, gd_backup +- ldr r9, gd_backup + 4 +- +- bl do_syscall +- +- ldr r8, transition_space +- ldr lr, transition_space + 4 +- ldr r9, transition_space + 8 +- +- bx lr +-do_syscall: +- +- ldr ip, grub_uboot_syscall_ptr +- bx ip +- +-FUNCTION(grub_uboot_return) +- adr sp, entry_state_end +- pop {r4-r12, lr} +- mov sp, r12 +- bx lr +- +- + .align 3 +-@ U-boot context stack space +-entry_state_end: +-VARIABLE(grub_uboot_machine_type) ++@ U-boot/coreboot context stack space ++VARIABLE(grub_arm_saved_registers) ++ .long 0 @ r0 + .long 0 @ r1 +-VARIABLE(grub_uboot_boot_data) + .long 0 @ r2 + .long 0 @ r3 + .long 0 @ r4 + .long 0 @ r5 + .long 0 @ r6 + .long 0 @ r7 +-gd_backup: +- .long 0 @ r8 - U-Boot global data pointer up to 2013-09-21 +- .long 0 @ r9 - U-Boot global data pointer 2013-09-21 onwards +- .long 0 @ r10 +- .long 0 @ r11 +-VARIABLE(grub_uboot_search_hint)@ U-Boot stack pointer - +- .long 0 @ also API signature address hint. +- .long 0 @ lr +-entry_state: @ backup for U-Boot context +- +-@ GRUB context stack space +-transition_space: + .long 0 @ r8 +- .long 0 @ lr + .long 0 @ r9 +- +-VARIABLE(grub_uboot_syscall_ptr) +- .long 0 @ +- +- END ++ .long 0 @ r10 ++ .long 0 @ r11 ++ .long 0 @ sp ++ .long 0 @ lr ++entry_state: diff --git a/grub-core/kern/arm/uboot/uboot.S b/grub-core/kern/arm/uboot/uboot.S new file mode 100644 -index 000000000..d128775f1 +index 00000000000..d128775f19e --- /dev/null +++ b/grub-core/kern/arm/uboot/uboot.S @@ -0,0 +1,73 @@ @@ -289,116 +400,6 @@ index 000000000..d128775f1 + .long 0 @ + + END -diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c -index 5dcc106ed..3e338645c 100644 ---- a/grub-core/kern/uboot/init.c -+++ b/grub-core/kern/uboot/init.c -@@ -36,30 +36,14 @@ - extern char __bss_start[]; - extern char _end[]; - extern grub_size_t grub_total_module_size; --extern int (*grub_uboot_syscall_ptr) (int, int *, ...); - static unsigned long timer_start; - --extern grub_uint32_t grub_uboot_machine_type; --extern grub_addr_t grub_uboot_boot_data; -- - void - grub_exit (void) - { - grub_uboot_return (0); - } - --grub_uint32_t --grub_uboot_get_machine_type (void) --{ -- return grub_uboot_machine_type; --} -- --grub_addr_t --grub_uboot_get_boot_data (void) --{ -- return grub_uboot_boot_data; --} -- - static grub_uint64_t - uboot_timer_ms (void) - { -diff --git a/grub-core/kern/uboot/uboot.c b/grub-core/kern/uboot/uboot.c -index 6800a4beb..cf0168e62 100644 ---- a/grub-core/kern/uboot/uboot.c -+++ b/grub-core/kern/uboot/uboot.c -@@ -39,48 +39,13 @@ - * returns: 0 if the call not found, 1 if serviced - */ - --extern int (*grub_uboot_syscall_ptr) (int, int *, ...); - extern int grub_uboot_syscall (int, int *, ...); --extern grub_addr_t grub_uboot_search_hint; - - static struct sys_info uboot_sys_info; - static struct mem_region uboot_mem_info[5]; - static struct device_info * devices; - static int num_devices; - --int --grub_uboot_api_init (void) --{ -- struct api_signature *start, *end; -- struct api_signature *p; -- -- if (grub_uboot_search_hint) -- { -- /* Extended search range to work around Trim Slice U-Boot issue */ -- start = (struct api_signature *) ((grub_uboot_search_hint & ~0x000fffff) -- - 0x00500000); -- end = -- (struct api_signature *) ((grub_addr_t) start + UBOOT_API_SEARCH_LEN - -- API_SIG_MAGLEN + 0x00500000); -- } -- else -- { -- start = 0; -- end = (struct api_signature *) (256 * 1024 * 1024); -- } -- -- /* Structure alignment is (at least) 8 bytes */ -- for (p = start; p < end; p = (void *) ((grub_addr_t) p + 8)) -- { -- if (grub_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0) -- { -- grub_uboot_syscall_ptr = p->syscall; -- return p->version; -- } -- } -- -- return 0; --} - - /* - * All functions below are wrappers around the grub_uboot_syscall() function -diff --git a/include/grub/arm/startup.h b/include/grub/arm/startup.h -new file mode 100644 -index 000000000..9afb6c57c ---- /dev/null -+++ b/include/grub/arm/startup.h -@@ -0,0 +1,16 @@ -+#ifndef GRUB_STARTUP_CPU_HEADER -+#define GRUB_STARTUP_CPU_HEADER -+ -+struct grub_arm_startup_registers -+{ -+ /* registers 0-11 */ -+ /* for U-boot r[1] is machine type */ -+ /* for U-boot r[2] is boot data */ -+ grub_uint32_t r[12]; -+ grub_uint32_t sp; -+ grub_uint32_t lr; -+}; -+ -+extern struct grub_arm_startup_registers grub_arm_saved_registers; -+ -+#endif -- -2.14.3 +2.15.0 diff --git a/0016-coreboot-Split-parts-that-are-platform-independent.patch b/0016-coreboot-Split-parts-that-are-platform-independent.patch index 4fb2029..82b8407 100644 --- a/0016-coreboot-Split-parts-that-are-platform-independent.patch +++ b/0016-coreboot-Split-parts-that-are-platform-independent.patch @@ -1,12 +1,11 @@ From 461bfab7b7e47fd0a76bf6076a438af1b7e2184a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 19:06:22 +0200 -Subject: [PATCH 016/198] coreboot: Split parts that are platform-independent. +Subject: [PATCH 016/206] coreboot: Split parts that are platform-independent. We currently assume that coreboot is always i386, it's no longer the case, so split i386-coreboot parts from generic coreboot code. --- - grub-core/Makefile.am | 2 +- grub-core/Makefile.core.def | 6 +- grub-core/commands/i386/coreboot/cb_timestamps.c | 2 +- grub-core/commands/i386/coreboot/cbls.c | 2 +- @@ -16,27 +15,15 @@ so split i386-coreboot parts from generic coreboot code. grub-core/term/i386/coreboot/cbmemc.c | 2 +- grub-core/video/{i386 => }/coreboot/cbfb.c | 2 +- include/grub/{i386 => }/coreboot/lbio.h | 9 +++ + grub-core/Makefile.am | 2 +- 10 files changed, 99 insertions(+), 55 deletions(-) create mode 100644 grub-core/kern/coreboot/cbtable.c rename grub-core/kern/{i386 => }/coreboot/mmap.c (97%) rename grub-core/video/{i386 => }/coreboot/cbfb.c (99%) rename include/grub/{i386 => }/coreboot/lbio.h (93%) -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 809a8aa26..781d0ffbf 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -112,7 +112,7 @@ endif - - if COND_i386_coreboot - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h --KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/coreboot/lbio.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 diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index fb59a7b1d..45ed0fa6b 100644 +index fb59a7b1d6a..45ed0fa6b1c 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -166,7 +166,7 @@ kernel = { @@ -68,7 +55,7 @@ index fb59a7b1d..45ed0fa6b 100644 enable = i386_efi; enable = i386_qemu; diff --git a/grub-core/commands/i386/coreboot/cb_timestamps.c b/grub-core/commands/i386/coreboot/cb_timestamps.c -index e72f38d6e..e97ea6bed 100644 +index e72f38d6e05..e97ea6bed98 100644 --- a/grub-core/commands/i386/coreboot/cb_timestamps.c +++ b/grub-core/commands/i386/coreboot/cb_timestamps.c @@ -20,7 +20,7 @@ @@ -81,7 +68,7 @@ index e72f38d6e..e97ea6bed 100644 GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/grub-core/commands/i386/coreboot/cbls.c b/grub-core/commands/i386/coreboot/cbls.c -index e0a10596f..102291f42 100644 +index e0a10596fe2..102291f424a 100644 --- a/grub-core/commands/i386/coreboot/cbls.c +++ b/grub-core/commands/i386/coreboot/cbls.c @@ -20,7 +20,7 @@ @@ -95,7 +82,7 @@ index e0a10596f..102291f42 100644 GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/grub-core/kern/coreboot/cbtable.c b/grub-core/kern/coreboot/cbtable.c new file mode 100644 -index 000000000..996d3f407 +index 00000000000..996d3f40738 --- /dev/null +++ b/grub-core/kern/coreboot/cbtable.c @@ -0,0 +1,70 @@ @@ -173,7 +160,7 @@ diff --git a/grub-core/kern/i386/coreboot/mmap.c b/grub-core/kern/coreboot/mmap. similarity index 97% rename from grub-core/kern/i386/coreboot/mmap.c rename to grub-core/kern/coreboot/mmap.c -index 4d29f6b7d..caf8f7cef 100644 +index 4d29f6b7d90..caf8f7cef1b 100644 --- a/grub-core/kern/i386/coreboot/mmap.c +++ b/grub-core/kern/coreboot/mmap.c @@ -16,8 +16,8 @@ @@ -204,7 +191,7 @@ index 4d29f6b7d..caf8f7cef 100644 /* Multiboot mmaps match with the coreboot mmap definition. Therefore, we can just pass type diff --git a/grub-core/kern/i386/coreboot/cbtable.c b/grub-core/kern/i386/coreboot/cbtable.c -index 1669bc0ca..34a2b59be 100644 +index 1669bc0ca23..34a2b59be1f 100644 --- a/grub-core/kern/i386/coreboot/cbtable.c +++ b/grub-core/kern/i386/coreboot/cbtable.c @@ -17,7 +17,7 @@ @@ -283,7 +270,7 @@ index 1669bc0ca..34a2b59be 100644 return 0; } diff --git a/grub-core/term/i386/coreboot/cbmemc.c b/grub-core/term/i386/coreboot/cbmemc.c -index 25e64a05c..129248c7f 100644 +index 25e64a05c03..129248c7f47 100644 --- a/grub-core/term/i386/coreboot/cbmemc.c +++ b/grub-core/term/i386/coreboot/cbmemc.c @@ -23,7 +23,7 @@ @@ -299,7 +286,7 @@ diff --git a/grub-core/video/i386/coreboot/cbfb.c b/grub-core/video/coreboot/cbf similarity index 99% rename from grub-core/video/i386/coreboot/cbfb.c rename to grub-core/video/coreboot/cbfb.c -index dede0c37e..9af81fa5b 100644 +index dede0c37ea3..9af81fa5b01 100644 --- a/grub-core/video/i386/coreboot/cbfb.c +++ b/grub-core/video/coreboot/cbfb.c @@ -25,7 +25,7 @@ @@ -315,7 +302,7 @@ diff --git a/include/grub/i386/coreboot/lbio.h b/include/grub/coreboot/lbio.h similarity index 93% rename from include/grub/i386/coreboot/lbio.h rename to include/grub/coreboot/lbio.h -index 1c3fa6f19..5076d36c7 100644 +index 1c3fa6f1953..5076d36c71b 100644 --- a/include/grub/i386/coreboot/lbio.h +++ b/include/grub/coreboot/lbio.h @@ -20,6 +20,9 @@ @@ -339,6 +326,19 @@ index 1c3fa6f19..5076d36c7 100644 +grub_linuxbios_check_signature (grub_linuxbios_table_header_t tbl_header); + #endif +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 809a8aa26bf..781d0ffbf75 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -112,7 +112,7 @@ endif + + if COND_i386_coreboot + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h +-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/coreboot/lbio.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 -- -2.14.3 +2.15.0 diff --git a/0017-Rename-uboot-halt.c-to-dummy-halt.c.patch b/0017-Rename-uboot-halt.c-to-dummy-halt.c.patch index 6559451..576afa6 100644 --- a/0017-Rename-uboot-halt.c-to-dummy-halt.c.patch +++ b/0017-Rename-uboot-halt.c-to-dummy-halt.c.patch @@ -1,7 +1,7 @@ From 1daa716c7017f1858de117a20a31da66815435c5 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 19:31:55 +0200 -Subject: [PATCH 017/198] Rename uboot/halt.c to dummy/halt.c. +Subject: [PATCH 017/206] Rename uboot/halt.c to dummy/halt.c. It's not U-Boot specific and it's a stub. --- @@ -11,7 +11,7 @@ It's not U-Boot specific and it's a stub. rename grub-core/lib/{uboot => dummy}/halt.c (100%) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 45ed0fa6b..2a38bd4bc 100644 +index 45ed0fa6b1c..2a38bd4bc8a 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -841,7 +841,7 @@ module = { @@ -28,5 +28,5 @@ similarity index 100% rename from grub-core/lib/uboot/halt.c rename to grub-core/lib/dummy/halt.c -- -2.14.3 +2.15.0 diff --git a/0018-Rename-uboot-datetime-to-dummy-datetime.patch b/0018-Rename-uboot-datetime-to-dummy-datetime.patch index a0ca5db..e9ef326 100644 --- a/0018-Rename-uboot-datetime-to-dummy-datetime.patch +++ b/0018-Rename-uboot-datetime-to-dummy-datetime.patch @@ -1,7 +1,7 @@ From 9808c3ef956c6472a96790b60cf74f4eaa742010 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 19:37:29 +0200 -Subject: [PATCH 018/198] Rename uboot/datetime to dummy/datetime. +Subject: [PATCH 018/206] Rename uboot/datetime to dummy/datetime. It's just a stub and is not UBoot-specific. --- @@ -11,7 +11,7 @@ It's just a stub and is not UBoot-specific. rename grub-core/lib/{uboot => dummy}/datetime.c (91%) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 2a38bd4bc..6540dc951 100644 +index 2a38bd4bc8a..6540dc951d4 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1552,7 +1552,7 @@ module = { @@ -27,7 +27,7 @@ diff --git a/grub-core/lib/uboot/datetime.c b/grub-core/lib/dummy/datetime.c similarity index 91% rename from grub-core/lib/uboot/datetime.c rename to grub-core/lib/dummy/datetime.c -index 4be716928..cf693fc6b 100644 +index 4be716928a5..cf693fc6b62 100644 --- a/grub-core/lib/uboot/datetime.c +++ b/grub-core/lib/dummy/datetime.c @@ -18,7 +18,6 @@ @@ -54,5 +54,5 @@ index 4be716928..cf693fc6b 100644 + "can\'t set datetime on this machine"); } -- -2.14.3 +2.15.0 diff --git a/0019-arm-coreboot-Start-new-port.patch b/0019-arm-coreboot-Start-new-port.patch index 933a595..7b94f38 100644 --- a/0019-arm-coreboot-Start-new-port.patch +++ b/0019-arm-coreboot-Start-new-port.patch @@ -1,37 +1,37 @@ From 24e37a885269bdec9b27babf1da0bba3692d55c0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 20:53:28 +0200 -Subject: [PATCH 019/198] arm-coreboot: Start new port. +Subject: [PATCH 019/206] arm-coreboot: Start new port. --- configure.ac | 2 + - gentpl.py | 8 ++- - grub-core/Makefile.am | 10 +++ grub-core/Makefile.core.def | 18 ++++- grub-core/kern/arm/coreboot/cbtable.c | 40 +++++++++++ - grub-core/kern/arm/coreboot/coreboot.S | 44 ++++++++++++ grub-core/kern/arm/coreboot/init.c | 127 +++++++++++++++++++++++++++++++++ grub-core/kern/arm/coreboot/timer.c | 65 +++++++++++++++++ - grub-core/kern/arm/startup.S | 4 ++ grub-core/kern/coreboot/cbtable.c | 2 + grub-core/lib/dummy/reboot.c | 32 +++++++++ grub-core/loader/arm/linux.c | 3 + + util/grub-mkimagexx.c | 19 +++-- + util/mkimage.c | 41 ++++++++++- include/grub/arm/coreboot/console.h | 29 ++++++++ include/grub/arm/coreboot/kernel.h | 44 ++++++++++++ include/grub/offsets.h | 6 ++ - util/grub-mkimagexx.c | 19 +++-- - util/mkimage.c | 41 ++++++++++- + grub-core/kern/arm/coreboot/coreboot.S | 44 ++++++++++++ + grub-core/kern/arm/startup.S | 4 ++ + gentpl.py | 8 ++- + grub-core/Makefile.am | 10 +++ 17 files changed, 482 insertions(+), 12 deletions(-) create mode 100644 grub-core/kern/arm/coreboot/cbtable.c - create mode 100644 grub-core/kern/arm/coreboot/coreboot.S create mode 100644 grub-core/kern/arm/coreboot/init.c create mode 100644 grub-core/kern/arm/coreboot/timer.c create mode 100644 grub-core/lib/dummy/reboot.c create mode 100644 include/grub/arm/coreboot/console.h create mode 100644 include/grub/arm/coreboot/kernel.h + create mode 100644 grub-core/kern/arm/coreboot/coreboot.S diff --git a/configure.ac b/configure.ac -index ee2c86537..571f7a0b5 100644 +index ee2c86537e9..571f7a0b5aa 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,7 @@ case "$target_cpu"-"$platform" in @@ -50,69 +50,8 @@ index ee2c86537..571f7a0b5 100644 AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi]) AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ]) AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi]) -diff --git a/gentpl.py b/gentpl.py -index f08bcc404..ed268178b 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -31,7 +31,8 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", - "i386_xen", "x86_64_xen", - "mips_loongson", "sparc64_ieee1275", - "powerpc_ieee1275", "mips_arc", "ia64_efi", -- "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi" ] -+ "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi", -+ "arm_coreboot"] - - GROUPS = {} - -@@ -44,7 +45,7 @@ GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"] - GROUPS["mips"] = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ] - GROUPS["sparc64"] = [ "sparc64_ieee1275" ] - GROUPS["powerpc"] = [ "powerpc_ieee1275" ] --GROUPS["arm"] = [ "arm_uboot", "arm_efi" ] -+GROUPS["arm"] = [ "arm_uboot", "arm_efi", "arm_coreboot" ] - GROUPS["arm64"] = [ "arm64_efi" ] - - # Groups based on firmware -@@ -52,6 +53,7 @@ GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi", "arm64_efi" - GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ] - GROUPS["uboot"] = [ "arm_uboot" ] - GROUPS["xen"] = [ "i386_xen", "x86_64_xen" ] -+GROUPS["coreboot"] = [ "i386_coreboot", "arm_coreboot" ] - - # emu is a special case so many core functionality isn't needed on this platform - GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu") -@@ -64,7 +66,7 @@ GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"] - GROUPS["usb"] = GROUPS["pci"] - - # If gfxterm is main output console integrate it into kernel --GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ] -+GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ] - GROUPS["videomodules"] = GRUB_PLATFORMS[:]; - for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i) - -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 781d0ffbf..bec058554 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -239,6 +239,16 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h - endif - -+if COND_arm_coreboot -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.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/bufio.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h -+endif -+ - if COND_arm_efi - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6540dc951..411dca46b 100644 +index 6540dc951d4..411dca46bf2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -92,6 +92,8 @@ kernel = { @@ -199,7 +138,7 @@ index 6540dc951..411dca46b 100644 sparc64_ieee1275 = lib/ieee1275/cmos.c; diff --git a/grub-core/kern/arm/coreboot/cbtable.c b/grub-core/kern/arm/coreboot/cbtable.c new file mode 100644 -index 000000000..8a655bb5c +index 00000000000..8a655bb5cc2 --- /dev/null +++ b/grub-core/kern/arm/coreboot/cbtable.c @@ -0,0 +1,40 @@ @@ -243,59 +182,9 @@ index 000000000..8a655bb5c + + return table_header; +} -diff --git a/grub-core/kern/arm/coreboot/coreboot.S b/grub-core/kern/arm/coreboot/coreboot.S -new file mode 100644 -index 000000000..a1104526c ---- /dev/null -+++ b/grub-core/kern/arm/coreboot/coreboot.S -@@ -0,0 +1,44 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2016 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 . -+ */ -+ -+#include -+ -+ .file "coreboot.S" -+ .text -+ .syntax unified -+#if !defined (__thumb2__) -+ .arch armv7a -+ .arm -+#else -+ .arch armv7 -+ .thumb -+#endif -+ -+FUNCTION(grub_arm_pfr1) -+ mrc p15, 0, r0, c0, c1, 1 -+ bx lr -+ -+FUNCTION(grub_armv7_get_timer_value) -+ isb -+ mrrc p15, 1, r0, r1, c14 -+ bx lr -+ -+FUNCTION(grub_armv7_get_timer_frequency) -+ mrc p15, 0, r0, c14, c0, 0 -+ bx lr -+ diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c new file mode 100644 -index 000000000..51ecaceb0 +index 00000000000..51ecaceb005 --- /dev/null +++ b/grub-core/kern/arm/coreboot/init.c @@ -0,0 +1,127 @@ @@ -428,7 +317,7 @@ index 000000000..51ecaceb0 +} diff --git a/grub-core/kern/arm/coreboot/timer.c b/grub-core/kern/arm/coreboot/timer.c new file mode 100644 -index 000000000..ebefb99d5 +index 00000000000..ebefb99d58f --- /dev/null +++ b/grub-core/kern/arm/coreboot/timer.c @@ -0,0 +1,65 @@ @@ -497,37 +386,8 @@ index 000000000..ebefb99d5 + if (!have_timer) + grub_fatal ("No timer found"); +} -diff --git a/grub-core/kern/arm/startup.S b/grub-core/kern/arm/startup.S -index 640837cba..3946fe8e1 100644 ---- a/grub-core/kern/arm/startup.S -+++ b/grub-core/kern/arm/startup.S -@@ -24,6 +24,7 @@ - * GRUB is called from U-Boot as a Linux Kernel type image, which - * means among other things that it always enters in ARM state. - * -+ * coreboot starts in ARM mode as well. - * - * Overview of GRUB image layout: - * -@@ -127,6 +128,8 @@ reloc_done: - - str r1, EXT_C(grub_modbase) - -+ /* Coreboot already places modules at right place. */ -+#ifndef GRUB_MACHINE_COREBOOT - add r1, r1, r2 - add r0, r0, r2 - sub r1, r1, #4 -@@ -136,6 +139,7 @@ reloc_done: - str r3, [r1], #-4 @ *dst-- = r3 - subs r2, #4 @ remaining -= 4 - bne 1b @ while remaining != 0 -+#endif - - @ Since we _are_ the C run-time, we need to manually zero the BSS - @ region before continuing diff --git a/grub-core/kern/coreboot/cbtable.c b/grub-core/kern/coreboot/cbtable.c -index 996d3f407..aec63dbd1 100644 +index 996d3f40738..aec63dbd120 100644 --- a/grub-core/kern/coreboot/cbtable.c +++ b/grub-core/kern/coreboot/cbtable.c @@ -23,6 +23,8 @@ @@ -541,7 +401,7 @@ index 996d3f407..aec63dbd1 100644 grub_linuxbios_check_signature (grub_linuxbios_table_header_t tbl_header) diff --git a/grub-core/lib/dummy/reboot.c b/grub-core/lib/dummy/reboot.c new file mode 100644 -index 000000000..b8cbed8f8 +index 00000000000..b8cbed8f811 --- /dev/null +++ b/grub-core/lib/dummy/reboot.c @@ -0,0 +1,32 @@ @@ -578,7 +438,7 @@ index 000000000..b8cbed8f8 + while (1); +} diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c -index 5b39f02bb..01374ee78 100644 +index 5b39f02bb2e..01374ee78fa 100644 --- a/grub-core/loader/arm/linux.c +++ b/grub-core/loader/arm/linux.c @@ -31,6 +31,8 @@ @@ -595,110 +455,8 @@ index 5b39f02bb..01374ee78 100644 grub_unregister_command (cmd_devicetree); } +#endif -diff --git a/include/grub/arm/coreboot/console.h b/include/grub/arm/coreboot/console.h -new file mode 100644 -index 000000000..13a14b783 ---- /dev/null -+++ b/include/grub/arm/coreboot/console.h -@@ -0,0 +1,29 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2009 Free Software Foundation, Inc. -+ * -+ * GRUB is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * GRUB is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with GRUB. If not, see . -+ */ -+ -+#ifndef GRUB_MACHINE_CONSOLE_HEADER -+#define GRUB_MACHINE_CONSOLE_HEADER 1 -+ -+void grub_video_coreboot_fb_init (void); -+void grub_video_coreboot_fb_early_init (void); -+void grub_video_coreboot_fb_late_init (void); -+void grub_video_coreboot_fb_fini (void); -+ -+extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable; -+ -+#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */ -diff --git a/include/grub/arm/coreboot/kernel.h b/include/grub/arm/coreboot/kernel.h -new file mode 100644 -index 000000000..09cd7fe32 ---- /dev/null -+++ b/include/grub/arm/coreboot/kernel.h -@@ -0,0 +1,44 @@ -+/* -+ * 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 . -+ */ -+ -+#ifndef GRUB_KERNEL_MACHINE_HEADER -+#define GRUB_KERNEL_MACHINE_HEADER 1 -+ -+#ifndef ASM_FILE -+ -+#include -+#include -+ -+struct grub_fdt_board -+{ -+ const char *vendor, *part; -+ const grub_uint8_t *dtb; -+ grub_size_t dtb_size; -+}; -+ -+extern struct grub_fdt_board grub_fdt_boards[]; -+void grub_machine_timer_init (void); -+void grub_pl050_init (void); -+void -+grub_cros_init (void); -+extern grub_addr_t EXPORT_VAR (start_of_ram); -+#endif /* ! ASM_FILE */ -+ -+#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE -+ -+#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ -diff --git a/include/grub/offsets.h b/include/grub/offsets.h -index c88c86d4d..bf0689fc9 100644 ---- a/include/grub/offsets.h -+++ b/include/grub/offsets.h -@@ -122,6 +122,12 @@ - #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 - #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 - -+#define GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN 0x8 -+#define GRUB_KERNEL_ARM_COREBOOT_TOTAL_MODULE_SIZE 0x4 -+ -+#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000 -+#define GRUB_KERNEL_ARM_COREBOOT_MOD_GAP (GRUB_KERNEL_ARM_STACK_SIZE + 1024) -+ - /* Minimal gap between _end and the start of the modules. It's a hack - for PowerMac to prevent "CLAIM failed" error. The real fix is to - rewrite grub-mkimage to generate valid ELF files. */ diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index 3fab93e20..a2bb05439 100644 +index 3fab93e2088..a2bb05439f0 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -87,7 +87,8 @@ struct fixup_block_list @@ -764,7 +522,7 @@ index 3fab93e20..a2bb05439 100644 { if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) diff --git a/util/mkimage.c b/util/mkimage.c -index 528166c87..6aa77ed73 100644 +index 528166c87ac..6aa77ed7367 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -533,6 +533,45 @@ static const struct grub_install_image_target_desc image_targets[] = @@ -822,6 +580,248 @@ index 528166c87..6aa77ed73 100644 grub_util_error (_("kernel image is too big (0x%x > 0x%x)"), (unsigned) layout.kernel_size + (unsigned) layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR, +diff --git a/include/grub/arm/coreboot/console.h b/include/grub/arm/coreboot/console.h +new file mode 100644 +index 00000000000..13a14b78383 +--- /dev/null ++++ b/include/grub/arm/coreboot/console.h +@@ -0,0 +1,29 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2009 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#ifndef GRUB_MACHINE_CONSOLE_HEADER ++#define GRUB_MACHINE_CONSOLE_HEADER 1 ++ ++void grub_video_coreboot_fb_init (void); ++void grub_video_coreboot_fb_early_init (void); ++void grub_video_coreboot_fb_late_init (void); ++void grub_video_coreboot_fb_fini (void); ++ ++extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable; ++ ++#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */ +diff --git a/include/grub/arm/coreboot/kernel.h b/include/grub/arm/coreboot/kernel.h +new file mode 100644 +index 00000000000..09cd7fe328c +--- /dev/null ++++ b/include/grub/arm/coreboot/kernel.h +@@ -0,0 +1,44 @@ ++/* ++ * 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 . ++ */ ++ ++#ifndef GRUB_KERNEL_MACHINE_HEADER ++#define GRUB_KERNEL_MACHINE_HEADER 1 ++ ++#ifndef ASM_FILE ++ ++#include ++#include ++ ++struct grub_fdt_board ++{ ++ const char *vendor, *part; ++ const grub_uint8_t *dtb; ++ grub_size_t dtb_size; ++}; ++ ++extern struct grub_fdt_board grub_fdt_boards[]; ++void grub_machine_timer_init (void); ++void grub_pl050_init (void); ++void ++grub_cros_init (void); ++extern grub_addr_t EXPORT_VAR (start_of_ram); ++#endif /* ! ASM_FILE */ ++ ++#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE ++ ++#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ +diff --git a/include/grub/offsets.h b/include/grub/offsets.h +index c88c86d4d2e..bf0689fc99a 100644 +--- a/include/grub/offsets.h ++++ b/include/grub/offsets.h +@@ -122,6 +122,12 @@ + #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 + #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 + ++#define GRUB_KERNEL_ARM_COREBOOT_MOD_ALIGN 0x8 ++#define GRUB_KERNEL_ARM_COREBOOT_TOTAL_MODULE_SIZE 0x4 ++ ++#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000 ++#define GRUB_KERNEL_ARM_COREBOOT_MOD_GAP (GRUB_KERNEL_ARM_STACK_SIZE + 1024) ++ + /* Minimal gap between _end and the start of the modules. It's a hack + for PowerMac to prevent "CLAIM failed" error. The real fix is to + rewrite grub-mkimage to generate valid ELF files. */ +diff --git a/grub-core/kern/arm/coreboot/coreboot.S b/grub-core/kern/arm/coreboot/coreboot.S +new file mode 100644 +index 00000000000..a1104526c15 +--- /dev/null ++++ b/grub-core/kern/arm/coreboot/coreboot.S +@@ -0,0 +1,44 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2016 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 . ++ */ ++ ++#include ++ ++ .file "coreboot.S" ++ .text ++ .syntax unified ++#if !defined (__thumb2__) ++ .arch armv7a ++ .arm ++#else ++ .arch armv7 ++ .thumb ++#endif ++ ++FUNCTION(grub_arm_pfr1) ++ mrc p15, 0, r0, c0, c1, 1 ++ bx lr ++ ++FUNCTION(grub_armv7_get_timer_value) ++ isb ++ mrrc p15, 1, r0, r1, c14 ++ bx lr ++ ++FUNCTION(grub_armv7_get_timer_frequency) ++ mrc p15, 0, r0, c14, c0, 0 ++ bx lr ++ +diff --git a/grub-core/kern/arm/startup.S b/grub-core/kern/arm/startup.S +index 640837cba51..3946fe8e183 100644 +--- a/grub-core/kern/arm/startup.S ++++ b/grub-core/kern/arm/startup.S +@@ -24,6 +24,7 @@ + * GRUB is called from U-Boot as a Linux Kernel type image, which + * means among other things that it always enters in ARM state. + * ++ * coreboot starts in ARM mode as well. + * + * Overview of GRUB image layout: + * +@@ -127,6 +128,8 @@ reloc_done: + + str r1, EXT_C(grub_modbase) + ++ /* Coreboot already places modules at right place. */ ++#ifndef GRUB_MACHINE_COREBOOT + add r1, r1, r2 + add r0, r0, r2 + sub r1, r1, #4 +@@ -136,6 +139,7 @@ reloc_done: + str r3, [r1], #-4 @ *dst-- = r3 + subs r2, #4 @ remaining -= 4 + bne 1b @ while remaining != 0 ++#endif + + @ Since we _are_ the C run-time, we need to manually zero the BSS + @ region before continuing +diff --git a/gentpl.py b/gentpl.py +index f08bcc404f6..ed268178b4d 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -31,7 +31,8 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", + "i386_xen", "x86_64_xen", + "mips_loongson", "sparc64_ieee1275", + "powerpc_ieee1275", "mips_arc", "ia64_efi", +- "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi" ] ++ "mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi", ++ "arm_coreboot"] + + GROUPS = {} + +@@ -44,7 +45,7 @@ GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"] + GROUPS["mips"] = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ] + GROUPS["sparc64"] = [ "sparc64_ieee1275" ] + GROUPS["powerpc"] = [ "powerpc_ieee1275" ] +-GROUPS["arm"] = [ "arm_uboot", "arm_efi" ] ++GROUPS["arm"] = [ "arm_uboot", "arm_efi", "arm_coreboot" ] + GROUPS["arm64"] = [ "arm64_efi" ] + + # Groups based on firmware +@@ -52,6 +53,7 @@ GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi", "arm64_efi" + GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ] + GROUPS["uboot"] = [ "arm_uboot" ] + GROUPS["xen"] = [ "i386_xen", "x86_64_xen" ] ++GROUPS["coreboot"] = [ "i386_coreboot", "arm_coreboot" ] + + # emu is a special case so many core functionality isn't needed on this platform + GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu") +@@ -64,7 +66,7 @@ GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"] + GROUPS["usb"] = GROUPS["pci"] + + # If gfxterm is main output console integrate it into kernel +-GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ] ++GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ] + GROUPS["videomodules"] = GRUB_PLATFORMS[:]; + for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i) + +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 781d0ffbf75..bec0585549a 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -239,6 +239,16 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h + endif + ++if COND_arm_coreboot ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.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/bufio.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h ++endif ++ + if COND_arm_efi + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h -- -2.14.3 +2.15.0 diff --git a/0020-Add-support-for-device-tree-based-drivers.patch b/0020-Add-support-for-device-tree-based-drivers.patch index f29234a..238a209 100644 --- a/0020-Add-support-for-device-tree-based-drivers.patch +++ b/0020-Add-support-for-device-tree-based-drivers.patch @@ -1,66 +1,28 @@ From fcbb723d4b1f7ad4687191562621dd0eb25f4d9e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:19:59 +0200 -Subject: [PATCH 020/198] Add support for device-tree-based drivers. +Subject: [PATCH 020/206] Add support for device-tree-based drivers. --- - conf/Makefile.common | 4 +- - grub-core/Makefile.am | 10 ++ grub-core/Makefile.core.def | 2 + grub-core/bus/fdt.c | 255 +++++++++++++++++++++++++++++++++++++ grub-core/kern/arm/coreboot/init.c | 20 +++ - grub-core/lib/fdt.c | 142 +++++++++++++++------ + grub-core/lib/fdt.c | 152 ++++++++++++++++------ + util/grub-install-common.c | 2 +- + util/grub-mkimage.c | 11 +- + util/mkimage.c | 24 +++- include/grub/fdt.h | 23 ++-- include/grub/fdtbus.h | 73 +++++++++++ include/grub/kernel.h | 3 +- include/grub/util/install.h | 2 +- - util/grub-install-common.c | 2 +- - util/grub-mkimage.c | 11 +- - util/mkimage.c | 24 +++- - 13 files changed, 519 insertions(+), 52 deletions(-) + conf/Makefile.common | 4 +- + grub-core/Makefile.am | 10 ++ + 13 files changed, 524 insertions(+), 57 deletions(-) create mode 100644 grub-core/bus/fdt.c create mode 100644 include/grub/fdtbus.h -diff --git a/conf/Makefile.common b/conf/Makefile.common -index 11296b550..311da61c6 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -86,9 +86,11 @@ CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST - CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' - CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' - CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' -+CPPFLAGS_FDT_LIST := '-Dgrub_fdtbus_register(...)=FDT_DRIVER_LIST_MARKER(__VA_ARGS__)' - CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \ - $(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \ -- $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) -+ $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) \ -+ $(CPPFLAGS_FDT_LIST) - - # Define these variables to calm down automake - -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index bec058554..fc6ca3051 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -368,6 +368,16 @@ terminal.lst: $(MARKER_FILES) - platform_DATA += terminal.lst - CLEANFILES += terminal.lst - -+fdt.lst: $(MARKER_FILES) -+ (for pp in $^; do \ -+ b=`basename $$pp .marker`; \ -+ sed -n \ -+ -e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ -+ -e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \ -+ done) | sort -u > $@ -+platform_DATA += fdt.lst -+CLEANFILES += fdt.lst -+ - parttool.lst: $(MARKER_FILES) - (for pp in $^; do \ - b=`basename $$pp .marker`; \ diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 411dca46b..77d0b019e 100644 +index 411dca46bf2..77d0b019eb2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -158,6 +158,8 @@ kernel = { @@ -74,7 +36,7 @@ index 411dca46b..77d0b019e 100644 terminfoinkernel = term/tparm.c; diff --git a/grub-core/bus/fdt.c b/grub-core/bus/fdt.c new file mode 100644 -index 000000000..6fb077000 +index 00000000000..6fb077000a5 --- /dev/null +++ b/grub-core/bus/fdt.c @@ -0,0 +1,255 @@ @@ -334,7 +296,7 @@ index 000000000..6fb077000 + return dtb; +} diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c -index 51ecaceb0..aec75c672 100644 +index 51ecaceb005..aec75c672a2 100644 --- a/grub-core/kern/arm/coreboot/init.c +++ b/grub-core/kern/arm/coreboot/init.c @@ -33,6 +33,7 @@ @@ -379,7 +341,7 @@ index 51ecaceb0..aec75c672 100644 } diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c -index b5d520f20..bdc630244 100644 +index b5d520f2088..bdc6302448d 100644 --- a/grub-core/lib/fdt.c +++ b/grub-core/lib/fdt.c @@ -102,13 +102,13 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name) @@ -429,44 +391,18 @@ index b5d520f20..bdc630244 100644 { if (size < sizeof (grub_fdt_header_t) || (grub_fdt_get_totalsize (fdt) > size) -@@ -295,41 +295,29 @@ int grub_fdt_check_header (void *fdt, unsigned int size) +@@ -295,52 +295,104 @@ int grub_fdt_check_header (void *fdt, unsigned int size) return 0; } --/* Find a direct sub-node of a given parent node. */ --int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, -- const char *name) +static const grub_uint32_t * +advance_token (const void *fdt, const grub_uint32_t *token, const grub_uint32_t *end, int skip_current) - { -- grub_uint32_t *token, *end; -- char *node_name; -- -- if (parentoffset & 0x3) -- return -1; -- token = (void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt) -- + parentoffset); -- end = (void *) struct_end (fdt); -- if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE)) -- return -1; -- SKIP_NODE_NAME(node_name, token, end); -- while (token < end) ++{ + for (; token < end; skip_current = 0) - { -- switch (grub_be_to_cpu32(*token)) ++ { + switch (grub_be_to_cpu32 (*token)) - { - case FDT_BEGIN_NODE: -- node_name = (char *) (token + 1); -- if (node_name + grub_strlen (name) >= (char *) end) -- return -1; -- if (!grub_strcmp (node_name, name)) -- return (int) ((grub_addr_t) token - (grub_addr_t) fdt -- - grub_fdt_get_off_dt_struct (fdt)); -- token = get_next_node (fdt, node_name); -- if (!token) -- return -1; -- break; ++ { ++ case FDT_BEGIN_NODE: + if (skip_current) + { + token = get_next_node (fdt, (char *) (token + 1)); @@ -477,24 +413,21 @@ index b5d520f20..bdc630244 100644 + if (ptr >= (char *) end) + return 0; + return token; - case FDT_PROP: - /* Skip property token and following data (len, nameoff and property - value). */ - if (token >= end - 1) -- return -1; ++ case FDT_PROP: ++ /* Skip property token and following data (len, nameoff and property ++ value). */ ++ if (token >= end - 1) + return 0; - token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) - / sizeof(*token); - break; -@@ -337,10 +325,74 @@ int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, - token++; - break; - default: -- return -1; ++ token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) ++ / sizeof(*token); ++ break; ++ case FDT_NOP: ++ token++; ++ break; ++ default: + return 0; - } - } -- return -1; ++ } ++ } + return 0; +} + @@ -528,22 +461,55 @@ index b5d520f20..bdc630244 100644 + - grub_fdt_get_off_dt_struct (fdt)); +} + -+/* Find a direct sub-node of a given parent node. */ -+int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, -+ const char *name) -+{ + /* Find a direct sub-node of a given parent node. */ + int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset, + const char *name) + { +- grub_uint32_t *token, *end; +- char *node_name; + const grub_uint32_t *token, *end; + const char *node_name; + int skip_current = 0; -+ -+ if (parentoffset & 0x3) -+ return -1; + + if (parentoffset & 0x3) + return -1; +- token = (void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt) + token = (const void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt) -+ + parentoffset); + + parentoffset); +- end = (void *) struct_end (fdt); + end = (const void *) struct_end (fdt); -+ if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE)) -+ return -1; -+ SKIP_NODE_NAME(node_name, token, end); + if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE)) + return -1; + SKIP_NODE_NAME(node_name, token, end); +- while (token < end) +- { +- switch (grub_be_to_cpu32(*token)) +- { +- case FDT_BEGIN_NODE: +- node_name = (char *) (token + 1); +- if (node_name + grub_strlen (name) >= (char *) end) +- return -1; +- if (!grub_strcmp (node_name, name)) +- return (int) ((grub_addr_t) token - (grub_addr_t) fdt +- - grub_fdt_get_off_dt_struct (fdt)); +- token = get_next_node (fdt, node_name); +- if (!token) +- return -1; +- break; +- case FDT_PROP: +- /* Skip property token and following data (len, nameoff and property +- value). */ +- if (token >= end - 1) +- return -1; +- token += prop_entry_size(grub_be_to_cpu32(*(token + 1))) +- / sizeof(*token); +- break; +- case FDT_NOP: +- token++; +- break; +- default: +- return -1; +- } + while (1) { + token = advance_token (fdt, token, end, skip_current); + if (!token) @@ -553,7 +519,8 @@ index b5d520f20..bdc630244 100644 + if (grub_strcmp (node_name, name) == 0) + return (int) ((grub_addr_t) token - (grub_addr_t) fdt + - grub_fdt_get_off_dt_struct (fdt)); -+ } + } +- return -1; +} + +const char * @@ -588,8 +555,117 @@ index b5d520f20..bdc630244 100644 int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, const void *val, grub_uint32_t len) { +diff --git a/util/grub-install-common.c b/util/grub-install-common.c +index 452b230daed..8539ff3484d 100644 +--- a/util/grub-install-common.c ++++ b/util/grub-install-common.c +@@ -499,7 +499,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + grub_install_generate_image (dir, prefix, fp, outname, + modules.entries, memdisk_path, + pubkeys, npubkeys, config_path, tgt, +- note, compression); ++ note, compression, 0); + while (dc--) + grub_install_pop_module (); + } +diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c +index aba19d21b9a..98d24cc06ea 100644 +--- a/util/grub-mkimage.c ++++ b/util/grub-mkimage.c +@@ -71,6 +71,7 @@ static struct argp_option options[] = { + N_("embed FILE as a memdisk image\n" + "Implies `-p (memdisk)/boot/grub' and overrides any prefix supplied previously," + " but the prefix itself can be overridden by later options"), 0}, ++ {"dtb", 'D', N_("FILE"), 0, N_("embed FILE as a device tree (DTB)\n"), 0}, + /* TRANSLATORS: "embed" is a verb (command description). "*/ + {"config", 'c', N_("FILE"), 0, N_("embed FILE as an early config"), 0}, + /* TRANSLATORS: "embed" is a verb (command description). "*/ +@@ -117,6 +118,7 @@ struct arguments + char *dir; + char *prefix; + char *memdisk; ++ char *dtb; + char **pubkeys; + size_t npubkeys; + char *font; +@@ -176,6 +178,13 @@ argp_parser (int key, char *arg, struct argp_state *state) + arguments->prefix = xstrdup ("(memdisk)/boot/grub"); + break; + ++ case 'D': ++ if (arguments->dtb) ++ free (arguments->dtb); ++ ++ arguments->dtb = xstrdup (arg); ++ break; ++ + case 'k': + arguments->pubkeys = xrealloc (arguments->pubkeys, + sizeof (arguments->pubkeys[0]) +@@ -300,7 +309,7 @@ main (int argc, char *argv[]) + arguments.memdisk, arguments.pubkeys, + arguments.npubkeys, arguments.config, + arguments.image_target, arguments.note, +- arguments.comp); ++ arguments.comp, arguments.dtb); + + grub_util_file_sync (fp); + fclose (fp); +diff --git a/util/mkimage.c b/util/mkimage.c +index 6aa77ed7367..e22d82afa61 100644 +--- a/util/mkimage.c ++++ b/util/mkimage.c +@@ -777,13 +777,12 @@ grub_install_generate_image (const char *dir, const char *prefix, + char *memdisk_path, char **pubkey_paths, + size_t npubkeys, char *config_path, + const struct grub_install_image_target_desc *image_target, +- int note, +- grub_compression_t comp) ++ int note, grub_compression_t comp, const char *dtb_path) + { + char *kernel_img, *core_img; + size_t total_module_size, core_size; + size_t memdisk_size = 0, config_size = 0; +- size_t prefix_size = 0; ++ size_t prefix_size = 0, dtb_size = 0; + char *kernel_path; + size_t offset; + struct grub_util_path_list *path_list, *p; +@@ -828,6 +827,12 @@ grub_install_generate_image (const char *dir, const char *prefix, + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + ++ if (dtb_path) ++ { ++ dtb_size = ALIGN_UP(grub_util_get_image_size (dtb_path), 4); ++ total_module_size += dtb_size + sizeof (struct grub_module_header); ++ } ++ + if (config_path) + { + config_size = ALIGN_ADDR (grub_util_get_image_size (config_path) + 1); +@@ -950,6 +955,19 @@ grub_install_generate_image (const char *dir, const char *prefix, + offset += memdisk_size; + } + ++ if (dtb_path) ++ { ++ struct grub_module_header *header; ++ ++ header = (struct grub_module_header *) (kernel_img + offset); ++ header->type = grub_host_to_target32 (OBJ_TYPE_DTB); ++ header->size = grub_host_to_target32 (dtb_size + sizeof (*header)); ++ offset += sizeof (*header); ++ ++ grub_util_load_image (dtb_path, kernel_img + offset); ++ offset += dtb_size; ++ } ++ + if (config_path) + { + struct grub_module_header *header; diff --git a/include/grub/fdt.h b/include/grub/fdt.h -index fdfca75bf..75525fa31 100644 +index fdfca75bf48..75525fa317c 100644 --- a/include/grub/fdt.h +++ b/include/grub/fdt.h @@ -20,6 +20,7 @@ @@ -633,7 +709,7 @@ index fdfca75bf..75525fa31 100644 grub_uint32_t _val = grub_cpu_to_be32(val); \ diff --git a/include/grub/fdtbus.h b/include/grub/fdtbus.h new file mode 100644 -index 000000000..985837e55 +index 00000000000..985837e55f6 --- /dev/null +++ b/include/grub/fdtbus.h @@ -0,0 +1,73 @@ @@ -711,7 +787,7 @@ index 000000000..985837e55 + +#endif diff --git a/include/grub/kernel.h b/include/grub/kernel.h -index 20ddf2da2..ecd88ca72 100644 +index 20ddf2da297..ecd88ca72c6 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -28,7 +28,8 @@ enum @@ -725,7 +801,7 @@ index 20ddf2da2..ecd88ca72 100644 /* The module header. */ diff --git a/include/grub/util/install.h b/include/grub/util/install.h -index 5ca4811cd..6abd288c3 100644 +index 5ca4811cd13..6abd288c313 100644 --- a/include/grub/util/install.h +++ b/include/grub/util/install.h @@ -176,7 +176,7 @@ grub_install_generate_image (const char *dir, const char *prefix, @@ -737,115 +813,44 @@ index 5ca4811cd..6abd288c3 100644 const struct grub_install_image_target_desc * grub_install_get_image_target (const char *arg); -diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index 452b230da..8539ff348 100644 ---- a/util/grub-install-common.c -+++ b/util/grub-install-common.c -@@ -499,7 +499,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, - grub_install_generate_image (dir, prefix, fp, outname, - modules.entries, memdisk_path, - pubkeys, npubkeys, config_path, tgt, -- note, compression); -+ note, compression, 0); - while (dc--) - grub_install_pop_module (); - } -diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c -index aba19d21b..98d24cc06 100644 ---- a/util/grub-mkimage.c -+++ b/util/grub-mkimage.c -@@ -71,6 +71,7 @@ static struct argp_option options[] = { - N_("embed FILE as a memdisk image\n" - "Implies `-p (memdisk)/boot/grub' and overrides any prefix supplied previously," - " but the prefix itself can be overridden by later options"), 0}, -+ {"dtb", 'D', N_("FILE"), 0, N_("embed FILE as a device tree (DTB)\n"), 0}, - /* TRANSLATORS: "embed" is a verb (command description). "*/ - {"config", 'c', N_("FILE"), 0, N_("embed FILE as an early config"), 0}, - /* TRANSLATORS: "embed" is a verb (command description). "*/ -@@ -117,6 +118,7 @@ struct arguments - char *dir; - char *prefix; - char *memdisk; -+ char *dtb; - char **pubkeys; - size_t npubkeys; - char *font; -@@ -176,6 +178,13 @@ argp_parser (int key, char *arg, struct argp_state *state) - arguments->prefix = xstrdup ("(memdisk)/boot/grub"); - break; +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 11296b550a7..311da61c6c5 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -86,9 +86,11 @@ CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST + CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' + CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' + CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' ++CPPFLAGS_FDT_LIST := '-Dgrub_fdtbus_register(...)=FDT_DRIVER_LIST_MARKER(__VA_ARGS__)' + CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \ + $(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \ +- $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) ++ $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) \ ++ $(CPPFLAGS_FDT_LIST) -+ case 'D': -+ if (arguments->dtb) -+ free (arguments->dtb); -+ -+ arguments->dtb = xstrdup (arg); -+ break; -+ - case 'k': - arguments->pubkeys = xrealloc (arguments->pubkeys, - sizeof (arguments->pubkeys[0]) -@@ -300,7 +309,7 @@ main (int argc, char *argv[]) - arguments.memdisk, arguments.pubkeys, - arguments.npubkeys, arguments.config, - arguments.image_target, arguments.note, -- arguments.comp); -+ arguments.comp, arguments.dtb); + # Define these variables to calm down automake - grub_util_file_sync (fp); - fclose (fp); -diff --git a/util/mkimage.c b/util/mkimage.c -index 6aa77ed73..e22d82afa 100644 ---- a/util/mkimage.c -+++ b/util/mkimage.c -@@ -777,13 +777,12 @@ grub_install_generate_image (const char *dir, const char *prefix, - char *memdisk_path, char **pubkey_paths, - size_t npubkeys, char *config_path, - const struct grub_install_image_target_desc *image_target, -- int note, -- grub_compression_t comp) -+ int note, grub_compression_t comp, const char *dtb_path) - { - char *kernel_img, *core_img; - size_t total_module_size, core_size; - size_t memdisk_size = 0, config_size = 0; -- size_t prefix_size = 0; -+ size_t prefix_size = 0, dtb_size = 0; - char *kernel_path; - size_t offset; - struct grub_util_path_list *path_list, *p; -@@ -828,6 +827,12 @@ grub_install_generate_image (const char *dir, const char *prefix, - total_module_size += memdisk_size + sizeof (struct grub_module_header); - } +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index bec0585549a..fc6ca305147 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -368,6 +368,16 @@ terminal.lst: $(MARKER_FILES) + platform_DATA += terminal.lst + CLEANFILES += terminal.lst -+ if (dtb_path) -+ { -+ dtb_size = ALIGN_UP(grub_util_get_image_size (dtb_path), 4); -+ total_module_size += dtb_size + sizeof (struct grub_module_header); -+ } ++fdt.lst: $(MARKER_FILES) ++ (for pp in $^; do \ ++ b=`basename $$pp .marker`; \ ++ sed -n \ ++ -e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ ++ -e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \ ++ done) | sort -u > $@ ++platform_DATA += fdt.lst ++CLEANFILES += fdt.lst + - if (config_path) - { - config_size = ALIGN_ADDR (grub_util_get_image_size (config_path) + 1); -@@ -950,6 +955,19 @@ grub_install_generate_image (const char *dir, const char *prefix, - offset += memdisk_size; - } - -+ if (dtb_path) -+ { -+ struct grub_module_header *header; -+ -+ header = (struct grub_module_header *) (kernel_img + offset); -+ header->type = grub_host_to_target32 (OBJ_TYPE_DTB); -+ header->size = grub_host_to_target32 (dtb_size + sizeof (*header)); -+ offset += sizeof (*header); -+ -+ grub_util_load_image (dtb_path, kernel_img + offset); -+ offset += dtb_size; -+ } -+ - if (config_path) - { - struct grub_module_header *header; + parttool.lst: $(MARKER_FILES) + (for pp in $^; do \ + b=`basename $$pp .marker`; \ -- -2.14.3 +2.15.0 diff --git a/0021-arm-coreboot-Support-for-vexpress-timer.patch b/0021-arm-coreboot-Support-for-vexpress-timer.patch index 33f3fdb..ec127de 100644 --- a/0021-arm-coreboot-Support-for-vexpress-timer.patch +++ b/0021-arm-coreboot-Support-for-vexpress-timer.patch @@ -1,14 +1,14 @@ From 5a865b37866ee8cd64c080bc6fb1e537f8e2b3c6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:26:36 +0200 -Subject: [PATCH 021/198] arm-coreboot: Support for vexpress timer. +Subject: [PATCH 021/206] arm-coreboot: Support for vexpress timer. --- grub-core/kern/arm/coreboot/timer.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/grub-core/kern/arm/coreboot/timer.c b/grub-core/kern/arm/coreboot/timer.c -index ebefb99d5..d97b844f8 100644 +index ebefb99d58f..d97b844f848 100644 --- a/grub-core/kern/arm/coreboot/timer.c +++ b/grub-core/kern/arm/coreboot/timer.c @@ -21,6 +21,7 @@ @@ -69,5 +69,5 @@ index ebefb99d5..d97b844f8 100644 try_generic_timer (); if (!have_timer) -- -2.14.3 +2.15.0 diff --git a/0022-arm-coreboot-Export-FDT-routines.patch b/0022-arm-coreboot-Export-FDT-routines.patch index 621b2d6..467e14d 100644 --- a/0022-arm-coreboot-Export-FDT-routines.patch +++ b/0022-arm-coreboot-Export-FDT-routines.patch @@ -1,7 +1,7 @@ From ac6b41b89fbb82a3ba843a7ed19115d81432b604 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:29:48 +0200 -Subject: [PATCH 022/198] arm-coreboot: Export FDT routines. +Subject: [PATCH 022/206] arm-coreboot: Export FDT routines. We need to use them from modules as well. --- @@ -9,7 +9,7 @@ We need to use them from modules as well. 1 file changed, 2 insertions(+) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index fc6ca3051..147e6959c 100644 +index fc6ca305147..147e6959c97 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -246,7 +246,9 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h @@ -23,5 +23,5 @@ index fc6ca3051..147e6959c 100644 if COND_arm_efi -- -2.14.3 +2.15.0 diff --git a/0023-at_keyboard-Split-protocol-from-controller-code.patch b/0023-at_keyboard-Split-protocol-from-controller-code.patch index 2baa8c5..5ed6e57 100644 --- a/0023-at_keyboard-Split-protocol-from-controller-code.patch +++ b/0023-at_keyboard-Split-protocol-from-controller-code.patch @@ -1,22 +1,22 @@ From 216950a4eea1a1ead1c28eaca94e34ea2ef2ad19 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:41:22 +0200 -Subject: [PATCH 023/198] at_keyboard: Split protocol from controller code. +Subject: [PATCH 023/206] at_keyboard: Split protocol from controller code. On vexpress controller is different but protocol is the same, so reuse the code. --- grub-core/Makefile.core.def | 3 + - grub-core/term/at_keyboard.c | 426 +++---------------------------------------- - grub-core/term/ps2.c | 387 +++++++++++++++++++++++++++++++++++++++ + grub-core/term/at_keyboard.c | 428 +++---------------------------------------- + grub-core/term/ps2.c | 387 ++++++++++++++++++++++++++++++++++++++ include/grub/at_keyboard.h | 4 - include/grub/ps2.h | 43 +++++ - 5 files changed, 462 insertions(+), 401 deletions(-) + 5 files changed, 463 insertions(+), 402 deletions(-) create mode 100644 grub-core/term/ps2.c create mode 100644 include/grub/ps2.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 77d0b019e..6ade6e950 100644 +index 77d0b019eb2..6ade6e95057 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -251,6 +251,7 @@ kernel = { @@ -44,7 +44,7 @@ index 77d0b019e..6ade6e950 100644 }; diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c -index b4ea9ff7e..3ab4e205f 100644 +index b4ea9ff7e63..3ab4e205f40 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -22,212 +22,21 @@ @@ -71,13 +71,10 @@ index b4ea9ff7e..3ab4e205f 100644 static grub_uint8_t grub_keyboard_controller_orig; static grub_uint8_t grub_keyboard_orig_set; -static grub_uint8_t current_set; -+struct grub_ps2_state ps2_state; -+ -+static int ping_sent; - - static void - grub_keyboard_controller_init (void); - +- +-static void +-grub_keyboard_controller_init (void); +- -static const grub_uint8_t set1_mapping[128] = - { - /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, @@ -258,9 +255,13 @@ index b4ea9ff7e..3ab4e205f 100644 - {0x7a, GRUB_KEYBOARD_KEY_NPAGE}, - {0x7d, GRUB_KEYBOARD_KEY_PPAGE}, - }; -- --static int ping_sent; -- ++struct grub_ps2_state ps2_state; + + static int ping_sent; + ++static void ++grub_keyboard_controller_init (void); ++ static void keyboard_controller_wait_until_ready (void) { @@ -567,7 +568,7 @@ index b4ea9ff7e..3ab4e205f 100644 } diff --git a/grub-core/term/ps2.c b/grub-core/term/ps2.c new file mode 100644 -index 000000000..7ae4e9f2f +index 00000000000..7ae4e9f2f8c --- /dev/null +++ b/grub-core/term/ps2.c @@ -0,0 +1,387 @@ @@ -959,7 +960,7 @@ index 000000000..7ae4e9f2f + } +} diff --git a/include/grub/at_keyboard.h b/include/grub/at_keyboard.h -index b4f8ff0a0..b031523eb 100644 +index b4f8ff0a061..b031523eb7d 100644 --- a/include/grub/at_keyboard.h +++ b/include/grub/at_keyboard.h @@ -27,10 +27,6 @@ @@ -975,7 +976,7 @@ index b4f8ff0a0..b031523eb 100644 #define KEYBOARD_SCANCODE(x) ((x) & 0x7f) diff --git a/include/grub/ps2.h b/include/grub/ps2.h new file mode 100644 -index 000000000..4f2e527e4 +index 00000000000..4f2e527e497 --- /dev/null +++ b/include/grub/ps2.h @@ -0,0 +1,43 @@ @@ -1023,5 +1024,5 @@ index 000000000..4f2e527e4 + +#endif -- -2.14.3 +2.15.0 diff --git a/0024-arm_coreboot-Support-keyboard-for-vexpress.patch b/0024-arm_coreboot-Support-keyboard-for-vexpress.patch index 65b38de..dace31a 100644 --- a/0024-arm_coreboot-Support-keyboard-for-vexpress.patch +++ b/0024-arm_coreboot-Support-keyboard-for-vexpress.patch @@ -1,30 +1,18 @@ From 848bed9d92cf20e9f25db4c69a20efad23996ca0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:42:37 +0200 -Subject: [PATCH 024/198] arm_coreboot: Support keyboard for vexpress. +Subject: [PATCH 024/206] arm_coreboot: Support keyboard for vexpress. --- - grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 3 + grub-core/kern/arm/coreboot/init.c | 1 + grub-core/term/arm/pl050.c | 189 +++++++++++++++++++++++++++++++++++++ + grub-core/Makefile.am | 1 + 4 files changed, 194 insertions(+) create mode 100644 grub-core/term/arm/pl050.c -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 147e6959c..a2aaf9f54 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -240,6 +240,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h - endif - - if COND_arm_coreboot -+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6ade6e950..6be6e7f61 100644 +index 6ade6e95057..6be6e7f61ee 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -160,6 +160,9 @@ kernel = { @@ -38,7 +26,7 @@ index 6ade6e950..6be6e7f61 100644 terminfoinkernel = term/terminfo.c; terminfoinkernel = term/tparm.c; diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c -index aec75c672..a06ccb72f 100644 +index aec75c672a2..a06ccb72f42 100644 --- a/grub-core/kern/arm/coreboot/init.c +++ b/grub-core/kern/arm/coreboot/init.c @@ -133,6 +133,7 @@ grub_machine_init (void) @@ -51,7 +39,7 @@ index aec75c672..a06ccb72f 100644 void diff --git a/grub-core/term/arm/pl050.c b/grub-core/term/arm/pl050.c new file mode 100644 -index 000000000..e4cda3056 +index 00000000000..e4cda305666 --- /dev/null +++ b/grub-core/term/arm/pl050.c @@ -0,0 +1,189 @@ @@ -244,6 +232,18 @@ index 000000000..e4cda3056 +{ + grub_fdtbus_register (&pl050); +} +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 147e6959c97..a2aaf9f54b0 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -240,6 +240,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h + endif + + if COND_arm_coreboot ++KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h -- -2.14.3 +2.15.0 diff --git a/0025-arm_coreboot-Support-grub-mkstandalone.patch b/0025-arm_coreboot-Support-grub-mkstandalone.patch index 182c722..ae99cb8 100644 --- a/0025-arm_coreboot-Support-grub-mkstandalone.patch +++ b/0025-arm_coreboot-Support-grub-mkstandalone.patch @@ -1,47 +1,16 @@ From 3edabad8fefb112cc4b2d43be6e97d43c909ceee Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 21:59:48 +0200 -Subject: [PATCH 025/198] arm_coreboot: Support grub-mkstandalone. +Subject: [PATCH 025/206] arm_coreboot: Support grub-mkstandalone. --- - include/grub/util/install.h | 6 +++++- util/grub-install-common.c | 12 ++++++++++-- util/grub-install.c | 7 +++++++ + include/grub/util/install.h | 6 +++++- 3 files changed, 22 insertions(+), 3 deletions(-) -diff --git a/include/grub/util/install.h b/include/grub/util/install.h -index 6abd288c3..5910b0c09 100644 ---- a/include/grub/util/install.h -+++ b/include/grub/util/install.h -@@ -29,6 +29,8 @@ - #define GRUB_INSTALL_OPTIONS \ - { "modules", GRUB_INSTALL_OPTIONS_MODULES, N_("MODULES"), \ - 0, N_("pre-load specified modules MODULES"), 1 }, \ -+ { "dtb", GRUB_INSTALL_OPTIONS_DTB, N_("FILE"), \ -+ 0, N_("embed a specific DTB"), 1 }, \ - { "install-modules", GRUB_INSTALL_OPTIONS_INSTALL_MODULES, \ - N_("MODULES"), 0, \ - N_("install only MODULES and their dependencies [default=all]"), 1 }, \ -@@ -99,6 +101,7 @@ enum grub_install_plat - GRUB_INSTALL_PLATFORM_I386_XEN, - GRUB_INSTALL_PLATFORM_X86_64_XEN, - GRUB_INSTALL_PLATFORM_ARM64_EFI, -+ GRUB_INSTALL_PLATFORM_ARM_COREBOOT, - GRUB_INSTALL_PLATFORM_MAX - }; - -@@ -115,7 +118,8 @@ enum grub_install_options { - GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY, - GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY, - GRUB_INSTALL_OPTIONS_GRUB_MKIMAGE, -- GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS -+ GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS, -+ GRUB_INSTALL_OPTIONS_DTB - }; - - extern char *grub_install_source_directory; diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index 8539ff348..9e3e358c9 100644 +index 8539ff3484d..9e3e358c96a 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -73,6 +73,7 @@ grub_install_help_filter (int key, const char *text, @@ -94,7 +63,7 @@ index 8539ff348..9e3e358c9 100644 char * diff --git a/util/grub-install.c b/util/grub-install.c -index 9074d3e9e..75e3e5ba6 100644 +index 9074d3e9e52..75e3e5ba6f0 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -486,6 +486,7 @@ have_bootdev (enum grub_install_plat pl) @@ -153,6 +122,37 @@ index 9074d3e9e..75e3e5ba6 100644 case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT: case GRUB_INSTALL_PLATFORM_MIPSEL_ARC: case GRUB_INSTALL_PLATFORM_ARM_UBOOT: +diff --git a/include/grub/util/install.h b/include/grub/util/install.h +index 6abd288c313..5910b0c09bc 100644 +--- a/include/grub/util/install.h ++++ b/include/grub/util/install.h +@@ -29,6 +29,8 @@ + #define GRUB_INSTALL_OPTIONS \ + { "modules", GRUB_INSTALL_OPTIONS_MODULES, N_("MODULES"), \ + 0, N_("pre-load specified modules MODULES"), 1 }, \ ++ { "dtb", GRUB_INSTALL_OPTIONS_DTB, N_("FILE"), \ ++ 0, N_("embed a specific DTB"), 1 }, \ + { "install-modules", GRUB_INSTALL_OPTIONS_INSTALL_MODULES, \ + N_("MODULES"), 0, \ + N_("install only MODULES and their dependencies [default=all]"), 1 }, \ +@@ -99,6 +101,7 @@ enum grub_install_plat + GRUB_INSTALL_PLATFORM_I386_XEN, + GRUB_INSTALL_PLATFORM_X86_64_XEN, + GRUB_INSTALL_PLATFORM_ARM64_EFI, ++ GRUB_INSTALL_PLATFORM_ARM_COREBOOT, + GRUB_INSTALL_PLATFORM_MAX + }; + +@@ -115,7 +118,8 @@ enum grub_install_options { + GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY, + GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY, + GRUB_INSTALL_OPTIONS_GRUB_MKIMAGE, +- GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS ++ GRUB_INSTALL_OPTIONS_INSTALL_CORE_COMPRESS, ++ GRUB_INSTALL_OPTIONS_DTB + }; + + extern char *grub_install_source_directory; -- -2.14.3 +2.15.0 diff --git a/0026-arm_coreboot-Support-loading-linux-images.patch b/0026-arm_coreboot-Support-loading-linux-images.patch index a078387..4a11ebd 100644 --- a/0026-arm_coreboot-Support-loading-linux-images.patch +++ b/0026-arm_coreboot-Support-loading-linux-images.patch @@ -1,7 +1,7 @@ From 656c3b0d7fbe23f0e1ab561c8faa4ac4a37364d1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 22:00:06 +0200 -Subject: [PATCH 026/198] arm_coreboot: Support loading linux images. +Subject: [PATCH 026/206] arm_coreboot: Support loading linux images. --- grub-core/loader/arm/linux.c | 132 ++++++++++++++++++++++--------------------- @@ -9,7 +9,7 @@ Subject: [PATCH 026/198] arm_coreboot: Support loading linux images. 2 files changed, 83 insertions(+), 65 deletions(-) diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c -index 01374ee78..260cbf068 100644 +index 01374ee78fa..260cbf06861 100644 --- a/grub-core/loader/arm/linux.c +++ b/grub-core/loader/arm/linux.c @@ -31,8 +31,6 @@ @@ -271,7 +271,7 @@ index 01374ee78..260cbf068 100644 } -#endif diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h -index a66caad13..f217f8281 100644 +index a66caad13db..f217f8281ad 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -46,6 +46,22 @@ grub_arm_firmware_get_machine_type (void) @@ -298,5 +298,5 @@ index a66caad13..f217f8281 100644 #define FDT_ADDITIONAL_ENTRIES_SIZE 0x300 -- -2.14.3 +2.15.0 diff --git a/0027-arm_coreboot-Support-DMA.patch b/0027-arm_coreboot-Support-DMA.patch index 4c40b93..cdf961c 100644 --- a/0027-arm_coreboot-Support-DMA.patch +++ b/0027-arm_coreboot-Support-DMA.patch @@ -1,36 +1,24 @@ From 265292f2b0da0eb414c409871ba0f94a99ec33c1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 22:06:04 +0200 -Subject: [PATCH 027/198] arm_coreboot: Support DMA. +Subject: [PATCH 027/206] arm_coreboot: Support DMA. This is needed to support USB and some other busses. --- - grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 1 + grub-core/kern/arm/cache.c | 34 ++++++++++++++++++++++ - grub-core/kern/arm/cache_armv7.S | 12 ++++++++ grub-core/kern/arm/coreboot/dma.c | 59 +++++++++++++++++++++++++++++++++++++++ include/grub/cache.h | 7 ++--- include/grub/dma.h | 44 +++++++++++++++++++++++++++++ include/grub/pci.h | 22 +-------------- + grub-core/kern/arm/cache_armv7.S | 12 ++++++++ + grub-core/Makefile.am | 1 + 8 files changed, 155 insertions(+), 25 deletions(-) create mode 100644 grub-core/kern/arm/coreboot/dma.c create mode 100644 include/grub/dma.h -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index a2aaf9f54..104513847 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -248,6 +248,7 @@ 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/bufio.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdt.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dma.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdtbus.h - endif diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6be6e7f61..e4f253a20 100644 +index 6be6e7f61ee..e4f253a205e 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -163,6 +163,7 @@ kernel = { @@ -42,7 +30,7 @@ index 6be6e7f61..e4f253a20 100644 terminfoinkernel = term/terminfo.c; terminfoinkernel = term/tparm.c; diff --git a/grub-core/kern/arm/cache.c b/grub-core/kern/arm/cache.c -index 34154ccdb..af1c4bbf5 100644 +index 34154ccdb0e..af1c4bbf544 100644 --- a/grub-core/kern/arm/cache.c +++ b/grub-core/kern/arm/cache.c @@ -29,6 +29,8 @@ void grub_arm_clean_dcache_range_armv6 (grub_addr_t start, grub_addr_t end, @@ -93,32 +81,9 @@ index 34154ccdb..af1c4bbf5 100644 void grub_arm_disable_caches_mmu (void) { -diff --git a/grub-core/kern/arm/cache_armv7.S b/grub-core/kern/arm/cache_armv7.S -index 1ef2754af..5ae76a3d8 100644 ---- a/grub-core/kern/arm/cache_armv7.S -+++ b/grub-core/kern/arm/cache_armv7.S -@@ -33,6 +33,18 @@ - # define ISB isb - #define ARMV7 1 - -+FUNCTION(grub_arm_clean_dcache_range_poc_armv7) -+ DSB -+ @ Clean data cache for range to point-of-coherence -+1: cmp r0, r1 -+ bge 2f -+ mcr p15, 0, r0, c7, c14, 1 @ DCCMVAC -+ add r0, r0, r2 @ Next line -+ b 1b -+2: DSB -+ bx lr -+ -+ - @ r0 - CLIDR - @ r1 - LoC - @ r2 - current level diff --git a/grub-core/kern/arm/coreboot/dma.c b/grub-core/kern/arm/coreboot/dma.c new file mode 100644 -index 000000000..2c2a62789 +index 00000000000..2c2a6278904 --- /dev/null +++ b/grub-core/kern/arm/coreboot/dma.c @@ -0,0 +1,59 @@ @@ -182,7 +147,7 @@ index 000000000..2c2a62789 +} + diff --git a/include/grub/cache.h b/include/grub/cache.h -index fc669dfd1..1c98ce270 100644 +index fc669dfd189..1c98ce270b6 100644 --- a/include/grub/cache.h +++ b/include/grub/cache.h @@ -34,15 +34,14 @@ void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); @@ -206,7 +171,7 @@ index fc669dfd1..1c98ce270 100644 diff --git a/include/grub/dma.h b/include/grub/dma.h new file mode 100644 -index 000000000..19992ebc1 +index 00000000000..19992ebc131 --- /dev/null +++ b/include/grub/dma.h @@ -0,0 +1,44 @@ @@ -255,7 +220,7 @@ index 000000000..19992ebc1 + +#endif diff --git a/include/grub/pci.h b/include/grub/pci.h -index 70d9a0513..262c89b74 100644 +index 70d9a05131b..262c89b748b 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -142,27 +142,7 @@ grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (grub_pci_device_t dev, @@ -287,6 +252,41 @@ index 70d9a0513..262c89b74 100644 grub_uint8_t EXPORT_FUNC (grub_pci_find_capability) (grub_pci_device_t dev, grub_uint8_t cap); +diff --git a/grub-core/kern/arm/cache_armv7.S b/grub-core/kern/arm/cache_armv7.S +index 1ef2754af8a..5ae76a3d819 100644 +--- a/grub-core/kern/arm/cache_armv7.S ++++ b/grub-core/kern/arm/cache_armv7.S +@@ -33,6 +33,18 @@ + # define ISB isb + #define ARMV7 1 + ++FUNCTION(grub_arm_clean_dcache_range_poc_armv7) ++ DSB ++ @ Clean data cache for range to point-of-coherence ++1: cmp r0, r1 ++ bge 2f ++ mcr p15, 0, r0, c7, c14, 1 @ DCCMVAC ++ add r0, r0, r2 @ Next line ++ b 1b ++2: DSB ++ bx lr ++ ++ + @ r0 - CLIDR + @ r1 - LoC + @ r2 - current level +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index a2aaf9f54b0..10451384720 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -248,6 +248,7 @@ 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/bufio.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdt.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dma.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdtbus.h + endif -- -2.14.3 +2.15.0 diff --git a/0028-ehci-Split-core-code-from-PCI-part.patch b/0028-ehci-Split-core-code-from-PCI-part.patch index 074849f..346ca6e 100644 --- a/0028-ehci-Split-core-code-from-PCI-part.patch +++ b/0028-ehci-Split-core-code-from-PCI-part.patch @@ -1,7 +1,7 @@ From 058df7b5a9cc7aaa9872eaa916b715544a8f9840 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 22:10:26 +0200 -Subject: [PATCH 028/198] ehci: Split core code from PCI part. +Subject: [PATCH 028/206] ehci: Split core code from PCI part. On ARM often EHCI is present without PCI and just declared in device tree. So splitcore from PCI part. @@ -13,7 +13,7 @@ tree. So splitcore from PCI part. create mode 100644 grub-core/bus/usb/ehci-pci.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index e4f253a20..4745eb4d9 100644 +index e4f253a205e..4745eb4d93e 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -593,6 +593,7 @@ module = { @@ -26,7 +26,7 @@ index e4f253a20..4745eb4d9 100644 diff --git a/grub-core/bus/usb/ehci-pci.c b/grub-core/bus/usb/ehci-pci.c new file mode 100644 -index 000000000..65e6cb574 +index 00000000000..65e6cb57438 --- /dev/null +++ b/grub-core/bus/usb/ehci-pci.c @@ -0,0 +1,208 @@ @@ -239,7 +239,7 @@ index 000000000..65e6cb574 + grub_pci_iterate (grub_ehci_pci_iter, NULL); +} diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c -index 5f4297bb2..c772e7654 100644 +index 5f4297bb21e..c772e76546e 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -22,13 +22,10 @@ @@ -567,5 +567,5 @@ index 5f4297bb2..c772e7654 100644 grub_usb_controller_dev_register (&usb_controller); grub_boot_time ("EHCI driver registered"); -- -2.14.3 +2.15.0 diff --git a/0029-arm_coreboot-Support-EHCI.patch b/0029-arm_coreboot-Support-EHCI.patch index 6da884a..b9c852d 100644 --- a/0029-arm_coreboot-Support-EHCI.patch +++ b/0029-arm_coreboot-Support-EHCI.patch @@ -1,32 +1,19 @@ From d11ced1e1fb93676942e51618eb53c140f541890 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 8 May 2017 22:14:28 +0200 -Subject: [PATCH 029/198] arm_coreboot: Support EHCI. +Subject: [PATCH 029/206] arm_coreboot: Support EHCI. --- - gentpl.py | 2 +- grub-core/Makefile.core.def | 2 ++ grub-core/bus/usb/ehci-fdt.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ grub-core/bus/usb/usbtrans.c | 2 +- include/grub/usb.h | 4 ++++ + gentpl.py | 2 +- 5 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 grub-core/bus/usb/ehci-fdt.c -diff --git a/gentpl.py b/gentpl.py -index ed268178b..da67965a4 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -63,7 +63,7 @@ GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson", "mips_qemu_mips", - "sparc64_ieee1275", "powerpc_ieee1275"] - GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi"); - GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"] --GROUPS["usb"] = GROUPS["pci"] -+GROUPS["usb"] = GROUPS["pci"] + ["arm_coreboot"] - - # If gfxterm is main output console integrate it into kernel - GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ] diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 4745eb4d9..5ce506597 100644 +index 4745eb4d93e..5ce506597a6 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -593,8 +593,10 @@ module = { @@ -42,7 +29,7 @@ index 4745eb4d9..5ce506597 100644 module = { diff --git a/grub-core/bus/usb/ehci-fdt.c b/grub-core/bus/usb/ehci-fdt.c new file mode 100644 -index 000000000..29b50bdd5 +index 00000000000..29b50bdd5c3 --- /dev/null +++ b/grub-core/bus/usb/ehci-fdt.c @@ -0,0 +1,45 @@ @@ -92,7 +79,7 @@ index 000000000..29b50bdd5 + grub_fdtbus_register (&ehci); +} diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c -index 9266e4931..85f081fff 100644 +index 9266e49311c..85f081fffb3 100644 --- a/grub-core/bus/usb/usbtrans.c +++ b/grub-core/bus/usb/usbtrans.c @@ -18,7 +18,7 @@ @@ -105,7 +92,7 @@ index 9266e4931..85f081fff 100644 #include #include diff --git a/include/grub/usb.h b/include/grub/usb.h -index 11d96481f..512ae1dd0 100644 +index 11d96481ff6..512ae1dd0e6 100644 --- a/include/grub/usb.h +++ b/include/grub/usb.h @@ -321,5 +321,9 @@ grub_usb_err_t @@ -118,6 +105,19 @@ index 11d96481f..512ae1dd0 100644 +grub_ehci_pci_scan (void); #endif /* GRUB_USB_H */ +diff --git a/gentpl.py b/gentpl.py +index ed268178b4d..da67965a41a 100644 +--- a/gentpl.py ++++ b/gentpl.py +@@ -63,7 +63,7 @@ GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson", "mips_qemu_mips", + "sparc64_ieee1275", "powerpc_ieee1275"] + GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi"); + GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"] +-GROUPS["usb"] = GROUPS["pci"] ++GROUPS["usb"] = GROUPS["pci"] + ["arm_coreboot"] + + # If gfxterm is main output console integrate it into kernel + GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ] -- -2.14.3 +2.15.0 diff --git a/0030-Fix-bug-on-FDT-nodes-with-compatible-property.patch b/0030-Fix-bug-on-FDT-nodes-with-compatible-property.patch index 8a48760..35a4dc1 100644 --- a/0030-Fix-bug-on-FDT-nodes-with-compatible-property.patch +++ b/0030-Fix-bug-on-FDT-nodes-with-compatible-property.patch @@ -1,14 +1,14 @@ From 4f8471532d454b2db96434c28bf7105ed69e0f4d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 08:39:40 +0200 -Subject: [PATCH 030/198] Fix bug on FDT nodes with compatible property +Subject: [PATCH 030/206] Fix bug on FDT nodes with compatible property --- grub-core/bus/fdt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/bus/fdt.c b/grub-core/bus/fdt.c -index 6fb077000..34d535457 100644 +index 6fb077000a5..34d53545732 100644 --- a/grub-core/bus/fdt.c +++ b/grub-core/bus/fdt.c @@ -43,6 +43,8 @@ is_compatible (struct grub_fdtbus_driver *driver, @@ -21,5 +21,5 @@ index 6fb077000..34d535457 100644 while (compatible < compatible_end) { -- -2.14.3 +2.15.0 diff --git a/0031-fdtbus-Add-ability-to-send-receive-messages-on-paren.patch b/0031-fdtbus-Add-ability-to-send-receive-messages-on-paren.patch index 3abaa3d..e669ab4 100644 --- a/0031-fdtbus-Add-ability-to-send-receive-messages-on-paren.patch +++ b/0031-fdtbus-Add-ability-to-send-receive-messages-on-paren.patch @@ -1,7 +1,7 @@ From c4313c812dc14e82a774b580b5e34d40e7f3fae6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 08:40:29 +0200 -Subject: [PATCH 031/198] fdtbus: Add ability to send/receive messages on +Subject: [PATCH 031/206] fdtbus: Add ability to send/receive messages on parent busses. --- @@ -10,7 +10,7 @@ Subject: [PATCH 031/198] fdtbus: Add ability to send/receive messages on 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/grub-core/bus/fdt.c b/grub-core/bus/fdt.c -index 34d535457..135da497b 100644 +index 34d53545732..135da497ba6 100644 --- a/grub-core/bus/fdt.c +++ b/grub-core/bus/fdt.c @@ -25,30 +25,22 @@ static grub_size_t root_address_cells, root_size_cells; @@ -87,7 +87,7 @@ index 34d535457..135da497b 100644 } } diff --git a/include/grub/fdtbus.h b/include/grub/fdtbus.h -index 985837e55..f519c40ec 100644 +index 985837e55f6..f519c40ec35 100644 --- a/include/grub/fdtbus.h +++ b/include/grub/fdtbus.h @@ -22,7 +22,13 @@ @@ -130,5 +130,5 @@ index 985837e55..f519c40ec 100644 /* dtb is assumed to be unfreeable and must remain valid for lifetime of GRUB. -- -2.14.3 +2.15.0 diff --git a/0032-rk3288_spi-Add-SPI-driver.patch b/0032-rk3288_spi-Add-SPI-driver.patch index 2414c85..faa0d4c 100644 --- a/0032-rk3288_spi-Add-SPI-driver.patch +++ b/0032-rk3288_spi-Add-SPI-driver.patch @@ -1,7 +1,7 @@ From b0b1b81a11f8bae8ab9e8edd87ac3f4f7949d03b Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 08:42:14 +0200 -Subject: [PATCH 032/198] rk3288_spi: Add SPI driver +Subject: [PATCH 032/206] rk3288_spi: Add SPI driver --- grub-core/Makefile.core.def | 1 + @@ -12,7 +12,7 @@ Subject: [PATCH 032/198] rk3288_spi: Add SPI driver create mode 100644 grub-core/bus/spi/rk3288_spi.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 5ce506597..d2239f171 100644 +index 5ce506597a6..d2239f1718d 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -162,6 +162,7 @@ kernel = { @@ -25,7 +25,7 @@ index 5ce506597..d2239f171 100644 diff --git a/grub-core/bus/spi/rk3288_spi.c b/grub-core/bus/spi/rk3288_spi.c new file mode 100644 -index 000000000..aacb79ffe +index 00000000000..aacb79ffef1 --- /dev/null +++ b/grub-core/bus/spi/rk3288_spi.c @@ -0,0 +1,103 @@ @@ -133,7 +133,7 @@ index 000000000..aacb79ffe + grub_fdtbus_register (&spi); +} diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c -index a06ccb72f..0126ff638 100644 +index a06ccb72f42..0126ff6381a 100644 --- a/grub-core/kern/arm/coreboot/init.c +++ b/grub-core/kern/arm/coreboot/init.c @@ -132,6 +132,8 @@ grub_machine_init (void) @@ -146,7 +146,7 @@ index a06ccb72f..0126ff638 100644 grub_pl050_init (); } diff --git a/include/grub/arm/coreboot/kernel.h b/include/grub/arm/coreboot/kernel.h -index 09cd7fe32..269505342 100644 +index 09cd7fe328c..26950534270 100644 --- a/include/grub/arm/coreboot/kernel.h +++ b/include/grub/arm/coreboot/kernel.h @@ -34,8 +34,8 @@ struct grub_fdt_board @@ -161,5 +161,5 @@ index 09cd7fe32..269505342 100644 #endif /* ! ASM_FILE */ -- -2.14.3 +2.15.0 diff --git a/0033-arm_coreboot-Add-Chromebook-keyboard-driver.patch b/0033-arm_coreboot-Add-Chromebook-keyboard-driver.patch index df17282..3e0c23d 100644 --- a/0033-arm_coreboot-Add-Chromebook-keyboard-driver.patch +++ b/0033-arm_coreboot-Add-Chromebook-keyboard-driver.patch @@ -1,7 +1,7 @@ From 5c3fd1b135bd73c8e3467b9b635b25ca4d360a19 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 08:47:34 +0200 -Subject: [PATCH 033/198] arm_coreboot: Add Chromebook keyboard driver. +Subject: [PATCH 033/206] arm_coreboot: Add Chromebook keyboard driver. --- grub-core/term/arm/cros.c | 125 +++++++++++++++++++++++ @@ -14,7 +14,7 @@ Subject: [PATCH 033/198] arm_coreboot: Add Chromebook keyboard driver. diff --git a/grub-core/term/arm/cros.c b/grub-core/term/arm/cros.c new file mode 100644 -index 000000000..1ff9f8ccf +index 00000000000..1ff9f8ccfb8 --- /dev/null +++ b/grub-core/term/arm/cros.c @@ -0,0 +1,125 @@ @@ -145,7 +145,7 @@ index 000000000..1ff9f8ccf +} diff --git a/grub-core/term/arm/cros_ec.c b/grub-core/term/arm/cros_ec.c new file mode 100644 -index 000000000..f4144818b +index 00000000000..f4144818b5b --- /dev/null +++ b/grub-core/term/arm/cros_ec.c @@ -0,0 +1,238 @@ @@ -389,7 +389,7 @@ index 000000000..f4144818b + diff --git a/include/grub/arm/cros_ec.h b/include/grub/arm/cros_ec.h new file mode 100644 -index 000000000..45a372572 +index 00000000000..45a372572a5 --- /dev/null +++ b/include/grub/arm/cros_ec.h @@ -0,0 +1,21 @@ @@ -415,5 +415,5 @@ index 000000000..45a372572 + +#endif -- -2.14.3 +2.15.0 diff --git a/0034-Missing-parts-of-previous-commit.patch b/0034-Missing-parts-of-previous-commit.patch index c13996d..620ae27 100644 --- a/0034-Missing-parts-of-previous-commit.patch +++ b/0034-Missing-parts-of-previous-commit.patch @@ -1,7 +1,7 @@ From c6eaa982d12e3cfc5465dda5ea372774188b6b81 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 09:02:15 +0200 -Subject: [PATCH 034/198] Missing parts of previous commit +Subject: [PATCH 034/206] Missing parts of previous commit --- grub-core/Makefile.core.def | 2 ++ @@ -9,7 +9,7 @@ Subject: [PATCH 034/198] Missing parts of previous commit 2 files changed, 3 insertions(+) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index d2239f171..1d86bd22e 100644 +index d2239f1718d..1d86bd22e04 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -162,6 +162,8 @@ kernel = { @@ -22,7 +22,7 @@ index d2239f171..1d86bd22e 100644 arm_coreboot = commands/keylayouts.c; arm_coreboot = kern/arm/coreboot/dma.c; diff --git a/grub-core/kern/arm/coreboot/init.c b/grub-core/kern/arm/coreboot/init.c -index 0126ff638..8d8c5b829 100644 +index 0126ff6381a..8d8c5b8291e 100644 --- a/grub-core/kern/arm/coreboot/init.c +++ b/grub-core/kern/arm/coreboot/init.c @@ -135,6 +135,7 @@ grub_machine_init (void) @@ -34,5 +34,5 @@ index 0126ff638..8d8c5b829 100644 } -- -2.14.3 +2.15.0 diff --git a/0035-coreboot-Changed-cbmemc-to-support-updated-console-f.patch b/0035-coreboot-Changed-cbmemc-to-support-updated-console-f.patch index c2bc168..41c8bd2 100644 --- a/0035-coreboot-Changed-cbmemc-to-support-updated-console-f.patch +++ b/0035-coreboot-Changed-cbmemc-to-support-updated-console-f.patch @@ -1,7 +1,7 @@ From 70b555a52a065b2beb91e6fc97a6b358c931b303 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 9 May 2017 09:03:02 +0200 -Subject: [PATCH 035/198] coreboot: Changed cbmemc to support updated console +Subject: [PATCH 035/206] coreboot: Changed cbmemc to support updated console format from coreboot. --- @@ -9,7 +9,7 @@ Subject: [PATCH 035/198] coreboot: Changed cbmemc to support updated console 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/grub-core/term/i386/coreboot/cbmemc.c b/grub-core/term/i386/coreboot/cbmemc.c -index 129248c7f..cea9b8431 100644 +index 129248c7f47..cea9b84315b 100644 --- a/grub-core/term/i386/coreboot/cbmemc.c +++ b/grub-core/term/i386/coreboot/cbmemc.c @@ -29,11 +29,14 @@ @@ -94,5 +94,5 @@ index 129248c7f..cea9b8431 100644 } -- -2.14.3 +2.15.0 diff --git a/0036-at_keyboard-Fix-falco-chromebook-case.patch b/0036-at_keyboard-Fix-falco-chromebook-case.patch index 5251a4a..4fae41d 100644 --- a/0036-at_keyboard-Fix-falco-chromebook-case.patch +++ b/0036-at_keyboard-Fix-falco-chromebook-case.patch @@ -1,7 +1,7 @@ From c4b8bec5fee4e30a165fd14a188cf3ab8eccd095 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 9 May 2017 14:27:52 +0200 -Subject: [PATCH 036/198] at_keyboard: Fix falco chromebook case. +Subject: [PATCH 036/206] at_keyboard: Fix falco chromebook case. EC is slow, so we need few delays for it to toggle the bits correctly. @@ -12,7 +12,7 @@ Command to enable clock and keyboard were not sent. 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c -index 3ab4e205f..f0a986eb1 100644 +index 3ab4e205f40..f0a986eb176 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -40,6 +40,8 @@ grub_keyboard_controller_init (void); @@ -69,7 +69,7 @@ index 3ab4e205f..f0a986eb1 100644 write_mode (2); ps2_state.current_set = query_mode (); diff --git a/include/grub/at_keyboard.h b/include/grub/at_keyboard.h -index b031523eb..bcb4d9ba7 100644 +index b031523eb7d..bcb4d9ba78f 100644 --- a/include/grub/at_keyboard.h +++ b/include/grub/at_keyboard.h @@ -23,9 +23,11 @@ @@ -85,5 +85,5 @@ index b031523eb..bcb4d9ba7 100644 #define KEYBOARD_ISMAKE(x) !((x) & 0x80) #define KEYBOARD_ISREADY(x) ((x) & 0x01) -- -2.14.3 +2.15.0 diff --git a/0037-sparc64-Close-cdboot-ihandle.patch b/0037-sparc64-Close-cdboot-ihandle.patch index f8d979b..b1703ff 100644 --- a/0037-sparc64-Close-cdboot-ihandle.patch +++ b/0037-sparc64-Close-cdboot-ihandle.patch @@ -1,7 +1,7 @@ From bd4e40aadded7093908d786d03b4acf60b7b1707 Mon Sep 17 00:00:00 2001 From: Eric Snowberg Date: Thu, 11 May 2017 18:42:23 -0700 -Subject: [PATCH 037/198] sparc64: Close cdboot ihandle +Subject: [PATCH 037/206] sparc64: Close cdboot ihandle The ihandle is left open with a cd-core image. This will cause a delay booting grub from a virtual cdrom in a LDOM. It will also cause problems @@ -16,7 +16,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 10 insertions(+) diff --git a/grub-core/boot/sparc64/ieee1275/boot.S b/grub-core/boot/sparc64/ieee1275/boot.S -index 586efb401..9ea9b4e06 100644 +index 586efb4014e..9ea9b4e0662 100644 --- a/grub-core/boot/sparc64/ieee1275/boot.S +++ b/grub-core/boot/sparc64/ieee1275/boot.S @@ -69,6 +69,10 @@ prom_seek_name: .asciz "seek" @@ -44,5 +44,5 @@ index 586efb401..9ea9b4e06 100644 mov 512, %o3 #endif -- -2.14.3 +2.15.0 diff --git a/0038-arm64-xen_boot-Fix-Xen-boot-using-GRUB2-on-AARCH64.patch b/0038-arm64-xen_boot-Fix-Xen-boot-using-GRUB2-on-AARCH64.patch index 70ef5b3..9702794 100644 --- a/0038-arm64-xen_boot-Fix-Xen-boot-using-GRUB2-on-AARCH64.patch +++ b/0038-arm64-xen_boot-Fix-Xen-boot-using-GRUB2-on-AARCH64.patch @@ -1,7 +1,7 @@ From ae5817f1dcbf0b99f7a849f56afe442165317840 Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Fri, 19 Feb 2016 16:28:52 +0000 -Subject: [PATCH 038/198] arm64/xen_boot: Fix Xen boot using GRUB2 on AARCH64 +Subject: [PATCH 038/206] arm64/xen_boot: Fix Xen boot using GRUB2 on AARCH64 Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not @@ -15,7 +15,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c -index a914eb8e2..8ae43d7e8 100644 +index a914eb8e2df..8ae43d7e894 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) @@ -28,5 +28,5 @@ index a914eb8e2..8ae43d7e8 100644 return grub_error (GRUB_ERR_IO, "failed to update FDT"); -- -2.14.3 +2.15.0 diff --git a/0039-arm64-Add-nounzip-option-support-in-xen_module-comma.patch b/0039-arm64-Add-nounzip-option-support-in-xen_module-comma.patch index 0df0fd3..05bfcf0 100644 --- a/0039-arm64-Add-nounzip-option-support-in-xen_module-comma.patch +++ b/0039-arm64-Add-nounzip-option-support-in-xen_module-comma.patch @@ -1,7 +1,7 @@ From 8eed7be8a61c295df700e918744a984162378ca9 Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Sun, 14 May 2017 15:43:45 +0800 -Subject: [PATCH 039/198] arm64: Add "--nounzip" option support in xen_module +Subject: [PATCH 039/206] arm64: Add "--nounzip" option support in xen_module command This patch adds "--nounzip" option support in order to @@ -18,7 +18,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 16 insertions(+) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c -index 8ae43d7e8..27ede46ca 100644 +index 8ae43d7e894..27ede46cac5 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -379,6 +379,20 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), @@ -52,5 +52,5 @@ index 8ae43d7e8..27ede46ca 100644 if (!file) goto fail; -- -2.14.3 +2.15.0 diff --git a/0040-util-grub.d-20_linux_xen.in-Add-xen_boot-command-sup.patch b/0040-util-grub.d-20_linux_xen.in-Add-xen_boot-command-sup.patch index 0e6b2d7..eff0106 100644 --- a/0040-util-grub.d-20_linux_xen.in-Add-xen_boot-command-sup.patch +++ b/0040-util-grub.d-20_linux_xen.in-Add-xen_boot-command-sup.patch @@ -1,7 +1,7 @@ From d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Sun, 14 May 2017 15:43:46 +0800 -Subject: [PATCH 040/198] util/grub.d/20_linux_xen.in: Add xen_boot command +Subject: [PATCH 040/206] util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 This patch adds the support of xen_boot command for aarch64: @@ -20,7 +20,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index c48af948d..c002fc9f9 100644 +index c48af948d6e..c002fc9f946 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,16 @@ linux_entry () @@ -59,5 +59,5 @@ index c48af948d..c002fc9f9 100644 linux=`version_find_latest $list` gettext_printf "Found linux image: %s\n" "$linux" >&2 -- -2.14.3 +2.15.0 diff --git a/0041-arm64-Update-the-introduction-of-Xen-boot-commands-i.patch b/0041-arm64-Update-the-introduction-of-Xen-boot-commands-i.patch index b3658ed..a43e3c0 100644 --- a/0041-arm64-Update-the-introduction-of-Xen-boot-commands-i.patch +++ b/0041-arm64-Update-the-introduction-of-Xen-boot-commands-i.patch @@ -1,7 +1,7 @@ From 26c2f306fd425d2c0348023b8dcb7eb40a01851a Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Sun, 14 May 2017 15:43:47 +0800 -Subject: [PATCH 041/198] arm64: Update the introduction of Xen boot commands +Subject: [PATCH 041/206] arm64: Update the introduction of Xen boot commands in docs/grub.texi delete: xen_linux, xen_initrd, xen_xsm @@ -27,7 +27,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index e935af33e..a0c4b9e4e 100644 +index e935af33ea5..a0c4b9e4e8e 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -3873,11 +3873,9 @@ you forget a command, you can run the command @command{help} @@ -89,5 +89,5 @@ index e935af33e..a0c4b9e4e 100644 @section The list of networking commands -- -2.14.3 +2.15.0 diff --git a/0042-sparc64-Don-t-use-devspec-to-determine-the-OBP-path.patch b/0042-sparc64-Don-t-use-devspec-to-determine-the-OBP-path.patch index 4e7b1c6..2433209 100644 --- a/0042-sparc64-Don-t-use-devspec-to-determine-the-OBP-path.patch +++ b/0042-sparc64-Don-t-use-devspec-to-determine-the-OBP-path.patch @@ -1,7 +1,7 @@ From f8679cedff703b437171f4708d46adbfcff80a65 Mon Sep 17 00:00:00 2001 From: Eric Snowberg Date: Thu, 18 May 2017 17:10:22 -0600 -Subject: [PATCH 042/198] sparc64: Don't use devspec to determine the OBP path +Subject: [PATCH 042/206] sparc64: Don't use devspec to determine the OBP path Don't use devspec to determine the OBP path on SPARC hardware. Within all versions of Linux on SPARC, the devspec returns one of three values: @@ -28,7 +28,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 3 insertions(+) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c -index a79682a5e..dce4e59d0 100644 +index a79682a5e31..dce4e59d081 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -120,6 +120,8 @@ find_obppath (const char *sysfs_path_orig) @@ -49,5 +49,5 @@ index a79682a5e..dce4e59d0 100644 if (fd < 0 || fstat (fd, &st) < 0) { -- -2.14.3 +2.15.0 diff --git a/0043-Allow-GRUB-to-mount-ext2-3-4-filesystems-that-have-t.patch b/0043-Allow-GRUB-to-mount-ext2-3-4-filesystems-that-have-t.patch index 14a8f42..7fc05dc 100644 --- a/0043-Allow-GRUB-to-mount-ext2-3-4-filesystems-that-have-t.patch +++ b/0043-Allow-GRUB-to-mount-ext2-3-4-filesystems-that-have-t.patch @@ -1,7 +1,7 @@ From 734668238fcc0ef691a080839e04f33854fa133a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 29 Jun 2017 13:27:49 +0000 -Subject: [PATCH 043/198] Allow GRUB to mount ext2/3/4 filesystems that have +Subject: [PATCH 043/206] Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. On such a filesystem, inodes may have EXT4_ENCRYPT_FLAG set. @@ -30,7 +30,7 @@ Signed-off-by: Eric Biggers 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c -index cdce63bcc..b8ad75a0f 100644 +index cdce63bcc9d..b8ad75a0ff7 100644 --- a/grub-core/fs/ext2.c +++ b/grub-core/fs/ext2.c @@ -102,6 +102,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -99,7 +99,7 @@ index cdce63bcc..b8ad75a0f 100644 grub_free (fdiro); diff --git a/tests/ext234_test.in b/tests/ext234_test.in -index 892b99cbd..4f1eb527e 100644 +index 892b99cbdf6..4f1eb527eb2 100644 --- a/tests/ext234_test.in +++ b/tests/ext234_test.in @@ -30,3 +30,4 @@ fi @@ -108,7 +108,7 @@ index 892b99cbd..4f1eb527e 100644 "@builddir@/grub-fs-tester" ext4_metabg +"@builddir@/grub-fs-tester" ext4_encrypt diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in -index 88cbe7365..fd7e0f14b 100644 +index 88cbe7365e9..fd7e0f14b68 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -156,6 +156,12 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do @@ -136,5 +136,5 @@ index 88cbe7365..fd7e0f14b 100644 MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.$fs" -b $BLKSIZE -L "$FSLABEL" -q "${MOUNTDEVICE}" ;; xxfs) -- -2.14.3 +2.15.0 diff --git a/0044-ehci-Fix-compilation-for-amd64.patch b/0044-ehci-Fix-compilation-for-amd64.patch index 987f9d5..79dcd29 100644 --- a/0044-ehci-Fix-compilation-for-amd64.patch +++ b/0044-ehci-Fix-compilation-for-amd64.patch @@ -1,14 +1,14 @@ From edb37fb30bbc8a3b6bec67911c7200e4eb071127 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 9 Jul 2017 20:58:31 +0200 -Subject: [PATCH 044/198] ehci: Fix compilation for amd64 +Subject: [PATCH 044/206] ehci: Fix compilation for amd64 --- grub-core/bus/usb/ehci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c -index c772e7654..7b7061f53 100644 +index c772e76546e..7b7061f5335 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -504,8 +504,8 @@ grub_ehci_init_device (volatile void *regs) @@ -34,5 +34,5 @@ index c772e7654..7b7061f53 100644 grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n", -- -2.14.3 +2.15.0 diff --git a/0045-cache-Fix-compilation-for-ppc-sparc-and-arm64.patch b/0045-cache-Fix-compilation-for-ppc-sparc-and-arm64.patch index f8debbd..255bfc9 100644 --- a/0045-cache-Fix-compilation-for-ppc-sparc-and-arm64.patch +++ b/0045-cache-Fix-compilation-for-ppc-sparc-and-arm64.patch @@ -1,14 +1,14 @@ From d8901e3ba115d705c9c08ecedd201aca8b4867b8 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 9 Jul 2017 20:59:15 +0200 -Subject: [PATCH 045/198] cache: Fix compilation for ppc, sparc and arm64 +Subject: [PATCH 045/206] cache: Fix compilation for ppc, sparc and arm64 --- include/grub/cache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/grub/cache.h b/include/grub/cache.h -index 1c98ce270..ccfa717e6 100644 +index 1c98ce270b6..ccfa717e669 100644 --- a/include/grub/cache.h +++ b/include/grub/cache.h @@ -34,7 +34,9 @@ void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); @@ -23,5 +23,5 @@ index 1c98ce270..ccfa717e6 100644 grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) -- -2.14.3 +2.15.0 diff --git a/0046-ehci-Fix-compilation-on-i386.patch b/0046-ehci-Fix-compilation-on-i386.patch index 4cf29d2..e874463 100644 --- a/0046-ehci-Fix-compilation-on-i386.patch +++ b/0046-ehci-Fix-compilation-on-i386.patch @@ -1,14 +1,14 @@ From 284afab081ef7ed7db2c59151853aa3c92d988f2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 9 Jul 2017 21:31:19 +0200 -Subject: [PATCH 046/198] ehci: Fix compilation on i386 +Subject: [PATCH 046/206] ehci: Fix compilation on i386 --- grub-core/bus/usb/ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c -index 7b7061f53..d966fc210 100644 +index 7b7061f5335..d966fc21002 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -505,7 +505,7 @@ grub_ehci_init_device (volatile void *regs) @@ -30,5 +30,5 @@ index 7b7061f53..d966fc210 100644 grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n", -- -2.14.3 +2.15.0 diff --git a/0047-crypto-Fix-use-after-free.patch b/0047-crypto-Fix-use-after-free.patch index a03d3df..1f75e30 100644 --- a/0047-crypto-Fix-use-after-free.patch +++ b/0047-crypto-Fix-use-after-free.patch @@ -1,7 +1,7 @@ From a0fe0c26aa8a1c0ad66d9527611bd726b849c623 Mon Sep 17 00:00:00 2001 From: AppChecker Date: Sun, 9 Jul 2017 21:57:35 +0200 -Subject: [PATCH 047/198] crypto: Fix use after free. +Subject: [PATCH 047/206] crypto: Fix use after free. Reported by: AppChecker Transformed to patch by: Satish Govindarajan @@ -10,7 +10,7 @@ Transformed to patch by: Satish Govindarajan 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/crypto.c b/grub-core/normal/crypto.c -index 2bfd67c8e..e6d345f33 100644 +index 2bfd67c8ef3..e6d345f3345 100644 --- a/grub-core/normal/crypto.c +++ b/grub-core/normal/crypto.c @@ -147,8 +147,8 @@ read_crypto_list (const char *prefix) @@ -24,5 +24,5 @@ index 2bfd67c8e..e6d345f33 100644 } cur->next = crypto_specs; -- -2.14.3 +2.15.0 diff --git a/0048-arm-efi-Fix-compilation.patch b/0048-arm-efi-Fix-compilation.patch index 6d0725f..293fae2 100644 --- a/0048-arm-efi-Fix-compilation.patch +++ b/0048-arm-efi-Fix-compilation.patch @@ -1,14 +1,14 @@ From cb8b7e4e36bf32dccbbba8252aa44ad3ada4fbc1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 9 Jul 2017 21:48:37 +0000 -Subject: [PATCH 048/198] arm-efi: Fix compilation +Subject: [PATCH 048/206] arm-efi: Fix compilation --- grub-core/loader/arm/linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c -index 260cbf068..e64c79a95 100644 +index 260cbf06861..e64c79a9577 100644 --- a/grub-core/loader/arm/linux.c +++ b/grub-core/loader/arm/linux.c @@ -252,12 +252,12 @@ linux_boot (void) @@ -37,5 +37,5 @@ index 260cbf068..e64c79a95 100644 } -- -2.14.3 +2.15.0 diff --git a/0049-fdt-silence-clang-warning.patch b/0049-fdt-silence-clang-warning.patch index dddfc1c..b14fa02 100644 --- a/0049-fdt-silence-clang-warning.patch +++ b/0049-fdt-silence-clang-warning.patch @@ -1,14 +1,14 @@ From 68d54b55f49249c5e0517bf189f0f3df7ee6a36f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 10 Jul 2017 01:34:22 +0000 -Subject: [PATCH 049/198] fdt: silence clang warning. +Subject: [PATCH 049/206] fdt: silence clang warning. --- grub-core/lib/fdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c -index bdc630244..2705f2629 100644 +index bdc6302448d..2705f2629b9 100644 --- a/grub-core/lib/fdt.c +++ b/grub-core/lib/fdt.c @@ -309,7 +309,8 @@ advance_token (const void *fdt, const grub_uint32_t *token, const grub_uint32_t @@ -22,5 +22,5 @@ index bdc630244..2705f2629 100644 return 0; return token; -- -2.14.3 +2.15.0 diff --git a/0050-Fix-a-segfault-in-lsefi.patch b/0050-Fix-a-segfault-in-lsefi.patch index 5b5a747..61bf11a 100644 --- a/0050-Fix-a-segfault-in-lsefi.patch +++ b/0050-Fix-a-segfault-in-lsefi.patch @@ -1,7 +1,7 @@ From e8ab5a1a9e2889eb59d1fa494ba441a53698dcd2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 19 Jul 2017 15:47:41 -0400 -Subject: [PATCH 050/198] Fix a segfault in lsefi +Subject: [PATCH 050/206] Fix a segfault in lsefi when protocols_per_handle returns error, we can't use the pointers we passed to it, and that includes trusting num_protocols. @@ -13,7 +13,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c -index d901c3892..d1ce99af4 100644 +index d901c389263..d1ce99af438 100644 --- a/grub-core/commands/efi/lsefi.c +++ b/grub-core/commands/efi/lsefi.c @@ -109,8 +109,10 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)), @@ -29,5 +29,5 @@ index d901c3892..d1ce99af4 100644 { for (k = 0; k < ARRAY_SIZE (known_protocols); k++) -- -2.14.3 +2.15.0 diff --git a/0051-zfs-remove-size_t-typedef-and-use-grub_size_t-instea.patch b/0051-zfs-remove-size_t-typedef-and-use-grub_size_t-instea.patch index a438681..674da49 100644 --- a/0051-zfs-remove-size_t-typedef-and-use-grub_size_t-instea.patch +++ b/0051-zfs-remove-size_t-typedef-and-use-grub_size_t-instea.patch @@ -1,7 +1,7 @@ From fa42786264cef98c56e972b3bb6b8448000e1c70 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 3 Aug 2017 15:46:15 +0100 -Subject: [PATCH 051/198] zfs: remove size_t typedef and use grub_size_t +Subject: [PATCH 051/206] zfs: remove size_t typedef and use grub_size_t instead * Prevents some toolchains from issuing a warning on size_t redef. @@ -10,7 +10,7 @@ Subject: [PATCH 051/198] zfs: remove size_t typedef and use grub_size_t 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c -index 2f73449f0..5453822d0 100644 +index 2f73449f0d4..5453822d025 100644 --- a/grub-core/fs/zfs/zfs_lz4.c +++ b/grub-core/fs/zfs/zfs_lz4.c @@ -73,7 +73,6 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, @@ -55,5 +55,5 @@ index 2f73449f0..5453822d0 100644 const int dec2 = 0; #endif -- -2.14.3 +2.15.0 diff --git a/0052-udf-Fix-reading-label-lvd.ident-is-dstring.patch b/0052-udf-Fix-reading-label-lvd.ident-is-dstring.patch index f91d400..48a6051 100644 --- a/0052-udf-Fix-reading-label-lvd.ident-is-dstring.patch +++ b/0052-udf-Fix-reading-label-lvd.ident-is-dstring.patch @@ -1,7 +1,7 @@ From 76188809d5ca40c5285b0ab202b5edea7be3f04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Thu, 22 Jun 2017 14:33:17 +0200 -Subject: [PATCH 052/198] udf: Fix reading label, lvd.ident is dstring +Subject: [PATCH 052/206] udf: Fix reading label, lvd.ident is dstring UDF dstring has stored length in the last byte of buffer. Therefore last byte is not part of recorded characters. And empty string in dstring is @@ -11,7 +11,7 @@ encoded as empty buffer, including first byte (compression id). 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/udf.c b/grub-core/fs/udf.c -index 839bff889..258745633 100644 +index 839bff88963..2587456336e 100644 --- a/grub-core/fs/udf.c +++ b/grub-core/fs/udf.c @@ -860,6 +860,25 @@ read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf) @@ -50,5 +50,5 @@ index 839bff889..258745633 100644 } else -- -2.14.3 +2.15.0 diff --git a/0053-grub-core-fs-udf.c-Add-support-for-UUID.patch b/0053-grub-core-fs-udf.c-Add-support-for-UUID.patch index 9b184a7..cc843bc 100644 --- a/0053-grub-core-fs-udf.c-Add-support-for-UUID.patch +++ b/0053-grub-core-fs-udf.c-Add-support-for-UUID.patch @@ -1,7 +1,7 @@ From 435fa75e01ef40917239c7f775e505e86f70d202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Thu, 22 Jun 2017 14:42:16 +0200 -Subject: [PATCH 053/198] * grub-core/fs/udf.c: Add support for UUID +Subject: [PATCH 053/206] * grub-core/fs/udf.c: Add support for UUID Use same algorithm as in libblkid from util-linux v2.30. @@ -27,7 +27,7 @@ format.exe set only first 8 as hexadecimal and remaining as fixed 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/udf.c b/grub-core/fs/udf.c -index 258745633..00a16098b 100644 +index 2587456336e..00a16098b47 100644 --- a/grub-core/fs/udf.c +++ b/grub-core/fs/udf.c @@ -321,6 +321,32 @@ struct grub_udf_partmap @@ -187,5 +187,5 @@ index 258745633..00a16098b 100644 .reserved_first_sector = 1, .blocklist_install = 1, -- -2.14.3 +2.15.0 diff --git a/0054-mkrescue-Check-xorriso-presence-before-doing-anythin.patch b/0054-mkrescue-Check-xorriso-presence-before-doing-anythin.patch index 8da198c..27b0181 100644 --- a/0054-mkrescue-Check-xorriso-presence-before-doing-anythin.patch +++ b/0054-mkrescue-Check-xorriso-presence-before-doing-anythin.patch @@ -1,7 +1,7 @@ From 9e962fd3c42081e2eef1f99a0eaab38fd04d2620 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 7 Aug 2017 18:05:17 +0200 -Subject: [PATCH 054/198] mkrescue: Check xorriso presence before doing +Subject: [PATCH 054/206] mkrescue: Check xorriso presence before doing anything else. mkrescue can't do anything useful without xorriso, so abort early if it's @@ -11,7 +11,7 @@ not available. 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c -index 238d4840e..38f154397 100644 +index 238d4840e2f..38f1543974e 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -323,6 +323,7 @@ check_xorriso (const char *val) @@ -46,5 +46,5 @@ index 238d4840e..38f154397 100644 grub_hostfs_init (); grub_host_init (); -- -2.14.3 +2.15.0 diff --git a/0055-Fail-if-xorriso-failed.patch b/0055-Fail-if-xorriso-failed.patch index e01cb13..dc9ef57 100644 --- a/0055-Fail-if-xorriso-failed.patch +++ b/0055-Fail-if-xorriso-failed.patch @@ -1,7 +1,7 @@ From e66dc5d71ebfc9763420a76c274e6980d54641c3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 7 Aug 2017 18:08:39 +0200 -Subject: [PATCH 055/198] Fail if xorriso failed. +Subject: [PATCH 055/206] Fail if xorriso failed. If xorriso failed most likely we didn't generate a meaningful image. --- @@ -9,7 +9,7 @@ If xorriso failed most likely we didn't generate a meaningful image. 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c -index 38f154397..9545945d8 100644 +index 38f1543974e..9545945d8f3 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -429,6 +429,7 @@ main (int argc, char *argv[]) @@ -40,5 +40,5 @@ index 38f154397..9545945d8 100644 grub_util_unlink_recursive (iso9660_dir); -- -2.14.3 +2.15.0 diff --git a/0056-efi-refactor-grub_efi_allocate_pages.patch b/0056-efi-refactor-grub_efi_allocate_pages.patch index b0480d8..6323600 100644 --- a/0056-efi-refactor-grub_efi_allocate_pages.patch +++ b/0056-efi-refactor-grub_efi_allocate_pages.patch @@ -1,7 +1,7 @@ From dd5fde2df83c5c03b7ba04d2cc5b7be96de8da7b Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 3 Aug 2017 11:04:23 +0100 -Subject: [PATCH 056/198] efi: refactor grub_efi_allocate_pages +Subject: [PATCH 056/206] efi: refactor grub_efi_allocate_pages Expose a new function, grub_efi_allocate_pages_real(), making it possible to specify allocation type and memory type as supported by the UEFI @@ -20,7 +20,7 @@ Signed-off-by: Leif Lindholm 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index 20a47aaf5..d88bc5e43 100644 +index 20a47aaf5d0..d88bc5e4326 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -51,36 +51,20 @@ int grub_efi_is_finished = 0; @@ -100,7 +100,7 @@ index 20a47aaf5..d88bc5e43 100644 void grub_efi_free_pages (grub_efi_physical_address_t address, diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index e9c601f34..b4cbebf38 100644 +index e9c601f3410..b4cbebf3828 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -38,6 +38,11 @@ void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle, @@ -116,5 +116,5 @@ index e9c601f34..b4cbebf38 100644 grub_efi_uintn_t pages); void EXPORT_FUNC(grub_efi_free_pages) (grub_efi_physical_address_t address, -- -2.14.3 +2.15.0 diff --git a/0057-Remove-grub_efi_allocate_pages.patch b/0057-Remove-grub_efi_allocate_pages.patch index c4f87c2..d94124c 100644 --- a/0057-Remove-grub_efi_allocate_pages.patch +++ b/0057-Remove-grub_efi_allocate_pages.patch @@ -1,7 +1,7 @@ From 4bc909bf89f5b4ff86c9e4e609d4fe0c11a66b0c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 7 Aug 2017 18:33:29 +0200 -Subject: [PATCH 057/198] Remove grub_efi_allocate_pages. +Subject: [PATCH 057/206] Remove grub_efi_allocate_pages. grub_efi_allocate_pages Essentially does 2 unrelated things: * Allocate at fixed address. @@ -21,7 +21,7 @@ value which is wrong as 0 is a perfectly valid fixed adress to allocate at. 8 files changed, 32 insertions(+), 34 deletions(-) diff --git a/grub-core/kern/arm/efi/misc.c b/grub-core/kern/arm/efi/misc.c -index 7cd41842a..c95e8299d 100644 +index 7cd41842ae7..c95e8299d42 100644 --- a/grub-core/kern/arm/efi/misc.c +++ b/grub-core/kern/arm/efi/misc.c @@ -146,7 +146,7 @@ grub_efi_allocate_loader_memory (grub_uint32_t min_offset, grub_uint32_t size) @@ -43,7 +43,7 @@ index 7cd41842a..c95e8299d 100644 return GRUB_ERR_OUT_OF_MEMORY; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index d88bc5e43..b97b05fe8 100644 +index d88bc5e4326..b97b05fe825 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -83,20 +83,19 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address, @@ -51,8 +51,16 @@ index d88bc5e43..b97b05fe8 100644 void * -grub_efi_allocate_pages (grub_efi_physical_address_t address, -- grub_efi_uintn_t pages) +grub_efi_allocate_any_pages (grub_efi_uintn_t pages) ++{ ++ return grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS, ++ pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, ++ GRUB_EFI_LOADER_DATA); ++} ++ ++void * ++grub_efi_allocate_fixed (grub_efi_physical_address_t address, + grub_efi_uintn_t pages) { - grub_efi_allocate_type_t alloctype; - @@ -63,16 +71,8 @@ index d88bc5e43..b97b05fe8 100644 - } - else - alloctype = GRUB_EFI_ALLOCATE_ADDRESS; -+ return grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS, -+ pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, -+ GRUB_EFI_LOADER_DATA); -+} - +- - return grub_efi_allocate_pages_real (address, pages, alloctype, -+void * -+grub_efi_allocate_fixed (grub_efi_physical_address_t address, -+ grub_efi_uintn_t pages) -+{ + return grub_efi_allocate_pages_real (address, pages, + GRUB_EFI_ALLOCATE_ADDRESS, GRUB_EFI_LOADER_DATA); @@ -107,7 +107,7 @@ index d88bc5e43..b97b05fe8 100644 grub_fatal ("cannot allocate memory"); diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/arm64/fdt.c -index db49cf649..368001696 100644 +index db49cf64991..368001696ee 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/arm64/fdt.c @@ -50,7 +50,7 @@ grub_fdt_load (grub_size_t additional_size) @@ -120,7 +120,7 @@ index db49cf649..368001696 100644 return NULL; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 9519d2e4d..ee3fcaa86 100644 +index 9519d2e4d3e..ee3fcaa86ae 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -148,8 +148,7 @@ grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) @@ -152,7 +152,7 @@ index 9519d2e4d..ee3fcaa86 100644 (long long) GRUB_EFI_BYTES_TO_PAGES (kernel_size)); if (!kernel_addr) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c -index 27ede46ca..6c145a771 100644 +index 27ede46cac5..6c145a771ee 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -324,10 +324,9 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, @@ -170,7 +170,7 @@ index 27ede46ca..6c145a771 100644 { grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c -index efaa42ccd..750330d45 100644 +index efaa42ccdd2..750330d4572 100644 --- a/grub-core/loader/ia64/efi/linux.c +++ b/grub-core/loader/ia64/efi/linux.c @@ -252,7 +252,7 @@ allocate_pages (grub_uint64_t align, grub_uint64_t size_pages, @@ -219,7 +219,7 @@ index efaa42ccd..750330d45 100644 { grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate pages"); diff --git a/include/grub/autoefi.h b/include/grub/autoefi.h -index b75591176..b7a252e07 100644 +index b75591176eb..b7a252e079e 100644 --- a/include/grub/autoefi.h +++ b/include/grub/autoefi.h @@ -55,7 +55,7 @@ static inline grub_err_t grub_autoefi_prepare (void) @@ -232,7 +232,7 @@ index b75591176..b7a252e07 100644 # define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services # define EFI_PRESENT 1 diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index b4cbebf38..3fa082816 100644 +index b4cbebf3828..3fa082816ca 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -43,8 +43,10 @@ EXPORT_FUNC(grub_efi_allocate_pages_real) (grub_efi_physical_address_t address, @@ -248,5 +248,5 @@ index b4cbebf38..3fa082816 100644 grub_efi_uintn_t pages); int -- -2.14.3 +2.15.0 diff --git a/0058-efi-move-fdt-helper-library.patch b/0058-efi-move-fdt-helper-library.patch index 48f7ffb..5493338 100644 --- a/0058-efi-move-fdt-helper-library.patch +++ b/0058-efi-move-fdt-helper-library.patch @@ -1,7 +1,7 @@ From 8c9465fac901caac6802d6872a1374518b001517 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 3 Aug 2017 11:04:24 +0100 -Subject: [PATCH 058/198] efi: move fdt helper library +Subject: [PATCH 058/206] efi: move fdt helper library There is nothing ARM64 (or even ARM) specific about the efi fdt helper library, which is used for locating or overriding a firmware-provided @@ -22,7 +22,7 @@ Signed-off-by: Leif Lindholm rename include/grub/{arm64 => efi}/fdtload.h (100%) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 1d86bd22e..a65c27f7f 100644 +index 1d86bd22e04..a65c27f7ff2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1707,7 +1707,7 @@ module = { @@ -35,7 +35,7 @@ index 1d86bd22e..a65c27f7f 100644 enable = fdt; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index ee3fcaa86..3e2f9b742 100644 +index ee3fcaa86ae..3e2f9b74296 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -26,8 +26,8 @@ @@ -49,7 +49,7 @@ index ee3fcaa86..3e2f9b742 100644 #include #include diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c -index 6c145a771..c95d6c5a8 100644 +index 6c145a771ee..c95d6c5a868 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -27,9 +27,9 @@ @@ -67,7 +67,7 @@ diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/efi/fdt.c similarity index 99% rename from grub-core/loader/arm64/fdt.c rename to grub-core/loader/efi/fdt.c -index 368001696..091e9ddf4 100644 +index 368001696ee..091e9ddf43d 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -18,12 +18,12 @@ @@ -89,5 +89,5 @@ similarity index 100% rename from include/grub/arm64/fdtload.h rename to include/grub/efi/fdtload.h -- -2.14.3 +2.15.0 diff --git a/0059-efi-Add-GRUB_PE32_MAGIC-definition.patch b/0059-efi-Add-GRUB_PE32_MAGIC-definition.patch index 5c119c2..bd04a4c 100644 --- a/0059-efi-Add-GRUB_PE32_MAGIC-definition.patch +++ b/0059-efi-Add-GRUB_PE32_MAGIC-definition.patch @@ -1,7 +1,7 @@ From c5841ba7f0d14c193f20854e7e55b4f7ce9207d5 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 3 Aug 2017 11:04:25 +0100 -Subject: [PATCH 059/198] efi: Add GRUB_PE32_MAGIC definition +Subject: [PATCH 059/206] efi: Add GRUB_PE32_MAGIC definition Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete the existing one in arm64/linux.h. @@ -16,7 +16,7 @@ Signed-off-by: Leif Lindholm 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 3e2f9b742..a652ee908 100644 +index 3e2f9b74296..a652ee9088e 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -52,7 +52,7 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) @@ -29,7 +29,7 @@ index 3e2f9b742..a652ee908 100644 N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index 1ea23696e..a981df5d1 100644 +index 1ea23696e7a..a981df5d15f 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -23,8 +23,6 @@ @@ -42,7 +42,7 @@ index 1ea23696e..a981df5d1 100644 struct grub_arm64_linux_kernel_header { diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index f79c36c02..7d44732d2 100644 +index f79c36c026e..7d44732d2c3 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -45,6 +45,8 @@ @@ -55,5 +55,5 @@ index f79c36c02..7d44732d2 100644 But some examples (such as EFI drivers in the Intel Sample Implementation) use 32 bytes (0x20) instead, and it seems -- -2.14.3 +2.15.0 diff --git a/0060-arm64-linux-loader-improve-type-portability.patch b/0060-arm64-linux-loader-improve-type-portability.patch index 15055d7..967aa60 100644 --- a/0060-arm64-linux-loader-improve-type-portability.patch +++ b/0060-arm64-linux-loader-improve-type-portability.patch @@ -1,7 +1,7 @@ From 91212e0aa07e704a61e4540c18a27f149f5e51c3 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 3 Aug 2017 11:04:26 +0100 -Subject: [PATCH 060/198] arm64 linux loader: improve type portability +Subject: [PATCH 060/206] arm64 linux loader: improve type portability In preparation for turning this into a common loader for 32-bit and 64-bit platforms, ensure the code will compile cleanly for either. @@ -13,7 +13,7 @@ Signed-off-by: Leif Lindholm 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index a652ee908..746edd104 100644 +index a652ee9088e..746edd10415 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -57,8 +57,6 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) @@ -74,7 +74,7 @@ index a652ee908..746edd104 100644 return grub_errno; diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c -index 091e9ddf4..17212c38d 100644 +index 091e9ddf43d..17212c38d0b 100644 --- a/grub-core/loader/efi/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -32,12 +32,12 @@ void * @@ -111,5 +111,5 @@ index 091e9ddf4..17212c38d 100644 fdt = NULL; } -- -2.14.3 +2.15.0 diff --git a/0061-efi-change-heap-allocation-type-to-GRUB_EFI_LOADER_C.patch b/0061-efi-change-heap-allocation-type-to-GRUB_EFI_LOADER_C.patch index c57853c..285e860 100644 --- a/0061-efi-change-heap-allocation-type-to-GRUB_EFI_LOADER_C.patch +++ b/0061-efi-change-heap-allocation-type-to-GRUB_EFI_LOADER_C.patch @@ -1,7 +1,7 @@ From f826330683675f0deb55b58fd229afd7d65fb053 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 3 Aug 2017 11:04:32 +0100 -Subject: [PATCH 061/198] efi: change heap allocation type to +Subject: [PATCH 061/206] efi: change heap allocation type to GRUB_EFI_LOADER_CODE With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may @@ -17,7 +17,7 @@ Signed-off-by: Leif Lindholm 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index b97b05fe8..ac2a4c556 100644 +index b97b05fe825..ac2a4c556b8 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -403,7 +403,9 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, @@ -32,5 +32,5 @@ index b97b05fe8..ac2a4c556 100644 grub_fatal ("cannot allocate conventional memory %p with %u pages", (void *) ((grub_addr_t) start), -- -2.14.3 +2.15.0 diff --git a/0062-core-use-GRUB_TERM_-definitions-when-handling-term-c.patch b/0062-core-use-GRUB_TERM_-definitions-when-handling-term-c.patch index aa04fed..e446af4 100644 --- a/0062-core-use-GRUB_TERM_-definitions-when-handling-term-c.patch +++ b/0062-core-use-GRUB_TERM_-definitions-when-handling-term-c.patch @@ -1,7 +1,7 @@ From bdd89d239cd9b4089630bfb5ec862aab8086dca2 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 7 Aug 2017 16:20:30 +0100 -Subject: [PATCH 062/198] core: use GRUB_TERM_ definitions when handling term +Subject: [PATCH 062/206] core: use GRUB_TERM_ definitions when handling term characters * Also use hex value for GRUB_TERM_ESC as '\e' is not in the C standard and is not understood by some compilers @@ -22,7 +22,7 @@ Subject: [PATCH 062/198] core: use GRUB_TERM_ definitions when handling term 13 files changed, 25 insertions(+), 24 deletions(-) diff --git a/grub-core/commands/keylayouts.c b/grub-core/commands/keylayouts.c -index f4b773020..f35d3a369 100644 +index f4b7730208a..f35d3a369ba 100644 --- a/grub-core/commands/keylayouts.c +++ b/grub-core/commands/keylayouts.c @@ -40,7 +40,7 @@ static struct grub_keyboard_layout layout_us = { @@ -46,7 +46,7 @@ index f4b773020..f35d3a369 100644 /* According to usage table 0x31 should be mapped to '/' but testing with real keyboard shows that 0x32 is remapped to '/'. diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c -index 58d4dadf6..2c5363da7 100644 +index 58d4dadf6ee..2c5363da7f5 100644 --- a/grub-core/commands/menuentry.c +++ b/grub-core/commands/menuentry.c @@ -52,8 +52,8 @@ static struct @@ -61,7 +61,7 @@ index 58d4dadf6..2c5363da7 100644 {"insert", GRUB_TERM_KEY_INSERT}, {"f1", GRUB_TERM_KEY_F1}, diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c -index 683a8aaa7..ca334d5a4 100644 +index 683a8aaa711..ca334d5a40e 100644 --- a/grub-core/lib/crypto.c +++ b/grub-core/lib/crypto.c @@ -462,7 +462,7 @@ grub_password_get (char buf[], unsigned buf_size) @@ -83,7 +83,7 @@ index 683a8aaa7..ca334d5a4 100644 #endif diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c -index 7338f8245..6be678c0d 100644 +index 7338f8245e3..6be678c0de1 100644 --- a/grub-core/normal/auth.c +++ b/grub-core/normal/auth.c @@ -166,13 +166,13 @@ grub_username_get (char buf[], unsigned buf_size) @@ -112,7 +112,7 @@ index 7338f8245..6be678c0d 100644 grub_err_t diff --git a/grub-core/normal/cmdline.c b/grub-core/normal/cmdline.c -index a36180d75..c037d5050 100644 +index a36180d7530..c037d5050ed 100644 --- a/grub-core/normal/cmdline.c +++ b/grub-core/normal/cmdline.c @@ -626,12 +626,12 @@ grub_cmdline_get (const char *prompt_translated) @@ -131,7 +131,7 @@ index a36180d75..c037d5050 100644 { lpos--; diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index 719e2fb1c..e7a83c2d6 100644 +index 719e2fb1c26..e7a83c2d6e2 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -763,7 +763,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) @@ -144,7 +144,7 @@ index 719e2fb1c..e7a83c2d6 100644 { menu_fini (); diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c -index eeeee5580..cdf3590a3 100644 +index eeeee5580ab..cdf3590a364 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -1403,7 +1403,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) @@ -157,7 +157,7 @@ index eeeee5580..cdf3590a3 100644 return; diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c -index 7d31095b1..02f64ea74 100644 +index 7d31095b1ef..02f64ea7441 100644 --- a/grub-core/term/efi/console.c +++ b/grub-core/term/efi/console.c @@ -104,7 +104,7 @@ const unsigned efi_codes[] = @@ -170,7 +170,7 @@ index 7d31095b1..02f64ea74 100644 static int diff --git a/grub-core/term/i386/pc/console.c b/grub-core/term/i386/pc/console.c -index 28de46b57..f6142a2de 100644 +index 28de46b576a..f6142a2dea8 100644 --- a/grub-core/term/i386/pc/console.c +++ b/grub-core/term/i386/pc/console.c @@ -204,7 +204,7 @@ static int @@ -183,7 +183,7 @@ index 28de46b57..f6142a2de 100644 struct grub_bios_int_registers regs; unsigned i; diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c -index f0d3e3deb..d317efa36 100644 +index f0d3e3debc6..d317efa368d 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -426,12 +426,12 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, @@ -221,7 +221,7 @@ index f0d3e3deb..d317efa36 100644 && grub_get_time_ms () - data->last_key_time < 1000 && (data->last_key & GRUB_TERM_EXTENDED)) diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c -index f1e21439e..baea7688a 100644 +index f1e21439e2b..baea7688a1d 100644 --- a/grub-core/tests/cmdline_cat_test.c +++ b/grub-core/tests/cmdline_cat_test.c @@ -103,7 +103,7 @@ cmdline_cat_test (void) @@ -234,7 +234,7 @@ index f1e21439e..baea7688a 100644 grub_video_checksum ("cmdline_cat"); diff --git a/grub-core/tests/gfxterm_menu.c b/grub-core/tests/gfxterm_menu.c -index 8f63dc27a..12836fb96 100644 +index 8f63dc27a35..12836fb9659 100644 --- a/grub-core/tests/gfxterm_menu.c +++ b/grub-core/tests/gfxterm_menu.c @@ -146,7 +146,7 @@ gfxterm_menu (void) @@ -247,7 +247,7 @@ index 8f63dc27a..12836fb96 100644 grub_video_checksum (tests[j].name); diff --git a/include/grub/term.h b/include/grub/term.h -index 5ffb38f69..8117e2a24 100644 +index 5ffb38f69aa..8117e2a24da 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -55,7 +55,8 @@ @@ -261,5 +261,5 @@ index 5ffb38f69..8117e2a24 100644 #define GRUB_TERM_BACKSPACE '\b' -- -2.14.3 +2.15.0 diff --git a/0063-io-add-a-GRUB_GZ-prefix-to-gzio-specific-defines.patch b/0063-io-add-a-GRUB_GZ-prefix-to-gzio-specific-defines.patch index 0b1f759..fe6c90b 100644 --- a/0063-io-add-a-GRUB_GZ-prefix-to-gzio-specific-defines.patch +++ b/0063-io-add-a-GRUB_GZ-prefix-to-gzio-specific-defines.patch @@ -1,7 +1,7 @@ From 1deebd85ef87cc581e995ce0a51dc0802ac9c367 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 7 Aug 2017 16:23:12 +0100 -Subject: [PATCH 063/198] io: add a GRUB_GZ prefix to gzio specific defines +Subject: [PATCH 063/206] io: add a GRUB_GZ prefix to gzio specific defines * This is done to avoid a conflict with a PACKED define in the EDK2 --- @@ -9,7 +9,7 @@ Subject: [PATCH 063/198] io: add a GRUB_GZ prefix to gzio specific defines 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c -index 0f2ea6bd8..a8e33033b 100644 +index 0f2ea6bd845..a8e33033bf8 100644 --- a/grub-core/io/gzio.c +++ b/grub-core/io/gzio.c @@ -140,24 +140,24 @@ eat_field (grub_file_t file, int len) @@ -81,5 +81,5 @@ index 0f2ea6bd8..a8e33033b 100644 /* TRANSLATORS: It's about given file having some strange format, not complete lack of gzip support. */ -- -2.14.3 +2.15.0 diff --git a/0064-info-in-builddir.patch b/0064-info-in-builddir.patch index aee3f39..720cc3a 100644 --- a/0064-info-in-builddir.patch +++ b/0064-info-in-builddir.patch @@ -1,14 +1,14 @@ From 5cf0df8753c19e83251c7244cafe38869a65060f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 8 Aug 2017 13:08:59 -0400 -Subject: [PATCH 064/198] info-in-builddir +Subject: [PATCH 064/206] info-in-builddir --- docs/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile.am b/docs/Makefile.am -index 93eb39627..e396ba10f 100644 +index 93eb3962765..e396ba10f46 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,4 +1,4 @@ @@ -18,5 +18,5 @@ index 93eb39627..e396ba10f 100644 # AM_MAKEINFOFLAGS = --no-split --no-validate info_TEXINFOS = grub.texi grub-dev.texi -- -2.14.3 +2.15.0 diff --git a/0065-re-write-.gitignore.patch b/0065-re-write-.gitignore.patch index e9192f8..419fc92 100644 --- a/0065-re-write-.gitignore.patch +++ b/0065-re-write-.gitignore.patch @@ -1,7 +1,7 @@ From ff9da35fd789354cc1490b75893e765771808352 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 8 Aug 2017 12:48:04 -0400 -Subject: [PATCH 065/198] re-write .gitignore +Subject: [PATCH 065/206] re-write .gitignore --- .gitignore | 352 ++++++++++++-------------------------- @@ -24,7 +24,7 @@ Subject: [PATCH 065/198] re-write .gitignore create mode 100644 util/bash-completion.d/.gitignore diff --git a/.gitignore b/.gitignore -index eca17bec9..d95fac578 100644 +index eca17bec9b8..d95fac5789c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,249 +1,121 @@ @@ -391,7 +391,7 @@ index eca17bec9..d95fac578 100644 +/stamp-h.in diff --git a/build-aux/.gitignore b/build-aux/.gitignore new file mode 100644 -index 000000000..f2f17aab9 +index 00000000000..f2f17aab9ff --- /dev/null +++ b/build-aux/.gitignore @@ -0,0 +1,9 @@ @@ -406,7 +406,7 @@ index 000000000..f2f17aab9 +/texinfo.tex diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 -index 000000000..91aee84d3 +index 00000000000..91aee84d3e9 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,4 @@ @@ -416,7 +416,7 @@ index 000000000..91aee84d3 +/version*.texi diff --git a/grub-core/.gitignore b/grub-core/.gitignore new file mode 100644 -index 000000000..c738ac6c6 +index 00000000000..c738ac6c649 --- /dev/null +++ b/grub-core/.gitignore @@ -0,0 +1,15 @@ @@ -437,7 +437,7 @@ index 000000000..c738ac6c6 +/trigtables.c diff --git a/grub-core/gnulib/.gitignore b/grub-core/gnulib/.gitignore new file mode 100644 -index 000000000..29e199c2d +index 00000000000..29e199c2db4 --- /dev/null +++ b/grub-core/gnulib/.gitignore @@ -0,0 +1,22 @@ @@ -465,14 +465,14 @@ index 000000000..29e199c2d +/wctype.h diff --git a/grub-core/lib/.gitignore b/grub-core/lib/.gitignore new file mode 100644 -index 000000000..681545914 +index 00000000000..68154591404 --- /dev/null +++ b/grub-core/lib/.gitignore @@ -0,0 +1 @@ +/libgcrypt-grub/ diff --git a/include/grub/gcrypt/.gitignore b/include/grub/gcrypt/.gitignore new file mode 100644 -index 000000000..8fbf56462 +index 00000000000..8fbf5646246 --- /dev/null +++ b/include/grub/gcrypt/.gitignore @@ -0,0 +1,2 @@ @@ -480,7 +480,7 @@ index 000000000..8fbf56462 +gcrypt.h diff --git a/po/.gitignore b/po/.gitignore new file mode 100644 -index 000000000..97b679c31 +index 00000000000..97b679c3138 --- /dev/null +++ b/po/.gitignore @@ -0,0 +1,4 @@ @@ -490,11 +490,11 @@ index 000000000..97b679c31 +/stamp-po diff --git a/util/bash-completion.d/.gitignore b/util/bash-completion.d/.gitignore new file mode 100644 -index 000000000..b7e1eb124 +index 00000000000..b7e1eb12428 --- /dev/null +++ b/util/bash-completion.d/.gitignore @@ -0,0 +1 @@ +grub -- -2.14.3 +2.15.0 diff --git a/0066-IBM-client-architecture-CAS-reboot-support.patch b/0066-IBM-client-architecture-CAS-reboot-support.patch index 4ca3e07..56a631b 100644 --- a/0066-IBM-client-architecture-CAS-reboot-support.patch +++ b/0066-IBM-client-architecture-CAS-reboot-support.patch @@ -1,7 +1,7 @@ From 34423216f8f3d7ce6086e2f1ee9869407e6a2221 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Thu, 20 Sep 2012 18:07:39 -0300 -Subject: [PATCH 066/198] IBM client architecture (CAS) reboot support +Subject: [PATCH 066/206] IBM client architecture (CAS) reboot support This is an implementation of IBM client architecture (CAS) reboot for GRUB. @@ -25,7 +25,7 @@ parameters 4 files changed, 90 insertions(+) diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index ddb778340..6db8b9865 100644 +index ddb778340e4..6db8b986551 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c @@ -561,3 +561,65 @@ grub_ieee1275_canonicalise_devname (const char *path) @@ -95,7 +95,7 @@ index ddb778340..6db8b9865 100644 + return 0; +} diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 78a70a8bf..249e19bc7 100644 +index 78a70a8bf47..249e19bc788 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,9 @@ @@ -132,7 +132,7 @@ index 78a70a8bf..249e19bc7 100644 grub_errno = GRUB_ERR_NONE; } diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index a8502d907..ab78ca87f 100644 +index a8502d90711..ab78ca87f90 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -27,6 +27,9 @@ @@ -157,7 +157,7 @@ index a8502d907..ab78ca87f 100644 { char *line; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 8e4251303..9f26c69a2 100644 +index 8e425130327..9f26c69a2df 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -234,6 +234,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali @@ -170,5 +170,5 @@ index 8e4251303..9f26c69a2 100644 #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) -- -2.14.3 +2.15.0 diff --git a/0067-for-ppc-reset-console-display-attr-when-clear-screen.patch b/0067-for-ppc-reset-console-display-attr-when-clear-screen.patch index 200f5b0..5e26ad5 100644 --- a/0067-for-ppc-reset-console-display-attr-when-clear-screen.patch +++ b/0067-for-ppc-reset-console-display-attr-when-clear-screen.patch @@ -1,7 +1,7 @@ From 070dc282d3cc6602571296e90945df9d4671aecb Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 24 Apr 2013 10:51:48 -0300 -Subject: [PATCH 067/198] for ppc, reset console display attr when clear screen +Subject: [PATCH 067/206] for ppc, reset console display attr when clear screen v2: Also use \x0c instead of a literal ^L to make future patches less awkward. @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c -index d317efa36..29df35e6d 100644 +index d317efa368d..29df35e6d20 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -151,7 +151,7 @@ grub_terminfo_set_current (struct grub_term_output *term, @@ -28,5 +28,5 @@ index d317efa36..29df35e6d 100644 data->reverse_video_off = grub_strdup ("\e[m"); if (grub_strcmp ("ieee1275", str) == 0) -- -2.14.3 +2.15.0 diff --git a/0068-Disable-GRUB-video-support-for-IBM-power-machines.patch b/0068-Disable-GRUB-video-support-for-IBM-power-machines.patch index 7a17eef..d28e94a 100644 --- a/0068-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/0068-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -1,7 +1,7 @@ From 4e31478fdf4cda470305c1bb2acb9b820e790757 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 11 Jun 2013 15:14:05 -0300 -Subject: [PATCH 068/198] Disable GRUB video support for IBM power machines +Subject: [PATCH 068/206] Disable GRUB video support for IBM power machines Should fix the problem in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=973205 @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=973205 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 3e12e6b24..3e14f5393 100644 +index 3e12e6b24e1..3e14f539368 100644 --- a/grub-core/kern/ieee1275/cmain.c +++ b/grub-core/kern/ieee1275/cmain.c @@ -90,7 +90,10 @@ grub_ieee1275_find_options (void) @@ -28,7 +28,7 @@ index 3e12e6b24..3e14f5393 100644 /* Old Macs have no key repeat, newer ones have fully working one. The ones inbetween when repeated key generates an escaoe sequence diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c -index 17a3dbbb5..b8e4b3feb 100644 +index 17a3dbbb575..b8e4b3feb32 100644 --- a/grub-core/video/ieee1275.c +++ b/grub-core/video/ieee1275.c @@ -352,9 +352,12 @@ static struct grub_video_adapter grub_video_ieee1275_adapter = @@ -48,7 +48,7 @@ index 17a3dbbb5..b8e4b3feb 100644 GRUB_MOD_FINI(ieee1275_fb) diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 9f26c69a2..ab4f284c3 100644 +index 9f26c69a2df..ab4f284c341 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -146,6 +146,8 @@ enum grub_ieee1275_flag @@ -61,5 +61,5 @@ index 9f26c69a2..ab4f284c3 100644 extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); -- -2.14.3 +2.15.0 diff --git a/0069-Honor-a-symlink-when-generating-configuration-by-gru.patch b/0069-Honor-a-symlink-when-generating-configuration-by-gru.patch index eae9b9c..15dd2f6 100644 --- a/0069-Honor-a-symlink-when-generating-configuration-by-gru.patch +++ b/0069-Honor-a-symlink-when-generating-configuration-by-gru.patch @@ -1,7 +1,7 @@ From 35535549324923af7fecf79cc739baba48246f21 Mon Sep 17 00:00:00 2001 From: Marcel Kolaja Date: Tue, 21 Jan 2014 10:57:08 -0500 -Subject: [PATCH 069/198] Honor a symlink when generating configuration by +Subject: [PATCH 069/206] Honor a symlink when generating configuration by grub2-mkconfig Honor a symlink when generating configuration by grub2-mkconfig, so that @@ -11,7 +11,7 @@ the -o option follows it rather than overwriting it with a regular file. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index f8496d28b..3b070fd76 100644 +index f8496d28bdf..3b070fd7632 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -276,7 +276,8 @@ and /etc/grub.d/* files or please file a bug report with @@ -25,5 +25,5 @@ index f8496d28b..3b070fd76 100644 fi -- -2.14.3 +2.15.0 diff --git a/0070-Move-bash-completion-script-922997.patch b/0070-Move-bash-completion-script-922997.patch index f1428fe..ee0e467 100644 --- a/0070-Move-bash-completion-script-922997.patch +++ b/0070-Move-bash-completion-script-922997.patch @@ -1,7 +1,7 @@ From 999bbc2002275efce284aed6e1e31b3ca351fa19 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Apr 2013 14:35:34 -0400 -Subject: [PATCH 070/198] Move bash completion script (#922997) +Subject: [PATCH 070/206] Move bash completion script (#922997) Apparently these go in a new place now. --- @@ -10,7 +10,7 @@ Apparently these go in a new place now. 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 571f7a0b5..9ae97f026 100644 +index 571f7a0b5aa..9ae97f026ab 100644 --- a/configure.ac +++ b/configure.ac @@ -288,6 +288,14 @@ AC_SUBST(grubdirname) @@ -39,7 +39,7 @@ index 571f7a0b5..9ae97f026 100644 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then tmp_ac_tool_prefix="$ac_tool_prefix" diff --git a/util/bash-completion.d/Makefile.am b/util/bash-completion.d/Makefile.am -index 136287cf1..61108f054 100644 +index 136287cf1bf..61108f05429 100644 --- a/util/bash-completion.d/Makefile.am +++ b/util/bash-completion.d/Makefile.am @@ -6,7 +6,6 @@ EXTRA_DIST = $(bash_completion_source) @@ -51,5 +51,5 @@ index 136287cf1..61108f054 100644 $(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status -- -2.14.3 +2.15.0 diff --git a/0071-Update-to-minilzo-2.08.patch b/0071-Update-to-minilzo-2.08.patch index 19e0a5f..ec5d258 100644 --- a/0071-Update-to-minilzo-2.08.patch +++ b/0071-Update-to-minilzo-2.08.patch @@ -1,3367 +1,20 @@ From c0977f7fd42e16cc568af7ae667a2aeda85eb583 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Dec 2014 15:36:09 -0500 -Subject: [PATCH 071/198] Update to minilzo-2.08 +Subject: [PATCH 071/206] Update to minilzo-2.08 This fixes CVE-2014-4607 - lzo: lzo1x_decompress_safe() integer overflow Signed-off-by: Peter Jones --- + grub-core/lib/minilzo/minilzo.c | 3801 +++++++++++++++++++++++++++------------ grub-core/lib/minilzo/lzoconf.h | 216 ++- - grub-core/lib/minilzo/lzodefs.h | 2450 +++++++++++++++++------- - grub-core/lib/minilzo/minilzo.c | 3953 +++++++++++++++++++++++++++------------ + grub-core/lib/minilzo/lzodefs.h | 2320 ++++++++++++++++++------ grub-core/lib/minilzo/minilzo.h | 21 +- - 4 files changed, 4630 insertions(+), 2010 deletions(-) + 4 files changed, 4489 insertions(+), 1869 deletions(-) -diff --git a/grub-core/lib/minilzo/lzoconf.h b/grub-core/lib/minilzo/lzoconf.h -index 1d0fe14fc..61be29c5d 100644 ---- a/grub-core/lib/minilzo/lzoconf.h -+++ b/grub-core/lib/minilzo/lzoconf.h -@@ -2,22 +2,7 @@ - - This file is part of the LZO real-time data compression library. - -- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer -+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or -@@ -44,9 +29,9 @@ - #ifndef __LZOCONF_H_INCLUDED - #define __LZOCONF_H_INCLUDED 1 - --#define LZO_VERSION 0x2050 --#define LZO_VERSION_STRING "2.05" --#define LZO_VERSION_DATE "Apr 23 2011" -+#define LZO_VERSION 0x2080 -+#define LZO_VERSION_STRING "2.08" -+#define LZO_VERSION_DATE "Jun 29 2014" - - /* internal Autoconf configuration file - only used when building LZO */ - #if defined(LZO_HAVE_CONFIG_H) -@@ -63,7 +48,7 @@ - #if !defined(CHAR_BIT) || (CHAR_BIT != 8) - # error "invalid CHAR_BIT" - #endif --#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) -+#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) - # error "check your compiler installation" - #endif - #if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) -@@ -85,14 +70,6 @@ extern "C" { - // some core defines - ************************************************************************/ - --#if !defined(LZO_UINT32_C) --# if (UINT_MAX < LZO_0xffffffffL) --# define LZO_UINT32_C(c) c ## UL --# else --# define LZO_UINT32_C(c) ((c) + 0U) --# endif --#endif -- - /* memory checkers */ - #if !defined(__LZO_CHECKER) - # if defined(__BOUNDS_CHECKING_ON) -@@ -111,28 +88,31 @@ extern "C" { - // integral and pointer types - ************************************************************************/ - --/* lzo_uint should match size_t */ -+/* lzo_uint must match size_t */ - #if !defined(LZO_UINT_MAX) --# if defined(LZO_ABI_LLP64) /* WIN64 */ --# if defined(LZO_OS_WIN64) -+# if (LZO_ABI_LLP64) -+# if (LZO_OS_WIN64) - typedef unsigned __int64 lzo_uint; - typedef __int64 lzo_int; - # else -- typedef unsigned long long lzo_uint; -- typedef long long lzo_int; -+ typedef lzo_ullong_t lzo_uint; -+ typedef lzo_llong_t lzo_int; - # endif -+# define LZO_SIZEOF_LZO_UINT 8 - # define LZO_UINT_MAX 0xffffffffffffffffull - # define LZO_INT_MAX 9223372036854775807LL - # define LZO_INT_MIN (-1LL - LZO_INT_MAX) --# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */ -+# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ - typedef unsigned int lzo_uint; - typedef int lzo_int; -+# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT - # define LZO_UINT_MAX UINT_MAX - # define LZO_INT_MAX INT_MAX - # define LZO_INT_MIN INT_MIN - # elif (ULONG_MAX >= LZO_0xffffffffL) - typedef unsigned long lzo_uint; - typedef long lzo_int; -+# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG - # define LZO_UINT_MAX ULONG_MAX - # define LZO_INT_MAX LONG_MAX - # define LZO_INT_MIN LONG_MIN -@@ -141,63 +121,22 @@ extern "C" { - # endif - #endif - --/* Integral types with 32 bits or more. */ --#if !defined(LZO_UINT32_MAX) --# if (UINT_MAX >= LZO_0xffffffffL) -- typedef unsigned int lzo_uint32; -- typedef int lzo_int32; --# define LZO_UINT32_MAX UINT_MAX --# define LZO_INT32_MAX INT_MAX --# define LZO_INT32_MIN INT_MIN --# elif (ULONG_MAX >= LZO_0xffffffffL) -- typedef unsigned long lzo_uint32; -- typedef long lzo_int32; --# define LZO_UINT32_MAX ULONG_MAX --# define LZO_INT32_MAX LONG_MAX --# define LZO_INT32_MIN LONG_MIN --# else --# error "lzo_uint32" --# endif --#endif -- --/* Integral types with exactly 64 bits. */ --#if !defined(LZO_UINT64_MAX) --# if (LZO_UINT_MAX >= LZO_0xffffffffL) --# if ((((LZO_UINT_MAX) >> 31) >> 31) == 3) --# define lzo_uint64 lzo_uint --# define lzo_int64 lzo_int --# define LZO_UINT64_MAX LZO_UINT_MAX --# define LZO_INT64_MAX LZO_INT_MAX --# define LZO_INT64_MIN LZO_INT_MIN --# endif --# elif (ULONG_MAX >= LZO_0xffffffffL) --# if ((((ULONG_MAX) >> 31) >> 31) == 3) -- typedef unsigned long lzo_uint64; -- typedef long lzo_int64; --# define LZO_UINT64_MAX ULONG_MAX --# define LZO_INT64_MAX LONG_MAX --# define LZO_INT64_MIN LONG_MIN --# endif --# endif --#endif -- --/* The larger type of lzo_uint and lzo_uint32. */ --#if (LZO_UINT_MAX >= LZO_UINT32_MAX) -+/* The larger type of lzo_uint and lzo_uint32_t. */ -+#if (LZO_SIZEOF_LZO_UINT >= 4) - # define lzo_xint lzo_uint - #else --# define lzo_xint lzo_uint32 -+# define lzo_xint lzo_uint32_t - #endif - --/* Memory model that allows to access memory at offsets of lzo_uint. */ --#if !defined(__LZO_MMODEL) --# if (LZO_UINT_MAX <= UINT_MAX) --# define __LZO_MMODEL /*empty*/ --# elif defined(LZO_HAVE_MM_HUGE_PTR) --# define __LZO_MMODEL_HUGE 1 --# define __LZO_MMODEL __huge --# else --# define __LZO_MMODEL /*empty*/ --# endif -+typedef int lzo_bool; -+ -+/* sanity checks */ -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) -+ -+#ifndef __LZO_MMODEL -+#define __LZO_MMODEL /*empty*/ - #endif - - /* no typedef here because of const-pointer issues */ -@@ -206,21 +145,52 @@ extern "C" { - #define lzo_voidp void __LZO_MMODEL * - #define lzo_shortp short __LZO_MMODEL * - #define lzo_ushortp unsigned short __LZO_MMODEL * --#define lzo_uint32p lzo_uint32 __LZO_MMODEL * --#define lzo_int32p lzo_int32 __LZO_MMODEL * --#if defined(LZO_UINT64_MAX) --#define lzo_uint64p lzo_uint64 __LZO_MMODEL * --#define lzo_int64p lzo_int64 __LZO_MMODEL * --#endif --#define lzo_uintp lzo_uint __LZO_MMODEL * - #define lzo_intp lzo_int __LZO_MMODEL * -+#define lzo_uintp lzo_uint __LZO_MMODEL * - #define lzo_xintp lzo_xint __LZO_MMODEL * - #define lzo_voidpp lzo_voidp __LZO_MMODEL * - #define lzo_bytepp lzo_bytep __LZO_MMODEL * --/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ --#define lzo_byte unsigned char __LZO_MMODEL - --typedef int lzo_bool; -+#define lzo_int8_tp lzo_int8_t __LZO_MMODEL * -+#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL * -+#define lzo_int16_tp lzo_int16_t __LZO_MMODEL * -+#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL * -+#define lzo_int32_tp lzo_int32_t __LZO_MMODEL * -+#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL * -+#if defined(lzo_int64_t) -+#define lzo_int64_tp lzo_int64_t __LZO_MMODEL * -+#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL * -+#endif -+ -+/* Older LZO versions used to support ancient systems and memory models -+ * like 16-bit MSDOS with __huge pointers and Cray PVP, but these -+ * obsolete configurations are not supported any longer. -+ */ -+#if defined(__LZO_MMODEL_HUGE) -+#error "__LZO_MMODEL_HUGE is unsupported" -+#endif -+#if (LZO_MM_PVP) -+#error "LZO_MM_PVP is unsupported" -+#endif -+#if (LZO_SIZEOF_INT < 4) -+#error "LZO_SIZEOF_INT < 4 is unsupported" -+#endif -+#if (__LZO_UINTPTR_T_IS_POINTER) -+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4) -+/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should -+ * work but have not received much testing lately, so be strict here. -+ */ -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp)) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) - - - /*********************************************************************** -@@ -315,7 +285,7 @@ struct lzo_callback_t - /* a progress indicator callback function (set to 0 to disable) */ - lzo_progress_func_t nprogress; - -- /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress -+ /* INFO: the first parameter "self" of the nalloc/nfree/nprogress - * callbacks points back to this struct, so you are free to store - * some extra info in the following variables. */ - lzo_voidp user1; -@@ -343,6 +313,9 @@ struct lzo_callback_t - #define LZO_E_INPUT_NOT_CONSUMED (-8) - #define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ - #define LZO_E_INVALID_ARGUMENT (-10) -+#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */ -+#define LZO_E_OUTPUT_NOT_CONSUMED (-12) -+#define LZO_E_INTERNAL_ERROR (-99) - - - #ifndef lzo_sizeof_dict_t -@@ -356,7 +329,7 @@ struct lzo_callback_t - * compiler's view of various types are consistent. - */ - #define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ -- (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\ -+ (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\ - (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ - (int)sizeof(lzo_callback_t)) - LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); -@@ -379,18 +352,22 @@ LZO_EXTERN(lzo_voidp) - lzo_memset(lzo_voidp buf, int c, lzo_uint len); - - /* checksum functions */ --LZO_EXTERN(lzo_uint32) -- lzo_adler32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len); --LZO_EXTERN(lzo_uint32) -- lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len); --LZO_EXTERN(const lzo_uint32p) -+LZO_EXTERN(lzo_uint32_t) -+ lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); -+LZO_EXTERN(lzo_uint32_t) -+ lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); -+LZO_EXTERN(const lzo_uint32_tp) - lzo_get_crc32_table(void); - - /* misc. */ - LZO_EXTERN(int) _lzo_config_check(void); --typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u; --typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u; --typedef union { void *vp; lzo_bytep bp; lzo_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t; -+typedef union { -+ lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04; -+ void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09; -+#if defined(lzo_int64_t) -+ lzo_uint64_t a10; -+#endif -+} lzo_align_t; - - /* align a char pointer on a boundary that is a multiple of 'size' */ - LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); -@@ -399,9 +376,30 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); - - - /*********************************************************************** --// deprecated macros - only for backward compatibility with LZO v1.xx -+// deprecated macros - only for backward compatibility - ************************************************************************/ - -+/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ -+#define lzo_byte unsigned char -+/* deprecated type names */ -+#define lzo_int32 lzo_int32_t -+#define lzo_uint32 lzo_uint32_t -+#define lzo_int32p lzo_int32_t __LZO_MMODEL * -+#define lzo_uint32p lzo_uint32_t __LZO_MMODEL * -+#define LZO_INT32_MAX LZO_INT32_C(2147483647) -+#define LZO_UINT32_MAX LZO_UINT32_C(4294967295) -+#if defined(lzo_int64_t) -+#define lzo_int64 lzo_int64_t -+#define lzo_uint64 lzo_uint64_t -+#define lzo_int64p lzo_int64_t __LZO_MMODEL * -+#define lzo_uint64p lzo_uint64_t __LZO_MMODEL * -+#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807) -+#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615) -+#endif -+/* deprecated types */ -+typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; -+typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; -+ - #if defined(LZO_CFG_COMPAT) - - #define __LZOCONF_H 1 -@@ -443,4 +441,4 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); - #endif /* already included */ - - --/* vim:set ts=4 et: */ -+/* vim:set ts=4 sw=4 et: */ -diff --git a/grub-core/lib/minilzo/lzodefs.h b/grub-core/lib/minilzo/lzodefs.h -index 0e40e332a..f4ae9487e 100644 ---- a/grub-core/lib/minilzo/lzodefs.h -+++ b/grub-core/lib/minilzo/lzodefs.h -@@ -2,22 +2,7 @@ - - This file is part of the LZO real-time data compression library. - -- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer -- Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer -+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or -@@ -47,12 +32,6 @@ - #if defined(__CYGWIN32__) && !defined(__CYGWIN__) - # define __CYGWIN__ __CYGWIN32__ - #endif --#if defined(__IBMCPP__) && !defined(__IBMC__) --# define __IBMC__ __IBMCPP__ --#endif --#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) --# define __INTEL_COMPILER __ICL --#endif - #if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) - # define _ALL_SOURCE 1 - #endif -@@ -61,19 +40,30 @@ - # define __LONG_MAX__ 9223372036854775807L - # endif - #endif --#if defined(__INTEL_COMPILER) && defined(__linux__) -+#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) -+#if defined(__ARMCC_VERSION) -+# pragma diag_suppress 193 -+#elif defined(__clang__) && defined(__clang_minor__) -+# pragma clang diagnostic ignored "-Wundef" -+#elif defined(__INTEL_COMPILER) - # pragma warning(disable: 193) --#endif --#if defined(__KEIL__) && defined(__C166__) --# pragma warning disable = 322 --#elif 0 && defined(__C251__) -+#elif defined(__KEIL__) && defined(__C166__) - # pragma warning disable = 322 --#endif --#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) --# if (_MSC_VER >= 1300) -+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) -+# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) -+# pragma GCC diagnostic ignored "-Wundef" -+# endif -+#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) -+# if ((_MSC_VER-0) >= 1300) - # pragma warning(disable: 4668) - # endif - #endif -+#endif -+#if 0 && defined(__POCC__) && defined(_WIN32) -+# if (__POCC__ >= 400) -+# pragma warn(disable: 2216) -+# endif -+#endif - #if 0 && defined(__WATCOMC__) - # if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) - # pragma warning 203 9 -@@ -82,13 +72,29 @@ - #if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) - # pragma option -h - #endif -+#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) -+#ifndef _CRT_NONSTDC_NO_DEPRECATE -+#define _CRT_NONSTDC_NO_DEPRECATE 1 -+#endif -+#ifndef _CRT_NONSTDC_NO_WARNINGS -+#define _CRT_NONSTDC_NO_WARNINGS 1 -+#endif -+#ifndef _CRT_SECURE_NO_DEPRECATE -+#define _CRT_SECURE_NO_DEPRECATE 1 -+#endif -+#ifndef _CRT_SECURE_NO_WARNINGS -+#define _CRT_SECURE_NO_WARNINGS 1 -+#endif -+#endif - #if 0 --#define LZO_0xffffL 0xfffful --#define LZO_0xffffffffL 0xfffffffful -+#define LZO_0xffffUL 0xfffful -+#define LZO_0xffffffffUL 0xfffffffful - #else --#define LZO_0xffffL 65535ul --#define LZO_0xffffffffL 4294967295ul -+#define LZO_0xffffUL 65535ul -+#define LZO_0xffffffffUL 4294967295ul - #endif -+#define LZO_0xffffL LZO_0xffffUL -+#define LZO_0xffffffffL LZO_0xffffffffUL - #if (LZO_0xffffL == LZO_0xffffffffL) - # error "your preprocessor is broken 1" - #endif -@@ -103,6 +109,13 @@ - # error "your preprocessor is broken 4" - #endif - #endif -+#if defined(__COUNTER__) -+# ifndef LZO_CFG_USE_COUNTER -+# define LZO_CFG_USE_COUNTER 1 -+# endif -+#else -+# undef LZO_CFG_USE_COUNTER -+#endif - #if (UINT_MAX == LZO_0xffffL) - #if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) - # if !defined(MSDOS) -@@ -233,14 +246,31 @@ - #endif - #define LZO_PP_STRINGIZE(x) #x - #define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) -+#define LZO_PP_CONCAT0() /*empty*/ -+#define LZO_PP_CONCAT1(a) a - #define LZO_PP_CONCAT2(a,b) a ## b - #define LZO_PP_CONCAT3(a,b,c) a ## b ## c - #define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d - #define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -+#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -+#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g -+#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() -+#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) - #define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) - #define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) - #define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) - #define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) -+#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) -+#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) -+#define LZO_PP_EMPTY /*empty*/ -+#define LZO_PP_EMPTY0() /*empty*/ -+#define LZO_PP_EMPTY1(a) /*empty*/ -+#define LZO_PP_EMPTY2(a,b) /*empty*/ -+#define LZO_PP_EMPTY3(a,b,c) /*empty*/ -+#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ -+#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ -+#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ -+#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ - #if 1 - #define LZO_CPP_STRINGIZE(x) #x - #define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) -@@ -248,12 +278,16 @@ - #define LZO_CPP_CONCAT3(a,b,c) a ## b ## c - #define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d - #define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -+#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -+#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g - #define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) - #define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) - #define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) - #define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) -+#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) -+#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) - #endif --#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) -+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) - #if 1 && defined(__cplusplus) - # if !defined(__STDC_CONSTANT_MACROS) - # define __STDC_CONSTANT_MACROS 1 -@@ -263,9 +297,13 @@ - # endif - #endif - #if defined(__cplusplus) --# define LZO_EXTERN_C extern "C" -+# define LZO_EXTERN_C extern "C" -+# define LZO_EXTERN_C_BEGIN extern "C" { -+# define LZO_EXTERN_C_END } - #else --# define LZO_EXTERN_C extern -+# define LZO_EXTERN_C extern -+# define LZO_EXTERN_C_BEGIN /*empty*/ -+# define LZO_EXTERN_C_END /*empty*/ - #endif - #if !defined(__LZO_OS_OVERRIDE) - #if (LZO_OS_FREESTANDING) -@@ -366,12 +404,12 @@ - #elif defined(__VMS) - # define LZO_OS_VMS 1 - # define LZO_INFO_OS "vms" --#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -+#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) - # define LZO_OS_CONSOLE 1 - # define LZO_OS_CONSOLE_PS2 1 - # define LZO_INFO_OS "console" - # define LZO_INFO_OS_CONSOLE "ps2" --#elif (defined(__mips__) && defined(__psp__)) -+#elif defined(__mips__) && defined(__psp__) - # define LZO_OS_CONSOLE 1 - # define LZO_OS_CONSOLE_PSP 1 - # define LZO_INFO_OS "console" -@@ -399,9 +437,18 @@ - # elif defined(__linux__) || defined(__linux) || defined(__LINUX__) - # define LZO_OS_POSIX_LINUX 1 - # define LZO_INFO_OS_POSIX "linux" --# elif defined(__APPLE__) || defined(__MACOS__) --# define LZO_OS_POSIX_MACOSX 1 --# define LZO_INFO_OS_POSIX "macosx" -+# elif defined(__APPLE__) && defined(__MACH__) -+# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) -+# define LZO_OS_POSIX_DARWIN 1040 -+# define LZO_INFO_OS_POSIX "darwin_iphone" -+# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) -+# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -+# define LZO_INFO_OS_POSIX "darwin" -+# else -+# define LZO_OS_POSIX_DARWIN 1 -+# define LZO_INFO_OS_POSIX "darwin" -+# endif -+# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN - # elif defined(__minix__) || defined(__minix) - # define LZO_OS_POSIX_MINIX 1 - # define LZO_INFO_OS_POSIX "minix" -@@ -436,18 +483,18 @@ - #endif - #if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) - # if (UINT_MAX != LZO_0xffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - # if (ULONG_MAX != LZO_0xffffffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - #endif - #if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) - # if (UINT_MAX != LZO_0xffffffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - # if (ULONG_MAX != LZO_0xffffffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - #endif - #if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) -@@ -463,59 +510,65 @@ - # define LZO_INFO_CC "sdcc" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) - #elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) --# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) -+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) - # define LZO_INFO_CC "Pathscale C" - # define LZO_INFO_CCVER __PATHSCALE__ --#elif defined(__INTEL_COMPILER) --# define LZO_CC_INTELC 1 -+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -+# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -+# endif -+#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) -+# define LZO_CC_INTELC __INTEL_COMPILER - # define LZO_INFO_CC "Intel C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) --# if defined(_WIN32) || defined(_WIN64) --# define LZO_CC_SYNTAX_MSC 1 --# else --# define LZO_CC_SYNTAX_GNUC 1 -+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -+# define LZO_CC_INTELC_MSC _MSC_VER -+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -+# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) - # endif - #elif defined(__POCC__) && defined(_WIN32) - # define LZO_CC_PELLESC 1 - # define LZO_INFO_CC "Pelles C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) --#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -+#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) - # if defined(__GNUC_PATCHLEVEL__) --# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) -+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) - # else --# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) -+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) - # endif -+# define LZO_CC_ARMCC __ARMCC_VERSION -+# define LZO_INFO_CC "ARM C Compiler" -+# define LZO_INFO_CCVER __VERSION__ -+#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) - # if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) --# define LZO_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__) -+# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) - # else --# define LZO_CC_CLANG_CLANG 0x010000L -+# define LZO_CC_CLANG 0x010000L -+# endif -+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -+# define LZO_CC_CLANG_MSC _MSC_VER -+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -+# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) - # endif --# define LZO_CC_CLANG LZO_CC_CLANG_GNUC - # define LZO_INFO_CC "clang" - # define LZO_INFO_CCVER __VERSION__ - #elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) - # if defined(__GNUC_PATCHLEVEL__) --# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) -+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) - # else --# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) -+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) - # endif - # define LZO_CC_LLVM LZO_CC_LLVM_GNUC - # define LZO_INFO_CC "llvm-gcc" - # define LZO_INFO_CCVER __VERSION__ --#elif defined(__GNUC__) && defined(__VERSION__) --# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) --# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) --# elif defined(__GNUC_MINOR__) --# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) --# else --# define LZO_CC_GNUC (__GNUC__ * 0x10000L) --# endif --# define LZO_INFO_CC "gcc" --# define LZO_INFO_CCVER __VERSION__ - #elif defined(__ACK__) && defined(_ACK) - # define LZO_CC_ACK 1 - # define LZO_INFO_CC "Amsterdam Compiler Kit C" - # define LZO_INFO_CCVER "unknown" -+#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) -+# define LZO_CC_ARMCC __ARMCC_VERSION -+# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION -+# define LZO_INFO_CC "ARM C Compiler" -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) - #elif defined(__AZTEC_C__) - # define LZO_CC_AZTECC 1 - # define LZO_INFO_CC "Aztec C" -@@ -540,10 +593,23 @@ - # define LZO_CC_DECC 1 - # define LZO_INFO_CC "DEC C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) -+#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) -+# define LZO_CC_GHS 1 -+# define LZO_INFO_CC "Green Hills C" -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) -+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -+# define LZO_CC_GHS_MSC _MSC_VER -+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -+# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -+# endif - #elif defined(__HIGHC__) - # define LZO_CC_HIGHC 1 - # define LZO_INFO_CC "MetaWare High C" - # define LZO_INFO_CCVER "unknown" -+#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) -+# define LZO_CC_HPACC __HP_aCC -+# define LZO_INFO_CC "HP aCC" -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) - #elif defined(__IAR_SYSTEMS_ICC__) - # define LZO_CC_IARC 1 - # define LZO_INFO_CC "IAR C" -@@ -552,10 +618,14 @@ - # else - # define LZO_INFO_CCVER "unknown" - # endif --#elif defined(__IBMC__) --# define LZO_CC_IBMC 1 -+#elif defined(__IBMC__) && ((__IBMC__-0) > 0) -+# define LZO_CC_IBMC __IBMC__ - # define LZO_INFO_CC "IBM C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) -+#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) -+# define LZO_CC_IBMC __IBMCPP__ -+# define LZO_INFO_CC "IBM C" -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) - #elif defined(__KEIL__) && defined(__C166__) - # define LZO_CC_KEILC 1 - # define LZO_INFO_CC "Keil C" -@@ -572,16 +642,8 @@ - # else - # define LZO_INFO_CCVER "unknown" - # endif --#elif defined(_MSC_VER) --# define LZO_CC_MSC 1 --# define LZO_INFO_CC "Microsoft C" --# if defined(_MSC_FULL_VER) --# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) --# else --# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) --# endif --#elif defined(__MWERKS__) --# define LZO_CC_MWERKS 1 -+#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) -+# define LZO_CC_MWERKS __MWERKS__ - # define LZO_INFO_CC "Metrowerks C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) - #elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) -@@ -592,6 +654,15 @@ - # define LZO_CC_PACIFICC 1 - # define LZO_INFO_CC "Pacific C" - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) -+#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) -+# if defined(__PGIC_PATCHLEVEL__) -+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) -+# else -+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" -+# endif -+# define LZO_INFO_CC "Portland Group PGI C" - #elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) - # define LZO_CC_PGI 1 - # define LZO_INFO_CC "Portland Group PGI C" -@@ -606,7 +677,7 @@ - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) - #elif defined(__SUNPRO_C) - # define LZO_INFO_CC "SunPro C" --# if ((__SUNPRO_C)+0 > 0) -+# if ((__SUNPRO_C-0) > 0) - # define LZO_CC_SUNPROC __SUNPRO_C - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) - # else -@@ -615,7 +686,7 @@ - # endif - #elif defined(__SUNPRO_CC) - # define LZO_INFO_CC "SunPro C" --# if ((__SUNPRO_CC)+0 > 0) -+# if ((__SUNPRO_CC-0) > 0) - # define LZO_CC_SUNPROC __SUNPRO_CC - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) - # else -@@ -641,16 +712,46 @@ - #elif defined(__ZTC__) - # define LZO_CC_ZORTECHC 1 - # define LZO_INFO_CC "Zortech C" --# if (__ZTC__ == 0x310) -+# if ((__ZTC__-0) == 0x310) - # define LZO_INFO_CCVER "0x310" - # else - # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) - # endif -+#elif defined(__GNUC__) && defined(__VERSION__) -+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) -+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -+# elif defined(__GNUC_MINOR__) -+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -+# else -+# define LZO_CC_GNUC (__GNUC__ * 0x10000L) -+# endif -+# define LZO_INFO_CC "gcc" -+# define LZO_INFO_CCVER __VERSION__ -+#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) -+# define LZO_CC_MSC _MSC_VER -+# define LZO_INFO_CC "Microsoft C" -+# if defined(_MSC_FULL_VER) -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) -+# else -+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) -+# endif - #else - # define LZO_CC_UNKNOWN 1 - # define LZO_INFO_CC "unknown" - # define LZO_INFO_CCVER "unknown" - #endif -+#if (LZO_CC_GNUC) && defined(__OPEN64__) -+# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) -+# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) -+# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC -+# endif -+#endif -+#if (LZO_CC_GNUC) && defined(__PCC__) -+# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) -+# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) -+# define LZO_CC_PCC_GNUC LZO_CC_GNUC -+# endif -+#endif - #if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) - # error "LZO_CC_MSC: _MSC_FULL_VER is not defined" - #endif -@@ -668,8 +769,10 @@ - # define LZO_INFO_ARCH "generic" - #elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) - # define LZO_ARCH_I086 1 --# define LZO_ARCH_IA16 1 - # define LZO_INFO_ARCH "i086" -+#elif defined(__aarch64__) -+# define LZO_ARCH_ARM64 1 -+# define LZO_INFO_ARCH "arm64" - #elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) - # define LZO_ARCH_ALPHA 1 - # define LZO_INFO_ARCH "alpha" -@@ -685,10 +788,10 @@ - # define LZO_INFO_ARCH "arm_thumb" - #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) - # define LZO_ARCH_ARM 1 --# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) -+# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1) - # define LZO_ARCH_ARM_THUMB 1 - # define LZO_INFO_ARCH "arm_thumb" --# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) -+# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2) - # define LZO_INFO_ARCH "arm" - # else - # define LZO_INFO_ARCH "arm" -@@ -806,53 +909,147 @@ - # error "FIXME - missing define for CPU architecture" - #endif - #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) --# error "FIXME - missing WIN32 define for CPU architecture" -+# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" - #endif - #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) --# error "FIXME - missing WIN64 define for CPU architecture" -+# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" - #endif - #if (LZO_OS_OS216 || LZO_OS_WIN16) - # define LZO_ARCH_I086PM 1 --# define LZO_ARCH_IA16PM 1 - #elif 1 && (LZO_OS_DOS16 && defined(BLX286)) - # define LZO_ARCH_I086PM 1 --# define LZO_ARCH_IA16PM 1 - #elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) - # define LZO_ARCH_I086PM 1 --# define LZO_ARCH_IA16PM 1 - #elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) - # define LZO_ARCH_I086PM 1 --# define LZO_ARCH_IA16PM 1 - #endif --#if (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM) --# error "this should not happen" -+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) -+# define LZO_ARCH_X64 1 -+#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) -+# define LZO_ARCH_AMD64 1 -+#endif -+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) -+# define LZO_ARCH_AARCH64 1 -+#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) -+# define LZO_ARCH_ARM64 1 -+#endif -+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) -+# define LZO_ARCH_X86 1 -+#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) -+# define LZO_ARCH_I386 1 -+#endif -+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB) -+# error "unexpected configuration - check your compiler defines" - #endif --#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086) --# error "this should not happen" -+#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) -+# error "unexpected configuration - check your compiler defines" - #endif - #if (LZO_ARCH_I086) - # if (UINT_MAX != LZO_0xffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - # if (ULONG_MAX != LZO_0xffffffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - #endif - #if (LZO_ARCH_I386) - # if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - # if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - # if (ULONG_MAX != LZO_0xffffffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" -+# endif -+#endif -+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) -+# if !defined(LZO_TARGET_FEATURE_SSE2) -+# if defined(__SSE2__) -+# define LZO_TARGET_FEATURE_SSE2 1 -+# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64)) -+# define LZO_TARGET_FEATURE_SSE2 1 -+# endif -+# endif -+# if !defined(LZO_TARGET_FEATURE_SSSE3) -+# if (LZO_TARGET_FEATURE_SSE2) -+# if defined(__SSSE3__) -+# define LZO_TARGET_FEATURE_SSSE3 1 -+# elif defined(_MSC_VER) && defined(__AVX__) -+# define LZO_TARGET_FEATURE_SSSE3 1 -+# endif -+# endif -+# endif -+# if !defined(LZO_TARGET_FEATURE_SSE4_2) -+# if (LZO_TARGET_FEATURE_SSSE3) -+# if defined(__SSE4_2__) -+# define LZO_TARGET_FEATURE_SSE4_2 1 -+# endif -+# endif -+# endif -+# if !defined(LZO_TARGET_FEATURE_AVX) -+# if (LZO_TARGET_FEATURE_SSSE3) -+# if defined(__AVX__) -+# define LZO_TARGET_FEATURE_AVX 1 -+# endif -+# endif -+# endif -+# if !defined(LZO_TARGET_FEATURE_AVX2) -+# if (LZO_TARGET_FEATURE_AVX) -+# if defined(__AVX2__) -+# define LZO_TARGET_FEATURE_AVX2 1 -+# endif -+# endif -+# endif -+#endif -+#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ARCH_ARM) -+# if !defined(LZO_TARGET_FEATURE_NEON) -+# if defined(__ARM_NEON__) -+# define LZO_TARGET_FEATURE_NEON 1 -+# endif -+# endif -+#elif (LZO_ARCH_ARM64) -+# if !defined(LZO_TARGET_FEATURE_NEON) -+# if 1 -+# define LZO_TARGET_FEATURE_NEON 1 -+# endif - # endif - #endif --#if !defined(__LZO_MM_OVERRIDE) -+#if 0 -+#elif !defined(__LZO_MM_OVERRIDE) - #if (LZO_ARCH_I086) - #if (UINT_MAX != LZO_0xffffL) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - #endif - #if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) - # define LZO_MM_TINY 1 -@@ -879,7 +1076,7 @@ - #elif (LZO_CC_ZORTECHC && defined(__VCM__)) - # define LZO_MM_LARGE 1 - #else --# error "unknown memory model" -+# error "unknown LZO_ARCH_I086 memory model" - #endif - #if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) - #define LZO_HAVE_MM_HUGE_PTR 1 -@@ -902,10 +1099,10 @@ - #endif - #if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) - # if (LZO_OS_DOS16) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # elif (LZO_CC_ZORTECHC) - # else --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - # endif - #endif - #ifdef __cplusplus -@@ -937,7 +1134,7 @@ extern "C" { - #endif - #elif (LZO_ARCH_C166) - #if !defined(__MODEL__) --# error "FIXME - C166 __MODEL__" -+# error "FIXME - LZO_ARCH_C166 __MODEL__" - #elif ((__MODEL__) == 0) - # define LZO_MM_SMALL 1 - #elif ((__MODEL__) == 1) -@@ -951,11 +1148,11 @@ extern "C" { - #elif ((__MODEL__) == 5) - # define LZO_MM_XSMALL 1 - #else --# error "FIXME - C166 __MODEL__" -+# error "FIXME - LZO_ARCH_C166 __MODEL__" - #endif - #elif (LZO_ARCH_MCS251) - #if !defined(__MODEL__) --# error "FIXME - MCS251 __MODEL__" -+# error "FIXME - LZO_ARCH_MCS251 __MODEL__" - #elif ((__MODEL__) == 0) - # define LZO_MM_SMALL 1 - #elif ((__MODEL__) == 2) -@@ -967,11 +1164,11 @@ extern "C" { - #elif ((__MODEL__) == 5) - # define LZO_MM_XSMALL 1 - #else --# error "FIXME - MCS251 __MODEL__" -+# error "FIXME - LZO_ARCH_MCS251 __MODEL__" - #endif - #elif (LZO_ARCH_MCS51) - #if !defined(__MODEL__) --# error "FIXME - MCS51 __MODEL__" -+# error "FIXME - LZO_ARCH_MCS51 __MODEL__" - #elif ((__MODEL__) == 1) - # define LZO_MM_SMALL 1 - #elif ((__MODEL__) == 2) -@@ -983,7 +1180,7 @@ extern "C" { - #elif ((__MODEL__) == 5) - # define LZO_MM_XSMALL 1 - #else --# error "FIXME - MCS51 __MODEL__" -+# error "FIXME - LZO_ARCH_MCS51 __MODEL__" - #endif - #elif (LZO_ARCH_CRAY_PVP) - # define LZO_MM_PVP 1 -@@ -1010,462 +1207,270 @@ extern "C" { - # error "unknown memory model" - #endif - #endif --#if defined(SIZEOF_SHORT) --# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) -+#if !defined(__lzo_gnuc_extension__) -+#if (LZO_CC_GNUC >= 0x020800ul) -+# define __lzo_gnuc_extension__ __extension__ -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_gnuc_extension__ __extension__ -+#elif (LZO_CC_IBMC >= 600) -+# define __lzo_gnuc_extension__ __extension__ -+#else - #endif --#if defined(SIZEOF_INT) --# define LZO_SIZEOF_INT (SIZEOF_INT) - #endif --#if defined(SIZEOF_LONG) --# define LZO_SIZEOF_LONG (SIZEOF_LONG) -+#if !defined(__lzo_gnuc_extension__) -+# define __lzo_gnuc_extension__ /*empty*/ - #endif --#if defined(SIZEOF_LONG_LONG) --# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) -+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 -+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) -+# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -+# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) -+# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -+# else -+# define LZO_CFG_USE_NEW_STYLE_CASTS 1 -+# endif - #endif --#if defined(SIZEOF___INT16) --# define LZO_SIZEOF___INT16 (SIZEOF___INT16) -+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_CFG_USE_NEW_STYLE_CASTS 0 - #endif --#if defined(SIZEOF___INT32) --# define LZO_SIZEOF___INT32 (SIZEOF___INT32) -+#if !defined(__cplusplus) -+# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) -+# undef LZO_CFG_USE_NEW_STYLE_CASTS -+# endif -+# define LZO_CFG_USE_NEW_STYLE_CASTS 0 - #endif --#if defined(SIZEOF___INT64) --# define LZO_SIZEOF___INT64 (SIZEOF___INT64) -+#if !defined(LZO_REINTERPRET_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) -+# endif - #endif --#if defined(SIZEOF_VOID_P) --# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) -+#if !defined(LZO_REINTERPRET_CAST) -+# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) - #endif --#if defined(SIZEOF_SIZE_T) --# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) -+#if !defined(LZO_STATIC_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_STATIC_CAST(t,e) (static_cast (e)) -+# endif - #endif --#if defined(SIZEOF_PTRDIFF_T) --# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) -+#if !defined(LZO_STATIC_CAST) -+# define LZO_STATIC_CAST(t,e) ((t) (e)) - #endif --#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) --#if !defined(LZO_SIZEOF_SHORT) --# if (LZO_ARCH_CRAY_PVP) --# define LZO_SIZEOF_SHORT 8 --# elif (USHRT_MAX == LZO_0xffffL) --# define LZO_SIZEOF_SHORT 2 --# elif (__LZO_LSR(USHRT_MAX,7) == 1) --# define LZO_SIZEOF_SHORT 1 --# elif (__LZO_LSR(USHRT_MAX,15) == 1) --# define LZO_SIZEOF_SHORT 2 --# elif (__LZO_LSR(USHRT_MAX,31) == 1) --# define LZO_SIZEOF_SHORT 4 --# elif (__LZO_LSR(USHRT_MAX,63) == 1) --# define LZO_SIZEOF_SHORT 8 --# elif (__LZO_LSR(USHRT_MAX,127) == 1) --# define LZO_SIZEOF_SHORT 16 --# else --# error "LZO_SIZEOF_SHORT" --# endif -+#if !defined(LZO_STATIC_CAST2) -+# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) - #endif --#if !defined(LZO_SIZEOF_INT) --# if (LZO_ARCH_CRAY_PVP) --# define LZO_SIZEOF_INT 8 --# elif (UINT_MAX == LZO_0xffffL) --# define LZO_SIZEOF_INT 2 --# elif (UINT_MAX == LZO_0xffffffffL) --# define LZO_SIZEOF_INT 4 --# elif (__LZO_LSR(UINT_MAX,7) == 1) --# define LZO_SIZEOF_INT 1 --# elif (__LZO_LSR(UINT_MAX,15) == 1) --# define LZO_SIZEOF_INT 2 --# elif (__LZO_LSR(UINT_MAX,31) == 1) --# define LZO_SIZEOF_INT 4 --# elif (__LZO_LSR(UINT_MAX,63) == 1) --# define LZO_SIZEOF_INT 8 --# elif (__LZO_LSR(UINT_MAX,127) == 1) --# define LZO_SIZEOF_INT 16 --# else --# error "LZO_SIZEOF_INT" -+#if !defined(LZO_UNCONST_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_UNCONST_CAST(t,e) (const_cast (e)) -+# elif (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_UNCONST_CAST(t,e) ((t) (e)) -+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) - # endif - #endif --#if !defined(LZO_SIZEOF_LONG) --# if (ULONG_MAX == LZO_0xffffffffL) --# define LZO_SIZEOF_LONG 4 --# elif (__LZO_LSR(ULONG_MAX,7) == 1) --# define LZO_SIZEOF_LONG 1 --# elif (__LZO_LSR(ULONG_MAX,15) == 1) --# define LZO_SIZEOF_LONG 2 --# elif (__LZO_LSR(ULONG_MAX,31) == 1) --# define LZO_SIZEOF_LONG 4 --# elif (__LZO_LSR(ULONG_MAX,63) == 1) --# define LZO_SIZEOF_LONG 8 --# elif (__LZO_LSR(ULONG_MAX,127) == 1) --# define LZO_SIZEOF_LONG 16 --# else --# error "LZO_SIZEOF_LONG" -+#if !defined(LZO_UNCONST_CAST) -+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) -+#endif -+#if !defined(LZO_UNCONST_VOLATILE_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast (e)) -+# elif (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) -+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) - # endif - #endif --#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) --#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) --# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) --# if (LZO_CC_GNUC >= 0x030300ul) --# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) --# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG --# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) --# define LZO_SIZEOF_LONG_LONG 4 --# endif --# endif -+#if !defined(LZO_UNCONST_VOLATILE_CAST) -+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) -+#endif -+#if !defined(LZO_UNVOLATILE_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_UNVOLATILE_CAST(t,e) (const_cast (e)) -+# elif (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) -+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) - # endif - #endif -+#if !defined(LZO_UNVOLATILE_CAST) -+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) - #endif --#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) --#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) --#if (LZO_ARCH_I086 && LZO_CC_DMC) --#elif (LZO_CC_CILLY) && defined(__GNUC__) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_SIZEOF_LONG_LONG 8 --#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_OS_WIN64 || defined(_WIN64)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) --# define LZO_SIZEOF___INT64 8 --#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) --#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) --# define LZO_SIZEOF_LONG_LONG 8 -+#if !defined(LZO_UNVOLATILE_CONST_CAST) -+# if (LZO_CFG_USE_NEW_STYLE_CASTS) -+# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) -+# elif (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) -+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) -+# endif - #endif -+#if !defined(LZO_UNVOLATILE_CONST_CAST) -+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) - #endif -+#if !defined(LZO_PCAST) -+# if (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_PCAST(t,e) ((t) (e)) -+# endif - #endif --#if defined(__cplusplus) && (LZO_CC_GNUC) --# if (LZO_CC_GNUC < 0x020800ul) --# undef LZO_SIZEOF_LONG_LONG -+#if !defined(LZO_PCAST) -+# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) -+#endif -+#if !defined(LZO_CCAST) -+# if (LZO_HAVE_MM_HUGE_PTR) -+# define LZO_CCAST(t,e) ((t) (e)) - # endif - #endif --#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) --# undef LZO_SIZEOF_LONG_LONG -+#if !defined(LZO_CCAST) -+# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) - #endif --#if !defined(LZO_SIZEOF_VOID_P) --#if (LZO_ARCH_I086) --# define __LZO_WORDSIZE 2 --# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) --# define LZO_SIZEOF_VOID_P 2 --# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) --# define LZO_SIZEOF_VOID_P 4 --# else --# error "LZO_MM" -+#if !defined(LZO_ICONV) -+# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) -+#endif -+#if !defined(LZO_ICAST) -+# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) -+#endif -+#if !defined(LZO_ITRUNC) -+# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) -+#endif -+#if !defined(__lzo_cte) -+# if (LZO_CC_MSC || LZO_CC_WATCOMC) -+# define __lzo_cte(e) ((void)0,(e)) -+# elif 1 -+# define __lzo_cte(e) ((void)0,(e)) - # endif --#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) --# define __LZO_WORDSIZE 1 --# define LZO_SIZEOF_VOID_P 2 --#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) --# define LZO_SIZEOF_VOID_P 2 --#elif (LZO_ARCH_H8300) --# if defined(__NORMAL_MODE__) --# define __LZO_WORDSIZE 4 --# define LZO_SIZEOF_VOID_P 2 --# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) --# define __LZO_WORDSIZE 4 --# define LZO_SIZEOF_VOID_P 4 --# else --# define __LZO_WORDSIZE 2 --# define LZO_SIZEOF_VOID_P 2 --# endif --# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT --# endif --#elif (LZO_ARCH_M16C) --# define __LZO_WORDSIZE 2 --# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) --# define LZO_SIZEOF_VOID_P 4 --# else --# define LZO_SIZEOF_VOID_P 2 --# endif --#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) --# define __LZO_WORDSIZE 8 --# define LZO_SIZEOF_VOID_P 4 --#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) --# define __LZO_WORDSIZE 8 --# define LZO_SIZEOF_VOID_P 8 --#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) --# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (LZO_OS_OS400 || defined(__OS400__)) --# define __LZO_WORDSIZE LZO_SIZEOF_LONG --# define LZO_SIZEOF_VOID_P 16 --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) --# define LZO_SIZEOF_VOID_P 8 --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (LZO_ARCH_SPU) --# if 0 --# define __LZO_WORDSIZE 16 --# endif --# define LZO_SIZEOF_VOID_P 4 --#else --# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG - #endif -+#if !defined(__lzo_cte) -+# define __lzo_cte(e) (e) - #endif --#if !defined(LZO_WORDSIZE) --# if defined(__LZO_WORDSIZE) --# define LZO_WORDSIZE __LZO_WORDSIZE -+#if !defined(LZO_BLOCK_BEGIN) -+# define LZO_BLOCK_BEGIN do { -+# define LZO_BLOCK_END } while __lzo_cte(0) -+#endif -+#if !defined(LZO_UNUSED) -+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -+# define LZO_UNUSED(var) ((void) &var) -+# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) -+# define LZO_UNUSED(var) if (&var) ; else -+# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) -+# define LZO_UNUSED(var) ((void) &var) -+# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_UNUSED(var) ((void) var) -+# elif (LZO_CC_MSC && (_MSC_VER < 900)) -+# define LZO_UNUSED(var) if (&var) ; else -+# elif (LZO_CC_KEILC) -+# define LZO_UNUSED(var) {LZO_EXTERN_C int lzo_unused__[1-2*!(sizeof(var)>0)];} -+# elif (LZO_CC_PACIFICC) -+# define LZO_UNUSED(var) ((void) sizeof(var)) -+# elif (LZO_CC_WATCOMC) && defined(__cplusplus) -+# define LZO_UNUSED(var) ((void) var) - # else --# define LZO_WORDSIZE LZO_SIZEOF_VOID_P -+# define LZO_UNUSED(var) ((void) &var) - # endif - #endif --#if !defined(LZO_SIZEOF_SIZE_T) --#if (LZO_ARCH_I086 || LZO_ARCH_M16C) --# define LZO_SIZEOF_SIZE_T 2 --#else --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P --#endif --#endif --#if !defined(LZO_SIZEOF_PTRDIFF_T) --#if (LZO_ARCH_I086) --# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P --# elif (LZO_MM_COMPACT || LZO_MM_LARGE) --# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) --# define LZO_SIZEOF_PTRDIFF_T 4 --# else --# define LZO_SIZEOF_PTRDIFF_T 2 --# endif -+#if !defined(LZO_UNUSED_FUNC) -+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -+# define LZO_UNUSED_FUNC(func) ((void) func) -+# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) -+# define LZO_UNUSED_FUNC(func) if (func) ; else -+# elif (LZO_CC_CLANG || LZO_CC_LLVM) -+# define LZO_UNUSED_FUNC(func) ((void) &func) -+# elif (LZO_CC_MSC && (_MSC_VER < 900)) -+# define LZO_UNUSED_FUNC(func) if (func) ; else -+# elif (LZO_CC_MSC) -+# define LZO_UNUSED_FUNC(func) ((void) &func) -+# elif (LZO_CC_KEILC || LZO_CC_PELLESC) -+# define LZO_UNUSED_FUNC(func) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];} - # else --# error "LZO_MM" -+# define LZO_UNUSED_FUNC(func) ((void) func) - # endif --#else --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T --#endif - #endif --#if (LZO_ABI_NEUTRAL_ENDIAN) --# undef LZO_ABI_BIG_ENDIAN --# undef LZO_ABI_LITTLE_ENDIAN --#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) --#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) --# define LZO_ABI_BIG_ENDIAN 1 --#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) --# if (__LITTLE_ENDIAN__ == 1) --# define LZO_ABI_LITTLE_ENDIAN 1 -+#if !defined(LZO_UNUSED_LABEL) -+# if (LZO_CC_CLANG >= 0x020800ul) -+# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) -+# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) -+# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l - # else --# define LZO_ABI_BIG_ENDIAN 1 -+# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l - # endif --#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#endif --#endif --#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) --# error "this should not happen" --#endif --#if (LZO_ABI_BIG_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "be" --#elif (LZO_ABI_LITTLE_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "le" --#elif (LZO_ABI_NEUTRAL_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "neutral" --#endif --#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) --# define LZO_ABI_I8LP16 1 --# define LZO_INFO_ABI_PM "i8lp16" --#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) --# define LZO_ABI_ILP16 1 --# define LZO_INFO_ABI_PM "ilp16" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) --# define LZO_ABI_ILP32 1 --# define LZO_INFO_ABI_PM "ilp32" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) --# define LZO_ABI_LLP64 1 --# define LZO_INFO_ABI_PM "llp64" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) --# define LZO_ABI_LP64 1 --# define LZO_INFO_ABI_PM "lp64" --#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) --# define LZO_ABI_ILP64 1 --# define LZO_INFO_ABI_PM "ilp64" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) --# define LZO_ABI_IP32L64 1 --# define LZO_INFO_ABI_PM "ip32l64" - #endif --#if !defined(__LZO_LIBC_OVERRIDE) --#if (LZO_LIBC_NAKED) --# define LZO_INFO_LIBC "naked" --#elif (LZO_LIBC_FREESTANDING) --# define LZO_INFO_LIBC "freestanding" --#elif (LZO_LIBC_MOSTLY_FREESTANDING) --# define LZO_INFO_LIBC "mfreestanding" --#elif (LZO_LIBC_ISOC90) --# define LZO_INFO_LIBC "isoc90" --#elif (LZO_LIBC_ISOC99) --# define LZO_INFO_LIBC "isoc99" --#elif defined(__dietlibc__) --# define LZO_LIBC_DIETLIBC 1 --# define LZO_INFO_LIBC "dietlibc" --#elif defined(_NEWLIB_VERSION) --# define LZO_LIBC_NEWLIB 1 --# define LZO_INFO_LIBC "newlib" --#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) --# if defined(__UCLIBC_SUBLEVEL__) --# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) -+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) -+# if 0 -+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var -+# elif 0 && (LZO_CC_GNUC) -+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var - # else --# define LZO_LIBC_UCLIBC 0x00090bL -+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init - # endif --# define LZO_INFO_LIBC "uclibc" --#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) --# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) --# define LZO_INFO_LIBC "glibc" --#elif (LZO_CC_MWERKS) && defined(__MSL__) --# define LZO_LIBC_MSL __MSL__ --# define LZO_INFO_LIBC "msl" --#elif 1 && defined(__IAR_SYSTEMS_ICC__) --# define LZO_LIBC_ISOC90 1 --# define LZO_INFO_LIBC "isoc90" --#else --# define LZO_LIBC_DEFAULT 1 --# define LZO_INFO_LIBC "default" --#endif --#endif --#if !defined(__lzo_gnuc_extension__) --#if (LZO_CC_GNUC >= 0x020800ul) --# define __lzo_gnuc_extension__ __extension__ --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_gnuc_extension__ __extension__ --#else --# define __lzo_gnuc_extension__ /*empty*/ --#endif --#endif --#if !defined(__lzo_ua_volatile) --# define __lzo_ua_volatile volatile --#endif --#if !defined(__lzo_alignof) --#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) --# define __lzo_alignof(e) __alignof__(e) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) --# define __lzo_alignof(e) __alignof__(e) --#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) --# define __lzo_alignof(e) __alignof(e) --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) --# define __lzo_alignof(e) __alignof__(e) --#endif --#endif --#if defined(__lzo_alignof) --# define __lzo_HAVE_alignof 1 --#endif --#if !defined(__lzo_constructor) --#if (LZO_CC_GNUC >= 0x030400ul) --# define __lzo_constructor __attribute__((__constructor__,__used__)) --#elif (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_constructor __attribute__((__constructor__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_constructor __attribute__((__constructor__)) --#endif --#endif --#if defined(__lzo_constructor) --# define __lzo_HAVE_constructor 1 --#endif --#if !defined(__lzo_destructor) --#if (LZO_CC_GNUC >= 0x030400ul) --# define __lzo_destructor __attribute__((__destructor__,__used__)) --#elif (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_destructor __attribute__((__destructor__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_destructor __attribute__((__destructor__)) --#endif --#endif --#if defined(__lzo_destructor) --# define __lzo_HAVE_destructor 1 --#endif --#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) --# error "this should not happen" - #endif - #if !defined(__lzo_inline) - #if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) - #elif defined(__cplusplus) - # define __lzo_inline inline -+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -+# define __lzo_inline inline - #elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) - # define __lzo_inline __inline --#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) - # define __lzo_inline __inline__ - #elif (LZO_CC_DMC) - # define __lzo_inline __inline -+#elif (LZO_CC_GHS) -+# define __lzo_inline __inline__ -+#elif (LZO_CC_IBMC >= 600) -+# define __lzo_inline __inline__ - #elif (LZO_CC_INTELC) - # define __lzo_inline __inline - #elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) - # define __lzo_inline __inline - #elif (LZO_CC_MSC && (_MSC_VER >= 900)) - # define __lzo_inline __inline --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) -+#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_inline __inline__ --#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) --# define __lzo_inline inline - #endif - #endif - #if defined(__lzo_inline) -+# ifndef __lzo_HAVE_inline - # define __lzo_HAVE_inline 1 -+# endif - #else - # define __lzo_inline /*empty*/ - #endif - #if !defined(__lzo_forceinline) - #if (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) -+#elif (LZO_CC_IBMC >= 700) -+# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) - # define __lzo_forceinline __forceinline --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) - #elif (LZO_CC_MSC && (_MSC_VER >= 1200)) - # define __lzo_forceinline __forceinline --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) -+#elif (LZO_CC_PGI >= 0x0d0a00ul) -+# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -+#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) - #endif - #endif - #if defined(__lzo_forceinline) -+# ifndef __lzo_HAVE_forceinline - # define __lzo_HAVE_forceinline 1 -+# endif - #else --# define __lzo_forceinline /*empty*/ -+# define __lzo_forceinline __lzo_inline - #endif - #if !defined(__lzo_noinline) - #if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) - # define __lzo_noinline __attribute__((__noinline__,__used__)) - #elif (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_noinline __attribute__((__noinline__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) -+#elif (LZO_CC_IBMC >= 700) -+# define __lzo_noinline __attribute__((__noinline__)) -+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) - # define __lzo_noinline __declspec(noinline) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) - # define __lzo_noinline __attribute__((__noinline__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_noinline __attribute__((__noinline__)) - #elif (LZO_CC_MSC && (_MSC_VER >= 1300)) - # define __lzo_noinline __declspec(noinline) -@@ -1474,179 +1479,409 @@ extern "C" { - # else - # define __lzo_noinline __declspec(noinline) - # endif --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) -+#elif (LZO_CC_PGI >= 0x0d0a00ul) -+# define __lzo_noinline __attribute__((__noinline__)) -+#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_noinline __attribute__((__noinline__)) - #endif - #endif - #if defined(__lzo_noinline) -+# ifndef __lzo_HAVE_noinline - # define __lzo_HAVE_noinline 1 -+# endif - #else - # define __lzo_noinline /*empty*/ - #endif - #if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) --# error "this should not happen" -+# error "unexpected configuration - check your compiler defines" - #endif --#if !defined(__lzo_noreturn) --#if (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) --# define __lzo_noreturn __declspec(noreturn) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) --# define __lzo_noreturn __declspec(noreturn) -+#if !defined(__lzo_static_inline) -+#if (LZO_CC_IBMC) -+# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline - #endif - #endif --#if defined(__lzo_noreturn) --# define __lzo_HAVE_noreturn 1 --#else --# define __lzo_noreturn /*empty*/ -+#if !defined(__lzo_static_inline) -+# define __lzo_static_inline static __lzo_inline - #endif --#if !defined(__lzo_nothrow) --#if (LZO_CC_GNUC >= 0x030300ul) --# define __lzo_nothrow __attribute__((__nothrow__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) --# define __lzo_nothrow __declspec(nothrow) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC) --# define __lzo_nothrow __attribute__((__nothrow__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_nothrow __attribute__((__nothrow__)) --#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) -+#if !defined(__lzo_static_forceinline) -+#if (LZO_CC_IBMC) -+# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline -+#endif -+#endif -+#if !defined(__lzo_static_forceinline) -+# define __lzo_static_forceinline static __lzo_forceinline -+#endif -+#if !defined(__lzo_static_noinline) -+#if (LZO_CC_IBMC) -+# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline -+#endif -+#endif -+#if !defined(__lzo_static_noinline) -+# define __lzo_static_noinline static __lzo_noinline -+#endif -+#if !defined(__lzo_c99_extern_inline) -+#if defined(__GNUC_GNU_INLINE__) -+# define __lzo_c99_extern_inline __lzo_inline -+#elif defined(__GNUC_STDC_INLINE__) -+# define __lzo_c99_extern_inline extern __lzo_inline -+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -+# define __lzo_c99_extern_inline extern __lzo_inline -+#endif -+#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) -+# define __lzo_c99_extern_inline __lzo_inline -+#endif -+#endif -+#if defined(__lzo_c99_extern_inline) -+# ifndef __lzo_HAVE_c99_extern_inline -+# define __lzo_HAVE_c99_extern_inline 1 -+# endif -+#else -+# define __lzo_c99_extern_inline /*empty*/ -+#endif -+#if !defined(__lzo_may_alias) -+#if (LZO_CC_GNUC >= 0x030400ul) -+# define __lzo_may_alias __attribute__((__may_alias__)) -+#elif (LZO_CC_CLANG >= 0x020900ul) -+# define __lzo_may_alias __attribute__((__may_alias__)) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 -+# define __lzo_may_alias __attribute__((__may_alias__)) -+#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 -+# define __lzo_may_alias __attribute__((__may_alias__)) -+#endif -+#endif -+#if defined(__lzo_may_alias) -+# ifndef __lzo_HAVE_may_alias -+# define __lzo_HAVE_may_alias 1 -+# endif -+#else -+# define __lzo_may_alias /*empty*/ -+#endif -+#if !defined(__lzo_noreturn) -+#if (LZO_CC_GNUC >= 0x020700ul) -+# define __lzo_noreturn __attribute__((__noreturn__)) -+#elif (LZO_CC_IBMC >= 700) -+# define __lzo_noreturn __attribute__((__noreturn__)) -+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) -+# define __lzo_noreturn __declspec(noreturn) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -+# define __lzo_noreturn __attribute__((__noreturn__)) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_noreturn __attribute__((__noreturn__)) -+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) -+# define __lzo_noreturn __declspec(noreturn) -+#elif (LZO_CC_PGI >= 0x0d0a00ul) -+# define __lzo_noreturn __attribute__((__noreturn__)) -+#endif -+#endif -+#if defined(__lzo_noreturn) -+# ifndef __lzo_HAVE_noreturn -+# define __lzo_HAVE_noreturn 1 -+# endif -+#else -+# define __lzo_noreturn /*empty*/ -+#endif -+#if !defined(__lzo_nothrow) -+#if (LZO_CC_GNUC >= 0x030300ul) -+# define __lzo_nothrow __attribute__((__nothrow__)) -+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) -+# define __lzo_nothrow __declspec(nothrow) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) -+# define __lzo_nothrow __attribute__((__nothrow__)) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_nothrow __attribute__((__nothrow__)) -+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) - # define __lzo_nothrow __declspec(nothrow) - #endif - #endif - #if defined(__lzo_nothrow) -+# ifndef __lzo_HAVE_nothrow - # define __lzo_HAVE_nothrow 1 -+# endif - #else - # define __lzo_nothrow /*empty*/ - #endif - #if !defined(__lzo_restrict) - #if (LZO_CC_GNUC >= 0x030400ul) - # define __lzo_restrict __restrict__ --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) -+#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) - # define __lzo_restrict __restrict__ --#elif (LZO_CC_CLANG || LZO_CC_LLVM) -+#elif (LZO_CC_IBMC >= 1210) -+# define __lzo_restrict __restrict__ -+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -+# define __lzo_restrict __restrict__ -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) - # define __lzo_restrict __restrict__ - #elif (LZO_CC_MSC && (_MSC_VER >= 1400)) - # define __lzo_restrict __restrict -+#elif (LZO_CC_PGI >= 0x0d0a00ul) -+# define __lzo_restrict __restrict__ - #endif - #endif - #if defined(__lzo_restrict) -+# ifndef __lzo_HAVE_restrict - # define __lzo_HAVE_restrict 1 -+# endif - #else - # define __lzo_restrict /*empty*/ - #endif -+#if !defined(__lzo_alignof) -+#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -+# define __lzo_alignof(e) __alignof__(e) -+#elif (LZO_CC_GHS) && !defined(__cplusplus) -+# define __lzo_alignof(e) __alignof__(e) -+#elif (LZO_CC_IBMC >= 600) -+# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) -+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) -+# define __lzo_alignof(e) __alignof__(e) -+#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) -+# define __lzo_alignof(e) __alignof(e) -+#elif (LZO_CC_SUNPROC >= 0x5100) -+# define __lzo_alignof(e) __alignof__(e) -+#endif -+#endif -+#if defined(__lzo_alignof) -+# ifndef __lzo_HAVE_alignof -+# define __lzo_HAVE_alignof 1 -+# endif -+#endif -+#if !defined(__lzo_struct_packed) -+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -+#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) -+# define __lzo_struct_packed(s) struct s { -+# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); -+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); -+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -+# define __lzo_struct_packed(s) struct s { -+# define __lzo_struct_packed_end() } __attribute__((__packed__)); -+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -+#elif (LZO_CC_IBMC >= 700) -+# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { -+# define __lzo_struct_packed_end() } __attribute__((__packed__)); -+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -+# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { -+# define __lzo_struct_packed_end() } __pragma(pack(pop)); -+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -+# define __lzo_struct_packed(s) _Packed struct s { -+# define __lzo_struct_packed_end() }; -+#endif -+#endif -+#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) -+# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) -+#endif -+#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) -+# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() -+#endif -+#if !defined(__lzo_byte_struct) -+#if defined(__lzo_struct_packed) -+# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() -+# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() -+#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) -+# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); -+# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); -+#endif -+#endif -+#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) -+# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) -+#endif -+#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) -+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) -+#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -+#elif (LZO_CC_CILLY || LZO_CC_PCC) -+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -+# define __lzo_struct_align16(s) struct __declspec(align(16)) s { -+# define __lzo_struct_align16_end() }; -+# define __lzo_struct_align32(s) struct __declspec(align(32)) s { -+# define __lzo_struct_align32_end() }; -+# define __lzo_struct_align64(s) struct __declspec(align(64)) s { -+# define __lzo_struct_align64_end() }; -+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_struct_align16(s) struct s { -+# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); -+# define __lzo_struct_align32(s) struct s { -+# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); -+# define __lzo_struct_align64(s) struct s { -+# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); -+#endif -+#endif -+#if !defined(__lzo_union_um) -+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) -+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -+# define __lzo_union_am(s) union s { -+# define __lzo_union_am_end() } __lzo_may_alias; -+# define __lzo_union_um(s) union s { -+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -+#elif (LZO_CC_IBMC >= 700) -+# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { -+# define __lzo_union_am_end() } __lzo_may_alias; -+# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { -+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -+# define __lzo_union_um(s) __pragma(pack(push,1)) union s { -+# define __lzo_union_um_end() } __pragma(pack(pop)); -+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -+# define __lzo_union_um(s) _Packed union s { -+# define __lzo_union_um_end() }; -+#endif -+#endif -+#if !defined(__lzo_union_am) -+# define __lzo_union_am(s) union s { -+# define __lzo_union_am_end() }; -+#endif -+#if !defined(__lzo_constructor) -+#if (LZO_CC_GNUC >= 0x030400ul) -+# define __lzo_constructor __attribute__((__constructor__,__used__)) -+#elif (LZO_CC_GNUC >= 0x020700ul) -+# define __lzo_constructor __attribute__((__constructor__)) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -+# define __lzo_constructor __attribute__((__constructor__,__used__)) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_constructor __attribute__((__constructor__)) -+#endif -+#endif -+#if defined(__lzo_constructor) -+# ifndef __lzo_HAVE_constructor -+# define __lzo_HAVE_constructor 1 -+# endif -+#endif -+#if !defined(__lzo_destructor) -+#if (LZO_CC_GNUC >= 0x030400ul) -+# define __lzo_destructor __attribute__((__destructor__,__used__)) -+#elif (LZO_CC_GNUC >= 0x020700ul) -+# define __lzo_destructor __attribute__((__destructor__)) -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -+# define __lzo_destructor __attribute__((__destructor__,__used__)) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define __lzo_destructor __attribute__((__destructor__)) -+#endif -+#endif -+#if defined(__lzo_destructor) -+# ifndef __lzo_HAVE_destructor -+# define __lzo_HAVE_destructor 1 -+# endif -+#endif -+#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) -+# error "unexpected configuration - check your compiler defines" -+#endif - #if !defined(__lzo_likely) && !defined(__lzo_unlikely) - #if (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -+#elif (LZO_CC_IBMC >= 1010) -+# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) - #elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) - #endif - #endif - #if defined(__lzo_likely) -+# ifndef __lzo_HAVE_likely - # define __lzo_HAVE_likely 1 -+# endif - #else - # define __lzo_likely(e) (e) - #endif - #if defined(__lzo_unlikely) -+# ifndef __lzo_HAVE_unlikely - # define __lzo_HAVE_unlikely 1 -+# endif - #else - # define __lzo_unlikely(e) (e) - #endif --#if !defined(LZO_UNUSED) --# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) --# define LZO_UNUSED(var) ((void) &var) --# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) --# define LZO_UNUSED(var) if (&var) ; else --# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_UNUSED(var) ((void) var) --# elif (LZO_CC_MSC && (_MSC_VER < 900)) --# define LZO_UNUSED(var) if (&var) ; else --# elif (LZO_CC_KEILC) --# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} --# elif (LZO_CC_PACIFICC) --# define LZO_UNUSED(var) ((void) sizeof(var)) --# elif (LZO_CC_WATCOMC) && defined(__cplusplus) --# define LZO_UNUSED(var) ((void) var) -+#if !defined(__lzo_static_unused_void_func) -+# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -+# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void) - # else --# define LZO_UNUSED(var) ((void) &var) -+# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void) - # endif - #endif --#if !defined(LZO_UNUSED_FUNC) --# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) --# define LZO_UNUSED_FUNC(func) ((void) func) --# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) --# define LZO_UNUSED_FUNC(func) if (func) ; else --# elif (LZO_CC_CLANG || LZO_CC_LLVM) --# define LZO_UNUSED_FUNC(func) ((void) &func) --# elif (LZO_CC_MSC && (_MSC_VER < 900)) --# define LZO_UNUSED_FUNC(func) if (func) ; else --# elif (LZO_CC_MSC) --# define LZO_UNUSED_FUNC(func) ((void) &func) --# elif (LZO_CC_KEILC || LZO_CC_PELLESC) --# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} -+#if !defined(__lzo_loop_forever) -+# if (LZO_CC_IBMC) -+# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END - # else --# define LZO_UNUSED_FUNC(func) ((void) func) -+# define __lzo_loop_forever() do { ; } while __lzo_cte(1) - # endif - #endif --#if !defined(LZO_UNUSED_LABEL) --# if (LZO_CC_WATCOMC) && defined(__cplusplus) --# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l --# elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) --# define LZO_UNUSED_LABEL(l) if (0) goto l --# else --# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l --# endif -+#if !defined(__lzo_unreachable) -+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) -+# define __lzo_unreachable() __builtin_unreachable(); -+#elif (LZO_CC_GNUC >= 0x040500ul) -+# define __lzo_unreachable() __builtin_unreachable(); -+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 -+# define __lzo_unreachable() __builtin_unreachable(); - #endif --#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) -+#endif -+#if defined(__lzo_unreachable) -+# ifndef __lzo_HAVE_unreachable -+# define __lzo_HAVE_unreachable 1 -+# endif -+#else - # if 0 --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var --# elif 0 && (LZO_CC_GNUC) --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var -+# define __lzo_unreachable() ((void)0); - # else --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init -+# define __lzo_unreachable() __lzo_loop_forever(); - # endif - #endif --#if !defined(LZO_UNCONST_CAST) --# if 0 && defined(__cplusplus) --# define LZO_UNCONST_CAST(t,e) (const_cast (e)) --# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e)))))) --# else --# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e))))) --# endif -+#ifndef __LZO_CTA_NAME -+#if (LZO_CFG_USE_COUNTER) -+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) -+#else -+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) -+#endif - #endif - #if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) - # if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END - # elif (LZO_CC_DMC || LZO_CC_SYMANTECC) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END - # elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END -+# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END -+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END - # else --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; -+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END - # endif - #endif - #if !defined(LZO_COMPILE_TIME_ASSERT) - # if (LZO_CC_AZTECC) --# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} -+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} - # elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -+# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} -+# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) -+# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} -+# elif (LZO_CC_GNUC >= 0x040700ul) -+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} - # elif (LZO_CC_MSC && (_MSC_VER < 900)) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; - # elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; - # else --# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} -+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} - # endif - #endif -+LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) -+#if defined(__cplusplus) -+extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) - #if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) - # if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) - # elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -@@ -1681,99 +1916,654 @@ extern "C" { - # elif defined(_MT) - # define __lzo_cdecl_sighandler _far _cdecl - # else --# define __lzo_cdecl_sighandler _cdecl -+# define __lzo_cdecl_sighandler _cdecl -+# endif -+# else -+# define __lzo_cdecl_sighandler __cdecl -+# endif -+#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) -+# define __lzo_cdecl __cdecl -+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) -+# define __lzo_cdecl cdecl -+#endif -+#if !defined(__lzo_cdecl) -+# define __lzo_cdecl /*empty*/ -+#endif -+#if !defined(__lzo_cdecl_atexit) -+# define __lzo_cdecl_atexit /*empty*/ -+#endif -+#if !defined(__lzo_cdecl_main) -+# define __lzo_cdecl_main /*empty*/ -+#endif -+#if !defined(__lzo_cdecl_qsort) -+# define __lzo_cdecl_qsort /*empty*/ -+#endif -+#if !defined(__lzo_cdecl_sighandler) -+# define __lzo_cdecl_sighandler /*empty*/ -+#endif -+#if !defined(__lzo_cdecl_va) -+# define __lzo_cdecl_va __lzo_cdecl -+#endif -+#if !(LZO_CFG_NO_WINDOWS_H) -+#if !defined(LZO_HAVE_WINDOWS_H) -+#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) -+# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) -+# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) -+# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) -+# else -+# define LZO_HAVE_WINDOWS_H 1 -+# endif -+#endif -+#endif -+#endif -+#ifndef LZO_SIZEOF_SHORT -+#if defined(SIZEOF_SHORT) -+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) -+#elif defined(__SIZEOF_SHORT__) -+# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) -+#endif -+#endif -+#ifndef LZO_SIZEOF_INT -+#if defined(SIZEOF_INT) -+# define LZO_SIZEOF_INT (SIZEOF_INT) -+#elif defined(__SIZEOF_INT__) -+# define LZO_SIZEOF_INT (__SIZEOF_INT__) -+#endif -+#endif -+#ifndef LZO_SIZEOF_LONG -+#if defined(SIZEOF_LONG) -+# define LZO_SIZEOF_LONG (SIZEOF_LONG) -+#elif defined(__SIZEOF_LONG__) -+# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) -+#endif -+#endif -+#ifndef LZO_SIZEOF_LONG_LONG -+#if defined(SIZEOF_LONG_LONG) -+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) -+#elif defined(__SIZEOF_LONG_LONG__) -+# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) -+#endif -+#endif -+#ifndef LZO_SIZEOF___INT16 -+#if defined(SIZEOF___INT16) -+# define LZO_SIZEOF___INT16 (SIZEOF___INT16) -+#endif -+#endif -+#ifndef LZO_SIZEOF___INT32 -+#if defined(SIZEOF___INT32) -+# define LZO_SIZEOF___INT32 (SIZEOF___INT32) -+#endif -+#endif -+#ifndef LZO_SIZEOF___INT64 -+#if defined(SIZEOF___INT64) -+# define LZO_SIZEOF___INT64 (SIZEOF___INT64) -+#endif -+#endif -+#ifndef LZO_SIZEOF_VOID_P -+#if defined(SIZEOF_VOID_P) -+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) -+#elif defined(__SIZEOF_POINTER__) -+# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) -+#endif -+#endif -+#ifndef LZO_SIZEOF_SIZE_T -+#if defined(SIZEOF_SIZE_T) -+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) -+#elif defined(__SIZEOF_SIZE_T__) -+# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) -+#endif -+#endif -+#ifndef LZO_SIZEOF_PTRDIFF_T -+#if defined(SIZEOF_PTRDIFF_T) -+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) -+#elif defined(__SIZEOF_PTRDIFF_T__) -+# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) -+#endif -+#endif -+#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) -+#if !defined(LZO_SIZEOF_SHORT) -+# if (LZO_ARCH_CRAY_PVP) -+# define LZO_SIZEOF_SHORT 8 -+# elif (USHRT_MAX == LZO_0xffffL) -+# define LZO_SIZEOF_SHORT 2 -+# elif (__LZO_LSR(USHRT_MAX,7) == 1) -+# define LZO_SIZEOF_SHORT 1 -+# elif (__LZO_LSR(USHRT_MAX,15) == 1) -+# define LZO_SIZEOF_SHORT 2 -+# elif (__LZO_LSR(USHRT_MAX,31) == 1) -+# define LZO_SIZEOF_SHORT 4 -+# elif (__LZO_LSR(USHRT_MAX,63) == 1) -+# define LZO_SIZEOF_SHORT 8 -+# elif (__LZO_LSR(USHRT_MAX,127) == 1) -+# define LZO_SIZEOF_SHORT 16 -+# else -+# error "LZO_SIZEOF_SHORT" -+# endif -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) -+#if !defined(LZO_SIZEOF_INT) -+# if (LZO_ARCH_CRAY_PVP) -+# define LZO_SIZEOF_INT 8 -+# elif (UINT_MAX == LZO_0xffffL) -+# define LZO_SIZEOF_INT 2 -+# elif (UINT_MAX == LZO_0xffffffffL) -+# define LZO_SIZEOF_INT 4 -+# elif (__LZO_LSR(UINT_MAX,7) == 1) -+# define LZO_SIZEOF_INT 1 -+# elif (__LZO_LSR(UINT_MAX,15) == 1) -+# define LZO_SIZEOF_INT 2 -+# elif (__LZO_LSR(UINT_MAX,31) == 1) -+# define LZO_SIZEOF_INT 4 -+# elif (__LZO_LSR(UINT_MAX,63) == 1) -+# define LZO_SIZEOF_INT 8 -+# elif (__LZO_LSR(UINT_MAX,127) == 1) -+# define LZO_SIZEOF_INT 16 -+# else -+# error "LZO_SIZEOF_INT" -+# endif -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) -+#if !defined(LZO_SIZEOF_LONG) -+# if (ULONG_MAX == LZO_0xffffffffL) -+# define LZO_SIZEOF_LONG 4 -+# elif (__LZO_LSR(ULONG_MAX,7) == 1) -+# define LZO_SIZEOF_LONG 1 -+# elif (__LZO_LSR(ULONG_MAX,15) == 1) -+# define LZO_SIZEOF_LONG 2 -+# elif (__LZO_LSR(ULONG_MAX,31) == 1) -+# define LZO_SIZEOF_LONG 4 -+# elif (__LZO_LSR(ULONG_MAX,39) == 1) -+# define LZO_SIZEOF_LONG 5 -+# elif (__LZO_LSR(ULONG_MAX,63) == 1) -+# define LZO_SIZEOF_LONG 8 -+# elif (__LZO_LSR(ULONG_MAX,127) == 1) -+# define LZO_SIZEOF_LONG 16 -+# else -+# error "LZO_SIZEOF_LONG" -+# endif -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) -+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) -+# if (LZO_CC_GNUC >= 0x030300ul) -+# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) -+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG -+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) -+# define LZO_SIZEOF_LONG_LONG 4 -+# endif -+# endif -+# endif -+#endif -+#endif -+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -+#if (LZO_ARCH_I086 && LZO_CC_DMC) -+#elif (LZO_CC_CILLY) && defined(__GNUC__) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_OS_WIN64 || defined(_WIN64)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) -+# define LZO_SIZEOF___INT64 8 -+#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) -+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -+# define LZO_SIZEOF_LONG_LONG 8 -+#endif -+#endif -+#endif -+#if defined(__cplusplus) && (LZO_CC_GNUC) -+# if (LZO_CC_GNUC < 0x020800ul) -+# undef LZO_SIZEOF_LONG_LONG -+# endif -+#endif -+#if (LZO_CFG_NO_LONG_LONG) -+# undef LZO_SIZEOF_LONG_LONG -+#elif defined(__NO_LONG_LONG) -+# undef LZO_SIZEOF_LONG_LONG -+#elif defined(_NO_LONGLONG) -+# undef LZO_SIZEOF_LONG_LONG -+#endif -+#if !defined(LZO_WORDSIZE) -+#if (LZO_ARCH_ALPHA) -+# define LZO_WORDSIZE 8 -+#elif (LZO_ARCH_AMD64) -+# define LZO_WORDSIZE 8 -+#elif (LZO_ARCH_AVR) -+# define LZO_WORDSIZE 1 -+#elif (LZO_ARCH_H8300) -+# if defined(__NORMAL_MODE__) -+# define LZO_WORDSIZE 4 -+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -+# define LZO_WORDSIZE 4 -+# else -+# define LZO_WORDSIZE 2 -+# endif -+#elif (LZO_ARCH_I086) -+# define LZO_WORDSIZE 2 -+#elif (LZO_ARCH_IA64) -+# define LZO_WORDSIZE 8 -+#elif (LZO_ARCH_M16C) -+# define LZO_WORDSIZE 2 -+#elif (LZO_ARCH_SPU) -+# define LZO_WORDSIZE 4 -+#elif (LZO_ARCH_Z80) -+# define LZO_WORDSIZE 1 -+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -+# define LZO_WORDSIZE 8 -+#elif (LZO_OS_OS400 || defined(__OS400__)) -+# define LZO_WORDSIZE 8 -+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -+# define LZO_WORDSIZE 8 -+#endif -+#endif -+#if !defined(LZO_SIZEOF_VOID_P) -+#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -+# define LZO_SIZEOF_VOID_P 4 -+#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -+# define LZO_SIZEOF_VOID_P 8 -+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -+# define LZO_SIZEOF_VOID_P 8 -+#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -+# define LZO_SIZEOF_VOID_P 8 -+#elif (LZO_ARCH_AVR) -+# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) -+# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_ARCH_H8300) -+# if defined(__NORMAL_MODE__) -+# define LZO_SIZEOF_VOID_P 2 -+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -+# define LZO_SIZEOF_VOID_P 4 -+# else -+# define LZO_SIZEOF_VOID_P 2 -+# endif -+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT -+# endif -+#elif (LZO_ARCH_I086) -+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) -+# define LZO_SIZEOF_VOID_P 2 -+# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) -+# define LZO_SIZEOF_VOID_P 4 -+# else -+# error "invalid LZO_ARCH_I086 memory model" -+# endif -+#elif (LZO_ARCH_M16C) -+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) -+# define LZO_SIZEOF_VOID_P 4 -+# else -+# define LZO_SIZEOF_VOID_P 2 -+# endif -+#elif (LZO_ARCH_SPU) -+# define LZO_SIZEOF_VOID_P 4 -+#elif (LZO_ARCH_Z80) -+# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -+# define LZO_SIZEOF_VOID_P 4 -+#elif (LZO_OS_OS400 || defined(__OS400__)) -+# if defined(__LLP64_IFC__) -+# define LZO_SIZEOF_VOID_P 8 -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+# else -+# define LZO_SIZEOF_VOID_P 16 -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+# endif -+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -+# define LZO_SIZEOF_VOID_P 8 -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+#endif -+#endif -+#if !defined(LZO_SIZEOF_VOID_P) -+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG -+#endif -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) -+#if !defined(LZO_SIZEOF_SIZE_T) -+#if (LZO_ARCH_I086 || LZO_ARCH_M16C) -+# define LZO_SIZEOF_SIZE_T 2 -+#endif -+#endif -+#if !defined(LZO_SIZEOF_SIZE_T) -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P -+#endif -+#if defined(offsetof) -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) -+#endif -+#if !defined(LZO_SIZEOF_PTRDIFF_T) -+#if (LZO_ARCH_I086) -+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P -+# elif (LZO_MM_COMPACT || LZO_MM_LARGE) -+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) -+# define LZO_SIZEOF_PTRDIFF_T 4 -+# else -+# define LZO_SIZEOF_PTRDIFF_T 2 - # endif - # else --# define __lzo_cdecl_sighandler __cdecl -+# error "invalid LZO_ARCH_I086 memory model" - # endif --#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) --# define __lzo_cdecl __cdecl --#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) --# define __lzo_cdecl cdecl - #endif --#if !defined(__lzo_cdecl) --# define __lzo_cdecl /*empty*/ - #endif --#if !defined(__lzo_cdecl_atexit) --# define __lzo_cdecl_atexit /*empty*/ -+#if !defined(LZO_SIZEOF_PTRDIFF_T) -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T - #endif --#if !defined(__lzo_cdecl_main) --# define __lzo_cdecl_main /*empty*/ -+#if defined(offsetof) -+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) - #endif --#if !defined(__lzo_cdecl_qsort) --# define __lzo_cdecl_qsort /*empty*/ -+#if !defined(LZO_WORDSIZE) -+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P - #endif --#if !defined(__lzo_cdecl_sighandler) --# define __lzo_cdecl_sighandler /*empty*/ -+#if (LZO_ABI_NEUTRAL_ENDIAN) -+# undef LZO_ABI_BIG_ENDIAN -+# undef LZO_ABI_LITTLE_ENDIAN -+#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) -+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) -+# if (__LITTLE_ENDIAN__ == 1) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+# else -+# define LZO_ABI_BIG_ENDIAN 1 -+# endif -+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) -+# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) -+# error "unexpected configuration - check your compiler defines" -+# elif defined(__BIG_ENDIAN) -+# define LZO_ABI_BIG_ENDIAN 1 -+# else -+# define LZO_ABI_LITTLE_ENDIAN 1 -+# endif -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) -+# define LZO_ABI_LITTLE_ENDIAN 1 - #endif --#if !defined(__lzo_cdecl_va) --# define __lzo_cdecl_va __lzo_cdecl - #endif --#if !(LZO_CFG_NO_WINDOWS_H) --#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) --# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) --# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) --# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) -+#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) -+# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ABI_BIG_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "be" -+#elif (LZO_ABI_LITTLE_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "le" -+#elif (LZO_ABI_NEUTRAL_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "neutral" -+#endif -+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -+# define LZO_ABI_I8LP16 1 -+# define LZO_INFO_ABI_PM "i8lp16" -+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -+# define LZO_ABI_ILP16 1 -+# define LZO_INFO_ABI_PM "ilp16" -+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -+# define LZO_ABI_LP32 1 -+# define LZO_INFO_ABI_PM "lp32" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -+# define LZO_ABI_ILP32 1 -+# define LZO_INFO_ABI_PM "ilp32" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) -+# define LZO_ABI_LLP64 1 -+# define LZO_INFO_ABI_PM "llp64" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -+# define LZO_ABI_LP64 1 -+# define LZO_INFO_ABI_PM "lp64" -+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -+# define LZO_ABI_ILP64 1 -+# define LZO_INFO_ABI_PM "ilp64" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) -+# define LZO_ABI_IP32L64 1 -+# define LZO_INFO_ABI_PM "ip32l64" -+#endif -+#if 0 -+#elif !defined(__LZO_LIBC_OVERRIDE) -+#if (LZO_LIBC_NAKED) -+# define LZO_INFO_LIBC "naked" -+#elif (LZO_LIBC_FREESTANDING) -+# define LZO_INFO_LIBC "freestanding" -+#elif (LZO_LIBC_MOSTLY_FREESTANDING) -+# define LZO_INFO_LIBC "mfreestanding" -+#elif (LZO_LIBC_ISOC90) -+# define LZO_INFO_LIBC "isoc90" -+#elif (LZO_LIBC_ISOC99) -+# define LZO_INFO_LIBC "isoc99" -+#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) -+# define LZO_LIBC_ISOC90 1 -+# define LZO_INFO_LIBC "isoc90" -+#elif defined(__dietlibc__) -+# define LZO_LIBC_DIETLIBC 1 -+# define LZO_INFO_LIBC "dietlibc" -+#elif defined(_NEWLIB_VERSION) -+# define LZO_LIBC_NEWLIB 1 -+# define LZO_INFO_LIBC "newlib" -+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) -+# if defined(__UCLIBC_SUBLEVEL__) -+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) - # else --# define LZO_HAVE_WINDOWS_H 1 -+# define LZO_LIBC_UCLIBC 0x00090bL - # endif -+# define LZO_INFO_LIBC "uc" "libc" -+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) -+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) -+# define LZO_INFO_LIBC "glibc" -+#elif (LZO_CC_MWERKS) && defined(__MSL__) -+# define LZO_LIBC_MSL __MSL__ -+# define LZO_INFO_LIBC "msl" -+#elif 1 && defined(__IAR_SYSTEMS_ICC__) -+# define LZO_LIBC_ISOC90 1 -+# define LZO_INFO_LIBC "isoc90" -+#else -+# define LZO_LIBC_DEFAULT 1 -+# define LZO_INFO_LIBC "default" -+#endif -+#endif -+#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -+# define LZO_ASM_SYNTAX_MSC 1 -+#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -+#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) -+#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -+# define LZO_ASM_SYNTAX_GNUC 1 -+#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -+# define LZO_ASM_SYNTAX_GNUC 1 -+#elif (LZO_CC_GNUC) -+# define LZO_ASM_SYNTAX_GNUC 1 -+#endif -+#if (LZO_ASM_SYNTAX_GNUC) -+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) -+# define __LZO_ASM_CLOBBER "ax" -+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ -+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -+#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) -+# define __LZO_ASM_CLOBBER "memory" -+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" -+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -+#else -+# define __LZO_ASM_CLOBBER "cc", "memory" -+# define __LZO_ASM_CLOBBER_LIST_CC : "cc" -+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" -+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ - #endif - #endif - #if (LZO_ARCH_ALPHA) --# define LZO_OPT_AVOID_UINT_INDEX 1 --# define LZO_OPT_AVOID_SHORT 1 --# define LZO_OPT_AVOID_USHORT 1 -+# define LZO_OPT_AVOID_UINT_INDEX 1 - #elif (LZO_ARCH_AMD64) --# define LZO_OPT_AVOID_INT_INDEX 1 --# define LZO_OPT_AVOID_UINT_INDEX 1 --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 --# define LZO_OPT_UNALIGNED64 1 --#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) -+# define LZO_OPT_AVOID_INT_INDEX 1 -+# define LZO_OPT_AVOID_UINT_INDEX 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED64 -+# define LZO_OPT_UNALIGNED64 1 -+# endif - #elif (LZO_ARCH_ARM) --# define LZO_OPT_AVOID_SHORT 1 --# define LZO_OPT_AVOID_USHORT 1 -+# if defined(__ARM_FEATURE_UNALIGNED) -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7) -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M) -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# endif -+#elif (LZO_ARCH_ARM64) -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED64 -+# define LZO_OPT_UNALIGNED64 1 -+# endif - #elif (LZO_ARCH_CRIS) --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif - #elif (LZO_ARCH_I386) --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif - #elif (LZO_ARCH_IA64) --# define LZO_OPT_AVOID_INT_INDEX 1 --# define LZO_OPT_AVOID_UINT_INDEX 1 --# define LZO_OPT_PREFER_POSTINC 1 -+# define LZO_OPT_AVOID_INT_INDEX 1 -+# define LZO_OPT_AVOID_UINT_INDEX 1 -+# define LZO_OPT_PREFER_POSTINC 1 - #elif (LZO_ARCH_M68K) --# define LZO_OPT_PREFER_POSTINC 1 --# define LZO_OPT_PREFER_PREDEC 1 -+# define LZO_OPT_PREFER_POSTINC 1 -+# define LZO_OPT_PREFER_PREDEC 1 - # if defined(__mc68020__) && !defined(__mcoldfire__) --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif - # endif - #elif (LZO_ARCH_MIPS) --# define LZO_OPT_AVOID_UINT_INDEX 1 -+# define LZO_OPT_AVOID_UINT_INDEX 1 - #elif (LZO_ARCH_POWERPC) --# define LZO_OPT_PREFER_PREINC 1 --# define LZO_OPT_PREFER_PREDEC 1 -+# define LZO_OPT_PREFER_PREINC 1 -+# define LZO_OPT_PREFER_PREDEC 1 - # if (LZO_ABI_BIG_ENDIAN) --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# if (LZO_WORDSIZE == 8) -+# ifndef LZO_OPT_UNALIGNED64 -+# define LZO_OPT_UNALIGNED64 1 -+# endif -+# endif - # endif - #elif (LZO_ARCH_S390) --# define LZO_OPT_UNALIGNED16 1 --# define LZO_OPT_UNALIGNED32 1 --# if (LZO_SIZEOF_SIZE_T == 8) --# define LZO_OPT_UNALIGNED64 1 -+# ifndef LZO_OPT_UNALIGNED16 -+# define LZO_OPT_UNALIGNED16 1 -+# endif -+# ifndef LZO_OPT_UNALIGNED32 -+# define LZO_OPT_UNALIGNED32 1 -+# endif -+# if (LZO_WORDSIZE == 8) -+# ifndef LZO_OPT_UNALIGNED64 -+# define LZO_OPT_UNALIGNED64 1 -+# endif - # endif - #elif (LZO_ARCH_SH) --# define LZO_OPT_PREFER_POSTINC 1 --# define LZO_OPT_PREFER_PREDEC 1 -+# define LZO_OPT_PREFER_POSTINC 1 -+# define LZO_OPT_PREFER_PREDEC 1 - #endif - #ifndef LZO_CFG_NO_INLINE_ASM --#if (LZO_CC_LLVM) -+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) -+# define LZO_CFG_NO_INLINE_ASM 1 -+#elif (LZO_CC_LLVM) - # define LZO_CFG_NO_INLINE_ASM 1 - #endif - #endif -+#if (LZO_CFG_NO_INLINE_ASM) -+# undef LZO_ASM_SYNTAX_MSC -+# undef LZO_ASM_SYNTAX_GNUC -+# undef __LZO_ASM_CLOBBER -+# undef __LZO_ASM_CLOBBER_LIST_CC -+# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY -+# undef __LZO_ASM_CLOBBER_LIST_EMPTY -+#endif - #ifndef LZO_CFG_NO_UNALIGNED - #if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) - # define LZO_CFG_NO_UNALIGNED 1 -@@ -1784,25 +2574,6 @@ extern "C" { - # undef LZO_OPT_UNALIGNED32 - # undef LZO_OPT_UNALIGNED64 - #endif --#if (LZO_CFG_NO_INLINE_ASM) --#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) --# define LZO_ASM_SYNTAX_MSC 1 --#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) --#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) --#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) --# define LZO_ASM_SYNTAX_GNUC 1 --#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) --# define LZO_ASM_SYNTAX_GNUC 1 --#endif --#if (LZO_ASM_SYNTAX_GNUC) --#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) --# define __LZO_ASM_CLOBBER "ax" --#elif (LZO_CC_INTELC) --# define __LZO_ASM_CLOBBER "memory" --#else --# define __LZO_ASM_CLOBBER "cc", "memory" --#endif --#endif - #if defined(__LZO_INFOSTR_MM) - #elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) - # define __LZO_INFOSTR_MM "" -@@ -1846,7 +2617,382 @@ extern "C" { - #define LZO_INFO_STRING \ - LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ - " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER -+#if !(LZO_CFG_SKIP_LZO_TYPES) -+#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) -+# error "missing defines for sizes" -+#endif -+#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) -+# error "missing defines for sizes" -+#endif -+#if !defined(lzo_llong_t) -+#if (LZO_SIZEOF_LONG_LONG+0 > 0) -+__lzo_gnuc_extension__ typedef long long lzo_llong_t__; -+__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; -+# define lzo_llong_t lzo_llong_t__ -+# define lzo_ullong_t lzo_ullong_t__ -+#endif -+#endif -+#if !defined(lzo_int16e_t) -+#if (LZO_SIZEOF_LONG == 2) -+# define lzo_int16e_t long -+# define lzo_uint16e_t unsigned long -+#elif (LZO_SIZEOF_INT == 2) -+# define lzo_int16e_t int -+# define lzo_uint16e_t unsigned int -+#elif (LZO_SIZEOF_SHORT == 2) -+# define lzo_int16e_t short int -+# define lzo_uint16e_t unsigned short int -+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) -+ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); -+ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); -+# define lzo_int16e_t lzo_int16e_hi_t__ -+# define lzo_uint16e_t lzo_uint16e_hi_t__ -+#elif (LZO_SIZEOF___INT16 == 2) -+# define lzo_int16e_t __int16 -+# define lzo_uint16e_t unsigned __int16 -+#else -+#endif -+#endif -+#if defined(lzo_int16e_t) -+# define LZO_SIZEOF_LZO_INT16E_T 2 -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) -+#endif -+#if !defined(lzo_int32e_t) -+#if (LZO_SIZEOF_LONG == 4) -+# define lzo_int32e_t long int -+# define lzo_uint32e_t unsigned long int -+#elif (LZO_SIZEOF_INT == 4) -+# define lzo_int32e_t int -+# define lzo_uint32e_t unsigned int -+#elif (LZO_SIZEOF_SHORT == 4) -+# define lzo_int32e_t short int -+# define lzo_uint32e_t unsigned short int -+#elif (LZO_SIZEOF_LONG_LONG == 4) -+# define lzo_int32e_t lzo_llong_t -+# define lzo_uint32e_t lzo_ullong_t -+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) -+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); -+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -+# define lzo_int32e_t lzo_int32e_si_t__ -+# define lzo_uint32e_t lzo_uint32e_si_t__ -+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) -+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); -+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -+# define lzo_int32e_t lzo_int32e_si_t__ -+# define lzo_uint32e_t lzo_uint32e_si_t__ -+# define LZO_INT32_C(c) (c##LL) -+# define LZO_UINT32_C(c) (c##ULL) -+#elif (LZO_SIZEOF___INT32 == 4) -+# define lzo_int32e_t __int32 -+# define lzo_uint32e_t unsigned __int32 -+#else -+#endif -+#endif -+#if defined(lzo_int32e_t) -+# define LZO_SIZEOF_LZO_INT32E_T 4 -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) -+#endif -+#if !defined(lzo_int64e_t) -+#if (LZO_SIZEOF___INT64 == 8) -+# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) -+# define LZO_CFG_TYPE_PREFER___INT64 1 -+# endif -+#endif -+#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -+# define lzo_int64e_t int -+# define lzo_uint64e_t unsigned int -+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT -+#elif (LZO_SIZEOF_LONG == 8) -+# define lzo_int64e_t long int -+# define lzo_uint64e_t unsigned long int -+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG -+#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) -+# define lzo_int64e_t lzo_llong_t -+# define lzo_uint64e_t lzo_ullong_t -+# if (LZO_CC_BORLANDC) -+# define LZO_INT64_C(c) ((c) + 0ll) -+# define LZO_UINT64_C(c) ((c) + 0ull) -+# elif 0 -+# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) -+# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) -+# else -+# define LZO_INT64_C(c) (c##LL) -+# define LZO_UINT64_C(c) (c##ULL) -+# endif -+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG -+#elif (LZO_SIZEOF___INT64 == 8) -+# define lzo_int64e_t __int64 -+# define lzo_uint64e_t unsigned __int64 -+# if (LZO_CC_BORLANDC) -+# define LZO_INT64_C(c) ((c) + 0i64) -+# define LZO_UINT64_C(c) ((c) + 0ui64) -+# else -+# define LZO_INT64_C(c) (c##i64) -+# define LZO_UINT64_C(c) (c##ui64) -+# endif -+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64 -+#else -+#endif -+#endif -+#if defined(lzo_int64e_t) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) -+#endif -+#if !defined(lzo_int32l_t) -+#if defined(lzo_int32e_t) -+# define lzo_int32l_t lzo_int32e_t -+# define lzo_uint32l_t lzo_uint32e_t -+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T -+#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -+# define lzo_int32l_t int -+# define lzo_uint32l_t unsigned int -+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT -+#elif (LZO_SIZEOF_LONG >= 4) -+# define lzo_int32l_t long int -+# define lzo_uint32l_t unsigned long int -+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG -+#else -+# error "lzo_int32l_t" -+#endif -+#endif -+#if 1 -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) -+#endif -+#if !defined(lzo_int64l_t) -+#if defined(lzo_int64e_t) -+# define lzo_int64l_t lzo_int64e_t -+# define lzo_uint64l_t lzo_uint64e_t -+# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T -+#else -+#endif -+#endif -+#if defined(lzo_int64l_t) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) -+#endif -+#if !defined(lzo_int32f_t) -+#if (LZO_SIZEOF_SIZE_T >= 8) -+# define lzo_int32f_t lzo_int64l_t -+# define lzo_uint32f_t lzo_uint64l_t -+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T -+#else -+# define lzo_int32f_t lzo_int32l_t -+# define lzo_uint32f_t lzo_uint32l_t -+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T -+#endif -+#endif -+#if 1 -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) -+#endif -+#if !defined(lzo_int64f_t) -+#if defined(lzo_int64l_t) -+# define lzo_int64f_t lzo_int64l_t -+# define lzo_uint64f_t lzo_uint64l_t -+# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T -+#else -+#endif -+#endif -+#if defined(lzo_int64f_t) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) -+#endif -+#if !defined(lzo_intptr_t) -+#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) -+# define __LZO_INTPTR_T_IS_POINTER 1 -+ typedef char* lzo_intptr_t; -+ typedef char* lzo_uintptr_t; -+# define lzo_intptr_t lzo_intptr_t -+# define lzo_uintptr_t lzo_uintptr_t -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P -+#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) -+ typedef __w64 int lzo_intptr_t; -+ typedef __w64 unsigned int lzo_uintptr_t; -+# define lzo_intptr_t lzo_intptr_t -+# define lzo_uintptr_t lzo_uintptr_t -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -+#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) -+# define lzo_intptr_t short -+# define lzo_uintptr_t unsigned short -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT -+#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -+# define lzo_intptr_t int -+# define lzo_uintptr_t unsigned int -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -+#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) -+# define lzo_intptr_t long -+# define lzo_uintptr_t unsigned long -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG -+#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) -+# define lzo_intptr_t lzo_int64l_t -+# define lzo_uintptr_t lzo_uint64l_t -+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T -+#else -+# error "lzo_intptr_t" -+#endif -+#endif -+#if 1 -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) -+#endif -+#if !defined(lzo_word_t) -+#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) -+#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) -+# define lzo_word_t lzo_uintptr_t -+# define lzo_sword_t lzo_intptr_t -+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T -+#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) -+# define lzo_word_t unsigned long -+# define lzo_sword_t long -+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG -+#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) -+# define lzo_word_t unsigned int -+# define lzo_sword_t int -+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT -+#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) -+# define lzo_word_t unsigned short -+# define lzo_sword_t short -+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT -+#elif (LZO_WORDSIZE == 1) -+# define lzo_word_t unsigned char -+# define lzo_sword_t signed char -+# define LZO_SIZEOF_LZO_WORD_T 1 -+#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) -+# define lzo_word_t lzo_uint64l_t -+# define lzo_sword_t lzo_int64l_t -+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T -+#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) -+#if 0 -+ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); -+ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); -+# define lzo_word_t lzo_word_t -+# define lzo_sword_t lzo_sword_t -+# define LZO_SIZEOF_LZO_WORD_T 16 -+#endif -+#else -+# error "lzo_word_t" -+#endif -+#endif -+#endif -+#if 1 && defined(lzo_word_t) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) -+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) -+#endif -+#if 1 -+#define lzo_int8_t signed char -+#define lzo_uint8_t unsigned char -+#define LZO_SIZEOF_LZO_INT8_T 1 -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) -+#endif -+#if defined(lzo_int16e_t) -+#define lzo_int16_t lzo_int16e_t -+#define lzo_uint16_t lzo_uint16e_t -+#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) -+#endif -+#if defined(lzo_int32e_t) -+#define lzo_int32_t lzo_int32e_t -+#define lzo_uint32_t lzo_uint32e_t -+#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) -+#endif -+#if defined(lzo_int64e_t) -+#define lzo_int64_t lzo_int64e_t -+#define lzo_uint64_t lzo_uint64e_t -+#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) -+#endif -+#if 1 -+#define lzo_int_least32_t lzo_int32l_t -+#define lzo_uint_least32_t lzo_uint32l_t -+#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) -+#endif -+#if defined(lzo_int64l_t) -+#define lzo_int_least64_t lzo_int64l_t -+#define lzo_uint_least64_t lzo_uint64l_t -+#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) -+#endif -+#if 1 -+#define lzo_int_fast32_t lzo_int32f_t -+#define lzo_uint_fast32_t lzo_uint32f_t -+#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) -+#endif -+#if defined(lzo_int64f_t) -+#define lzo_int_fast64_t lzo_int64f_t -+#define lzo_uint_fast64_t lzo_uint64f_t -+#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) -+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) -+#endif -+#if !defined(LZO_INT16_C) -+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) -+# define LZO_INT16_C(c) ((c) + 0) -+# define LZO_UINT16_C(c) ((c) + 0U) -+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) -+# define LZO_INT16_C(c) ((c) + 0L) -+# define LZO_UINT16_C(c) ((c) + 0UL) -+# elif (LZO_SIZEOF_INT >= 2) -+# define LZO_INT16_C(c) (c) -+# define LZO_UINT16_C(c) (c##U) -+# elif (LZO_SIZEOF_LONG >= 2) -+# define LZO_INT16_C(c) (c##L) -+# define LZO_UINT16_C(c) (c##UL) -+# else -+# error "LZO_INT16_C" -+# endif -+#endif -+#if !defined(LZO_INT32_C) -+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) -+# define LZO_INT32_C(c) ((c) + 0) -+# define LZO_UINT32_C(c) ((c) + 0U) -+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) -+# define LZO_INT32_C(c) ((c) + 0L) -+# define LZO_UINT32_C(c) ((c) + 0UL) -+# elif (LZO_SIZEOF_INT >= 4) -+# define LZO_INT32_C(c) (c) -+# define LZO_UINT32_C(c) (c##U) -+# elif (LZO_SIZEOF_LONG >= 4) -+# define LZO_INT32_C(c) (c##L) -+# define LZO_UINT32_C(c) (c##UL) -+# elif (LZO_SIZEOF_LONG_LONG >= 4) -+# define LZO_INT32_C(c) (c##LL) -+# define LZO_UINT32_C(c) (c##ULL) -+# else -+# error "LZO_INT32_C" -+# endif -+#endif -+#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) -+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) -+# define LZO_INT64_C(c) ((c) + 0) -+# define LZO_UINT64_C(c) ((c) + 0U) -+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) -+# define LZO_INT64_C(c) ((c) + 0L) -+# define LZO_UINT64_C(c) ((c) + 0UL) -+# elif (LZO_SIZEOF_INT >= 8) -+# define LZO_INT64_C(c) (c) -+# define LZO_UINT64_C(c) (c##U) -+# elif (LZO_SIZEOF_LONG >= 8) -+# define LZO_INT64_C(c) (c##L) -+# define LZO_UINT64_C(c) (c##UL) -+# else -+# error "LZO_INT64_C" -+# endif -+#endif -+#endif - - #endif /* already included */ - --/* vim:set ts=4 et: */ -+/* vim:set ts=4 sw=4 et: */ diff --git a/grub-core/lib/minilzo/minilzo.c b/grub-core/lib/minilzo/minilzo.c -index 25a1f68b3..ab2be5f4f 100644 +index 25a1f68b3b5..ab2be5f4fd0 100644 --- a/grub-core/lib/minilzo/minilzo.c +++ b/grub-core/lib/minilzo/minilzo.c @@ -2,22 +2,7 @@ @@ -3415,10 +68,10 @@ index 25a1f68b3..ab2be5f4f 100644 # pragma warning(disable: 193) -#endif -#if defined(__KEIL__) && defined(__C166__) --# pragma warning disable = 322 --#elif 0 && defined(__C251__) +#elif defined(__KEIL__) && defined(__C166__) # pragma warning disable = 322 +-#elif 0 && defined(__C251__) +-# pragma warning disable = 322 -#endif -#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) -# if (_MSC_VER >= 1300) @@ -3902,7 +555,9 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_ARCH_X64 1 +#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_AMD64 1 -+#endif + #endif +-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086) +-# error "this should not happen" +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) +# define LZO_ARCH_AARCH64 1 +#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) @@ -3930,9 +585,7 @@ index 25a1f68b3..ab2be5f4f 100644 +#endif +#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB) +# error "unexpected configuration - check your compiler defines" - #endif --#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086) --# error "this should not happen" ++#endif +#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) +# error "unexpected configuration - check your compiler defines" +#endif @@ -3961,8 +614,9 @@ index 25a1f68b3..ab2be5f4f 100644 # if (ULONG_MAX != LZO_0xffffffffL) -# error "this should not happen" +# error "unexpected configuration - check your compiler defines" -+# endif -+#endif + # endif + #endif +-#if !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if !defined(LZO_TARGET_FEATURE_SSE2) +# if defined(__SSE2__) @@ -4025,9 +679,8 @@ index 25a1f68b3..ab2be5f4f 100644 +# if 1 +# define LZO_TARGET_FEATURE_NEON 1 +# endif - # endif - #endif --#if !defined(__LZO_MM_OVERRIDE) ++# endif ++#endif +#if 0 +#elif !defined(__LZO_MM_OVERRIDE) #if (LZO_ARCH_I086) @@ -4105,12 +758,10 @@ index 25a1f68b3..ab2be5f4f 100644 #endif #elif (LZO_ARCH_CRAY_PVP) # define LZO_MM_PVP 1 -@@ -1030,462 +1227,270 @@ extern "C" { +@@ -1030,35 +1227,818 @@ extern "C" { # error "unknown memory model" #endif #endif --#if defined(SIZEOF_SHORT) --# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ @@ -4119,17 +770,11 @@ index 25a1f68b3..ab2be5f4f 100644 +#elif (LZO_CC_IBMC >= 600) +# define __lzo_gnuc_extension__ __extension__ +#else - #endif --#if defined(SIZEOF_INT) --# define LZO_SIZEOF_INT (SIZEOF_INT) - #endif --#if defined(SIZEOF_LONG) --# define LZO_SIZEOF_LONG (SIZEOF_LONG) ++#endif ++#endif +#if !defined(__lzo_gnuc_extension__) +# define __lzo_gnuc_extension__ /*empty*/ - #endif --#if defined(SIZEOF_LONG_LONG) --# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) ++#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 @@ -4138,85 +783,35 @@ index 25a1f68b3..ab2be5f4f 100644 +# else +# define LZO_CFG_USE_NEW_STYLE_CASTS 1 +# endif - #endif --#if defined(SIZEOF___INT16) --# define LZO_SIZEOF___INT16 (SIZEOF___INT16) ++#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 - #endif --#if defined(SIZEOF___INT32) --# define LZO_SIZEOF___INT32 (SIZEOF___INT32) ++#endif +#if !defined(__cplusplus) +# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# undef LZO_CFG_USE_NEW_STYLE_CASTS +# endif +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 - #endif --#if defined(SIZEOF___INT64) --# define LZO_SIZEOF___INT64 (SIZEOF___INT64) ++#endif +#if !defined(LZO_REINTERPRET_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) +# endif - #endif --#if defined(SIZEOF_VOID_P) --# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) ++#endif +#if !defined(LZO_REINTERPRET_CAST) +# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) - #endif --#if defined(SIZEOF_SIZE_T) --# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) ++#endif +#if !defined(LZO_STATIC_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_STATIC_CAST(t,e) (static_cast (e)) +# endif - #endif --#if defined(SIZEOF_PTRDIFF_T) --# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) ++#endif +#if !defined(LZO_STATIC_CAST) +# define LZO_STATIC_CAST(t,e) ((t) (e)) - #endif --#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) --#if !defined(LZO_SIZEOF_SHORT) --# if (LZO_ARCH_CRAY_PVP) --# define LZO_SIZEOF_SHORT 8 --# elif (USHRT_MAX == LZO_0xffffL) --# define LZO_SIZEOF_SHORT 2 --# elif (__LZO_LSR(USHRT_MAX,7) == 1) --# define LZO_SIZEOF_SHORT 1 --# elif (__LZO_LSR(USHRT_MAX,15) == 1) --# define LZO_SIZEOF_SHORT 2 --# elif (__LZO_LSR(USHRT_MAX,31) == 1) --# define LZO_SIZEOF_SHORT 4 --# elif (__LZO_LSR(USHRT_MAX,63) == 1) --# define LZO_SIZEOF_SHORT 8 --# elif (__LZO_LSR(USHRT_MAX,127) == 1) --# define LZO_SIZEOF_SHORT 16 --# else --# error "LZO_SIZEOF_SHORT" --# endif ++#endif +#if !defined(LZO_STATIC_CAST2) +# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) - #endif --#if !defined(LZO_SIZEOF_INT) --# if (LZO_ARCH_CRAY_PVP) --# define LZO_SIZEOF_INT 8 --# elif (UINT_MAX == LZO_0xffffL) --# define LZO_SIZEOF_INT 2 --# elif (UINT_MAX == LZO_0xffffffffL) --# define LZO_SIZEOF_INT 4 --# elif (__LZO_LSR(UINT_MAX,7) == 1) --# define LZO_SIZEOF_INT 1 --# elif (__LZO_LSR(UINT_MAX,15) == 1) --# define LZO_SIZEOF_INT 2 --# elif (__LZO_LSR(UINT_MAX,31) == 1) --# define LZO_SIZEOF_INT 4 --# elif (__LZO_LSR(UINT_MAX,63) == 1) --# define LZO_SIZEOF_INT 8 --# elif (__LZO_LSR(UINT_MAX,127) == 1) --# define LZO_SIZEOF_INT 16 --# else --# error "LZO_SIZEOF_INT" ++#endif +#if !defined(LZO_UNCONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_CAST(t,e) (const_cast (e)) @@ -4224,23 +819,8 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_UNCONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) - # endif - #endif --#if !defined(LZO_SIZEOF_LONG) --# if (ULONG_MAX == LZO_0xffffffffL) --# define LZO_SIZEOF_LONG 4 --# elif (__LZO_LSR(ULONG_MAX,7) == 1) --# define LZO_SIZEOF_LONG 1 --# elif (__LZO_LSR(ULONG_MAX,15) == 1) --# define LZO_SIZEOF_LONG 2 --# elif (__LZO_LSR(ULONG_MAX,31) == 1) --# define LZO_SIZEOF_LONG 4 --# elif (__LZO_LSR(ULONG_MAX,63) == 1) --# define LZO_SIZEOF_LONG 8 --# elif (__LZO_LSR(ULONG_MAX,127) == 1) --# define LZO_SIZEOF_LONG 16 --# else --# error "LZO_SIZEOF_LONG" ++# endif ++#endif +#if !defined(LZO_UNCONST_CAST) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) +#endif @@ -4251,18 +831,8 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) - # endif - #endif --#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) --#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) --# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) --# if (LZO_CC_GNUC >= 0x030300ul) --# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) --# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG --# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) --# define LZO_SIZEOF_LONG_LONG 4 --# endif --# endif ++# endif ++#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) +#endif @@ -4273,47 +843,11 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) - # endif - #endif ++# endif ++#endif +#if !defined(LZO_UNVOLATILE_CAST) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) - #endif --#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) --#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) --#if (LZO_ARCH_I086 && LZO_CC_DMC) --#elif (LZO_CC_CILLY) && defined(__GNUC__) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_SIZEOF_LONG_LONG 8 --#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_OS_WIN64 || defined(_WIN64)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) --# define LZO_SIZEOF___INT64 8 --#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) --# define LZO_SIZEOF___INT64 8 --#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) --# define LZO_SIZEOF_LONG_LONG 8 --#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) --#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) --# define LZO_SIZEOF_LONG_LONG 8 ++#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) @@ -4322,40 +856,26 @@ index 25a1f68b3..ab2be5f4f 100644 +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif - #endif ++#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) - #endif ++#endif +#if !defined(LZO_PCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_PCAST(t,e) ((t) (e)) +# endif - #endif --#if defined(__cplusplus) && (LZO_CC_GNUC) --# if (LZO_CC_GNUC < 0x020800ul) --# undef LZO_SIZEOF_LONG_LONG ++#endif +#if !defined(LZO_PCAST) +# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) +#endif +#if !defined(LZO_CCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_CCAST(t,e) ((t) (e)) - # endif - #endif --#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) --# undef LZO_SIZEOF_LONG_LONG ++# endif ++#endif +#if !defined(LZO_CCAST) +# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) - #endif --#if !defined(LZO_SIZEOF_VOID_P) --#if (LZO_ARCH_I086) --# define __LZO_WORDSIZE 2 --# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) --# define LZO_SIZEOF_VOID_P 2 --# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) --# define LZO_SIZEOF_VOID_P 4 --# else --# error "LZO_MM" ++#endif +#if !defined(LZO_ICONV) +# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) +#endif @@ -4370,67 +890,11 @@ index 25a1f68b3..ab2be5f4f 100644 +# define __lzo_cte(e) ((void)0,(e)) +# elif 1 +# define __lzo_cte(e) ((void)0,(e)) - # endif --#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) --# define __LZO_WORDSIZE 1 --# define LZO_SIZEOF_VOID_P 2 --#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) --# define LZO_SIZEOF_VOID_P 2 --#elif (LZO_ARCH_H8300) --# if defined(__NORMAL_MODE__) --# define __LZO_WORDSIZE 4 --# define LZO_SIZEOF_VOID_P 2 --# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) --# define __LZO_WORDSIZE 4 --# define LZO_SIZEOF_VOID_P 4 --# else --# define __LZO_WORDSIZE 2 --# define LZO_SIZEOF_VOID_P 2 --# endif --# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT --# endif --#elif (LZO_ARCH_M16C) --# define __LZO_WORDSIZE 2 --# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) --# define LZO_SIZEOF_VOID_P 4 --# else --# define LZO_SIZEOF_VOID_P 2 --# endif --#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) --# define __LZO_WORDSIZE 8 --# define LZO_SIZEOF_VOID_P 4 --#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) --# define __LZO_WORDSIZE 8 --# define LZO_SIZEOF_VOID_P 8 --#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) --# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (LZO_OS_OS400 || defined(__OS400__)) --# define __LZO_WORDSIZE LZO_SIZEOF_LONG --# define LZO_SIZEOF_VOID_P 16 --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) --# define LZO_SIZEOF_VOID_P 8 --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG --#elif (LZO_ARCH_SPU) --# if 0 --# define __LZO_WORDSIZE 16 --# endif --# define LZO_SIZEOF_VOID_P 4 --#else --# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG - #endif ++# endif ++#endif +#if !defined(__lzo_cte) +# define __lzo_cte(e) (e) - #endif --#if !defined(LZO_WORDSIZE) --# if defined(__LZO_WORDSIZE) --# define LZO_WORDSIZE __LZO_WORDSIZE ++#endif +#if !defined(LZO_BLOCK_BEGIN) +# define LZO_BLOCK_BEGIN do { +# define LZO_BLOCK_END } while __lzo_cte(0) @@ -4452,28 +916,10 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) - # else --# define LZO_WORDSIZE LZO_SIZEOF_VOID_P ++# else +# define LZO_UNUSED(var) ((void) &var) - # endif - #endif --#if !defined(LZO_SIZEOF_SIZE_T) --#if (LZO_ARCH_I086 || LZO_ARCH_M16C) --# define LZO_SIZEOF_SIZE_T 2 --#else --# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P --#endif --#endif --#if !defined(LZO_SIZEOF_PTRDIFF_T) --#if (LZO_ARCH_I086) --# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P --# elif (LZO_MM_COMPACT || LZO_MM_LARGE) --# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) --# define LZO_SIZEOF_PTRDIFF_T 4 --# else --# define LZO_SIZEOF_PTRDIFF_T 2 --# endif ++# endif ++#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) @@ -4487,320 +933,131 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];} - # else --# error "LZO_MM" ++# else +# define LZO_UNUSED_FUNC(func) ((void) func) - # endif --#else --# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T --#endif - #endif --#if (LZO_ABI_NEUTRAL_ENDIAN) --# undef LZO_ABI_BIG_ENDIAN --# undef LZO_ABI_LITTLE_ENDIAN --#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) --#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) --# define LZO_ABI_BIG_ENDIAN 1 --#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) --# if (__LITTLE_ENDIAN__ == 1) --# define LZO_ABI_LITTLE_ENDIAN 1 ++# endif ++#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_CLANG >= 0x020800ul) +# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) +# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l - # else --# define LZO_ABI_BIG_ENDIAN 1 ++# else +# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l - # endif --#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) --# define LZO_ABI_BIG_ENDIAN 1 --#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) --# define LZO_ABI_LITTLE_ENDIAN 1 --#endif --#endif --#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) --# error "this should not happen" --#endif --#if (LZO_ABI_BIG_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "be" --#elif (LZO_ABI_LITTLE_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "le" --#elif (LZO_ABI_NEUTRAL_ENDIAN) --# define LZO_INFO_ABI_ENDIAN "neutral" --#endif --#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) --# define LZO_ABI_I8LP16 1 --# define LZO_INFO_ABI_PM "i8lp16" --#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) --# define LZO_ABI_ILP16 1 --# define LZO_INFO_ABI_PM "ilp16" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) --# define LZO_ABI_ILP32 1 --# define LZO_INFO_ABI_PM "ilp32" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) --# define LZO_ABI_LLP64 1 --# define LZO_INFO_ABI_PM "llp64" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) --# define LZO_ABI_LP64 1 --# define LZO_INFO_ABI_PM "lp64" --#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) --# define LZO_ABI_ILP64 1 --# define LZO_INFO_ABI_PM "ilp64" --#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) --# define LZO_ABI_IP32L64 1 --# define LZO_INFO_ABI_PM "ip32l64" - #endif --#if !defined(__LZO_LIBC_OVERRIDE) --#if (LZO_LIBC_NAKED) --# define LZO_INFO_LIBC "naked" --#elif (LZO_LIBC_FREESTANDING) --# define LZO_INFO_LIBC "freestanding" --#elif (LZO_LIBC_MOSTLY_FREESTANDING) --# define LZO_INFO_LIBC "mfreestanding" --#elif (LZO_LIBC_ISOC90) --# define LZO_INFO_LIBC "isoc90" --#elif (LZO_LIBC_ISOC99) --# define LZO_INFO_LIBC "isoc99" --#elif defined(__dietlibc__) --# define LZO_LIBC_DIETLIBC 1 --# define LZO_INFO_LIBC "dietlibc" --#elif defined(_NEWLIB_VERSION) --# define LZO_LIBC_NEWLIB 1 --# define LZO_INFO_LIBC "newlib" --#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) --# if defined(__UCLIBC_SUBLEVEL__) --# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) ++# endif ++#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var - # else --# define LZO_LIBC_UCLIBC 0x00090bL ++# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init - # endif --# define LZO_INFO_LIBC "uclibc" --#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) --# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) --# define LZO_INFO_LIBC "glibc" --#elif (LZO_CC_MWERKS) && defined(__MSL__) --# define LZO_LIBC_MSL __MSL__ --# define LZO_INFO_LIBC "msl" --#elif 1 && defined(__IAR_SYSTEMS_ICC__) --# define LZO_LIBC_ISOC90 1 --# define LZO_INFO_LIBC "isoc90" --#else --# define LZO_LIBC_DEFAULT 1 --# define LZO_INFO_LIBC "default" --#endif --#endif --#if !defined(__lzo_gnuc_extension__) --#if (LZO_CC_GNUC >= 0x020800ul) --# define __lzo_gnuc_extension__ __extension__ --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_gnuc_extension__ __extension__ --#else --# define __lzo_gnuc_extension__ /*empty*/ --#endif --#endif --#if !defined(__lzo_ua_volatile) --# define __lzo_ua_volatile volatile --#endif --#if !defined(__lzo_alignof) --#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) --# define __lzo_alignof(e) __alignof__(e) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) --# define __lzo_alignof(e) __alignof__(e) --#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) --# define __lzo_alignof(e) __alignof(e) --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) --# define __lzo_alignof(e) __alignof__(e) --#endif --#endif --#if defined(__lzo_alignof) --# define __lzo_HAVE_alignof 1 --#endif --#if !defined(__lzo_constructor) --#if (LZO_CC_GNUC >= 0x030400ul) --# define __lzo_constructor __attribute__((__constructor__,__used__)) --#elif (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_constructor __attribute__((__constructor__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_constructor __attribute__((__constructor__)) --#endif --#endif --#if defined(__lzo_constructor) --# define __lzo_HAVE_constructor 1 --#endif --#if !defined(__lzo_destructor) --#if (LZO_CC_GNUC >= 0x030400ul) --# define __lzo_destructor __attribute__((__destructor__,__used__)) --#elif (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_destructor __attribute__((__destructor__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_destructor __attribute__((__destructor__)) --#endif --#endif --#if defined(__lzo_destructor) --# define __lzo_HAVE_destructor 1 --#endif --#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) --# error "this should not happen" - #endif - #if !defined(__lzo_inline) - #if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) - #elif defined(__cplusplus) - # define __lzo_inline inline ++# endif ++#endif ++#if !defined(__lzo_inline) ++#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) ++#elif defined(__cplusplus) ++# define __lzo_inline inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_inline inline - #elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) - # define __lzo_inline __inline --#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) ++#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) ++# define __lzo_inline __inline +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) - # define __lzo_inline __inline__ - #elif (LZO_CC_DMC) - # define __lzo_inline __inline ++# define __lzo_inline __inline__ ++#elif (LZO_CC_DMC) ++# define __lzo_inline __inline +#elif (LZO_CC_GHS) +# define __lzo_inline __inline__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_inline __inline__ - #elif (LZO_CC_INTELC) - # define __lzo_inline __inline - #elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) - # define __lzo_inline __inline - #elif (LZO_CC_MSC && (_MSC_VER >= 900)) - # define __lzo_inline __inline --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) ++#elif (LZO_CC_INTELC) ++# define __lzo_inline __inline ++#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) ++# define __lzo_inline __inline ++#elif (LZO_CC_MSC && (_MSC_VER >= 900)) ++# define __lzo_inline __inline +#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_inline __inline__ --#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) --# define __lzo_inline inline - #endif - #endif - #if defined(__lzo_inline) ++# define __lzo_inline __inline__ ++#endif ++#endif ++#if defined(__lzo_inline) +# ifndef __lzo_HAVE_inline - # define __lzo_HAVE_inline 1 ++# define __lzo_HAVE_inline 1 +# endif - #else - # define __lzo_inline /*empty*/ - #endif - #if !defined(__lzo_forceinline) - #if (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) ++#else ++# define __lzo_inline /*empty*/ ++#endif ++#if !defined(__lzo_forceinline) ++#if (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) - # define __lzo_forceinline __forceinline --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) ++# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) - #elif (LZO_CC_MSC && (_MSC_VER >= 1200)) - # define __lzo_forceinline __forceinline --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) ++# define __lzo_forceinline __forceinline +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_forceinline __inline__ __attribute__((__always_inline__)) - #endif - #endif - #if defined(__lzo_forceinline) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#endif ++#endif ++#if defined(__lzo_forceinline) +# ifndef __lzo_HAVE_forceinline - # define __lzo_HAVE_forceinline 1 ++# define __lzo_HAVE_forceinline 1 +# endif - #else --# define __lzo_forceinline /*empty*/ ++#else +# define __lzo_forceinline __lzo_inline - #endif - #if !defined(__lzo_noinline) - #if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) - # define __lzo_noinline __attribute__((__noinline__,__used__)) - #elif (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_noinline __attribute__((__noinline__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) ++#endif ++#if !defined(__lzo_noinline) ++#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) ++# define __lzo_noinline __attribute__((__noinline__,__used__)) ++#elif (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) - # define __lzo_noinline __declspec(noinline) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) ++# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) - # define __lzo_noinline __attribute__((__noinline__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_noinline __attribute__((__noinline__)) - #elif (LZO_CC_MSC && (_MSC_VER >= 1300)) - # define __lzo_noinline __declspec(noinline) -@@ -1494,179 +1499,409 @@ extern "C" { - # else - # define __lzo_noinline __declspec(noinline) - # endif --#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_noinline __declspec(noinline) ++#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) ++# if defined(__cplusplus) ++# else ++# define __lzo_noinline __declspec(noinline) ++# endif +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) - # define __lzo_noinline __attribute__((__noinline__)) - #endif - #endif - #if defined(__lzo_noinline) ++# define __lzo_noinline __attribute__((__noinline__)) ++#endif ++#endif ++#if defined(__lzo_noinline) +# ifndef __lzo_HAVE_noinline - # define __lzo_HAVE_noinline 1 ++# define __lzo_HAVE_noinline 1 +# endif - #else - # define __lzo_noinline /*empty*/ - #endif - #if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) --# error "this should not happen" ++#else ++# define __lzo_noinline /*empty*/ ++#endif ++#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +# error "unexpected configuration - check your compiler defines" - #endif --#if !defined(__lzo_noreturn) --#if (LZO_CC_GNUC >= 0x020700ul) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) --# define __lzo_noreturn __declspec(noreturn) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define __lzo_noreturn __attribute__((__noreturn__)) --#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) --# define __lzo_noreturn __declspec(noreturn) ++#endif +#if !defined(__lzo_static_inline) +#if (LZO_CC_IBMC) +# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline - #endif - #endif --#if defined(__lzo_noreturn) --# define __lzo_HAVE_noreturn 1 --#else --# define __lzo_noreturn /*empty*/ ++#endif ++#endif +#if !defined(__lzo_static_inline) +# define __lzo_static_inline static __lzo_inline - #endif --#if !defined(__lzo_nothrow) --#if (LZO_CC_GNUC >= 0x030300ul) --# define __lzo_nothrow __attribute__((__nothrow__)) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) --# define __lzo_nothrow __declspec(nothrow) --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC) --# define __lzo_nothrow __attribute__((__nothrow__)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++#endif +#if !defined(__lzo_static_forceinline) +#if (LZO_CC_IBMC) +# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline @@ -4886,45 +1143,43 @@ index 25a1f68b3..ab2be5f4f 100644 +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_nothrow __attribute__((__nothrow__)) - #elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) - # define __lzo_nothrow __declspec(nothrow) - #endif - #endif - #if defined(__lzo_nothrow) ++# define __lzo_nothrow __attribute__((__nothrow__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) ++# define __lzo_nothrow __declspec(nothrow) ++#endif ++#endif ++#if defined(__lzo_nothrow) +# ifndef __lzo_HAVE_nothrow - # define __lzo_HAVE_nothrow 1 ++# define __lzo_HAVE_nothrow 1 +# endif - #else - # define __lzo_nothrow /*empty*/ - #endif - #if !defined(__lzo_restrict) - #if (LZO_CC_GNUC >= 0x030400ul) - # define __lzo_restrict __restrict__ --#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) ++#else ++# define __lzo_nothrow /*empty*/ ++#endif ++#if !defined(__lzo_restrict) ++#if (LZO_CC_GNUC >= 0x030400ul) ++# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) - # define __lzo_restrict __restrict__ --#elif (LZO_CC_CLANG || LZO_CC_LLVM) ++# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 1210) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) - # define __lzo_restrict __restrict__ - #elif (LZO_CC_MSC && (_MSC_VER >= 1400)) - # define __lzo_restrict __restrict ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) ++# define __lzo_restrict __restrict +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_restrict __restrict__ - #endif - #endif - #if defined(__lzo_restrict) ++#endif ++#endif ++#if defined(__lzo_restrict) +# ifndef __lzo_HAVE_restrict - # define __lzo_HAVE_restrict 1 ++# define __lzo_HAVE_restrict 1 +# endif - #else - # define __lzo_restrict /*empty*/ - #endif ++#else ++# define __lzo_restrict /*empty*/ ++#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) @@ -5073,88 +1328,49 @@ index 25a1f68b3..ab2be5f4f 100644 +#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +# error "unexpected configuration - check your compiler defines" +#endif - #if !defined(__lzo_likely) && !defined(__lzo_unlikely) - #if (LZO_CC_GNUC >= 0x030200ul) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#if !defined(__lzo_likely) && !defined(__lzo_unlikely) ++#if (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_IBMC >= 1010) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) - #elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) --#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) - # define __lzo_likely(e) (__builtin_expect(!!(e),1)) - # define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) - #endif - #endif - #if defined(__lzo_likely) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#endif ++#endif ++#if defined(__lzo_likely) +# ifndef __lzo_HAVE_likely - # define __lzo_HAVE_likely 1 ++# define __lzo_HAVE_likely 1 +# endif - #else - # define __lzo_likely(e) (e) - #endif - #if defined(__lzo_unlikely) ++#else ++# define __lzo_likely(e) (e) ++#endif ++#if defined(__lzo_unlikely) +# ifndef __lzo_HAVE_unlikely - # define __lzo_HAVE_unlikely 1 ++# define __lzo_HAVE_unlikely 1 +# endif - #else - # define __lzo_unlikely(e) (e) - #endif --#if !defined(LZO_UNUSED) --# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) --# define LZO_UNUSED(var) ((void) &var) --# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) --# define LZO_UNUSED(var) if (&var) ; else --# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_UNUSED(var) ((void) var) --# elif (LZO_CC_MSC && (_MSC_VER < 900)) --# define LZO_UNUSED(var) if (&var) ; else --# elif (LZO_CC_KEILC) --# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} --# elif (LZO_CC_PACIFICC) --# define LZO_UNUSED(var) ((void) sizeof(var)) --# elif (LZO_CC_WATCOMC) && defined(__cplusplus) --# define LZO_UNUSED(var) ((void) var) ++#else ++# define __lzo_unlikely(e) (e) ++#endif +#if !defined(__lzo_static_unused_void_func) +# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void) - # else --# define LZO_UNUSED(var) ((void) &var) ++# else +# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void) - # endif - #endif --#if !defined(LZO_UNUSED_FUNC) --# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) --# define LZO_UNUSED_FUNC(func) ((void) func) --# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) --# define LZO_UNUSED_FUNC(func) if (func) ; else --# elif (LZO_CC_CLANG || LZO_CC_LLVM) --# define LZO_UNUSED_FUNC(func) ((void) &func) --# elif (LZO_CC_MSC && (_MSC_VER < 900)) --# define LZO_UNUSED_FUNC(func) if (func) ; else --# elif (LZO_CC_MSC) --# define LZO_UNUSED_FUNC(func) ((void) &func) --# elif (LZO_CC_KEILC || LZO_CC_PELLESC) --# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} ++# endif ++#endif +#if !defined(__lzo_loop_forever) +# if (LZO_CC_IBMC) +# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END - # else --# define LZO_UNUSED_FUNC(func) ((void) func) ++# else +# define __lzo_loop_forever() do { ; } while __lzo_cte(1) - # endif - #endif --#if !defined(LZO_UNUSED_LABEL) --# if (LZO_CC_WATCOMC) && defined(__cplusplus) --# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l --# elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) --# define LZO_UNUSED_LABEL(l) if (0) goto l --# else --# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l --# endif ++# endif ++#endif +#if !defined(__lzo_unreachable) +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) +# define __lzo_unreachable() __builtin_unreachable(); @@ -5162,293 +1378,288 @@ index 25a1f68b3..ab2be5f4f 100644 +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 +# define __lzo_unreachable() __builtin_unreachable(); - #endif --#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) ++#endif +#endif +#if defined(__lzo_unreachable) +# ifndef __lzo_HAVE_unreachable +# define __lzo_HAVE_unreachable 1 +# endif +#else - # if 0 --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var --# elif 0 && (LZO_CC_GNUC) --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var ++# if 0 +# define __lzo_unreachable() ((void)0); - # else --# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init ++# else +# define __lzo_unreachable() __lzo_loop_forever(); - # endif - #endif --#if !defined(LZO_UNCONST_CAST) --# if 0 && defined(__cplusplus) --# define LZO_UNCONST_CAST(t,e) (const_cast (e)) --# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) --# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e)))))) --# else --# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e))))) --# endif ++# endif ++#endif +#ifndef __LZO_CTA_NAME +#if (LZO_CFG_USE_COUNTER) +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) +#else +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) +#endif - #endif - #if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) - # if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; ++#endif ++#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) ++# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END - # elif (LZO_CC_DMC || LZO_CC_SYMANTECC) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; ++# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END - # elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; ++# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END - # else --# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; ++# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END - # endif - #endif - #if !defined(LZO_COMPILE_TIME_ASSERT) - # if (LZO_CC_AZTECC) --# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} ++# endif ++#endif ++#if !defined(LZO_COMPILE_TIME_ASSERT) ++# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} - # elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} +# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} +# elif (LZO_CC_GNUC >= 0x040700ul) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} - # elif (LZO_CC_MSC && (_MSC_VER < 900)) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; - # elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) - # define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; - # else --# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} ++# elif (LZO_CC_MSC && (_MSC_VER < 900)) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} - # endif - #endif ++# endif ++#endif +LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) +#if defined(__cplusplus) +extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) - #if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) - # if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) - # elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -@@ -1730,6 +1965,7 @@ extern "C" { - # define __lzo_cdecl_va __lzo_cdecl - #endif - #if !(LZO_CFG_NO_WINDOWS_H) ++#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) ++# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) ++# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) ++# define __lzo_cdecl __cdecl ++# define __lzo_cdecl_atexit /*empty*/ ++# define __lzo_cdecl_main __cdecl ++# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) ++# define __lzo_cdecl_qsort __pascal ++# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) ++# define __lzo_cdecl_qsort _stdcall ++# else ++# define __lzo_cdecl_qsort __cdecl ++# endif ++# elif (LZO_CC_WATCOMC) ++# define __lzo_cdecl __cdecl ++# else ++# define __lzo_cdecl __cdecl ++# define __lzo_cdecl_atexit __cdecl ++# define __lzo_cdecl_main __cdecl ++# define __lzo_cdecl_qsort __cdecl ++# endif ++# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) ++# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) ++# define __lzo_cdecl_sighandler __pascal ++# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) ++# define __lzo_cdecl_sighandler _stdcall ++# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) ++# define __lzo_cdecl_sighandler __clrcall ++# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) ++# if defined(_DLL) ++# define __lzo_cdecl_sighandler _far _cdecl _loadds ++# elif defined(_MT) ++# define __lzo_cdecl_sighandler _far _cdecl ++# else ++# define __lzo_cdecl_sighandler _cdecl ++# endif ++# else ++# define __lzo_cdecl_sighandler __cdecl ++# endif ++#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) ++# define __lzo_cdecl __cdecl ++#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) ++# define __lzo_cdecl cdecl ++#endif ++#if !defined(__lzo_cdecl) ++# define __lzo_cdecl /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_atexit) ++# define __lzo_cdecl_atexit /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_main) ++# define __lzo_cdecl_main /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_qsort) ++# define __lzo_cdecl_qsort /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_sighandler) ++# define __lzo_cdecl_sighandler /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_va) ++# define __lzo_cdecl_va __lzo_cdecl ++#endif ++#if !(LZO_CFG_NO_WINDOWS_H) +#if !defined(LZO_HAVE_WINDOWS_H) - #if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) - # if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) - # elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) -@@ -1739,60 +1975,614 @@ extern "C" { - # endif - #endif - #endif ++#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) ++# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) ++# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) ++# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) ++# else ++# define LZO_HAVE_WINDOWS_H 1 ++# endif ++#endif ++#endif +#endif +#ifndef LZO_SIZEOF_SHORT -+#if defined(SIZEOF_SHORT) -+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) + #if defined(SIZEOF_SHORT) + # define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#elif defined(__SIZEOF_SHORT__) +# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF_INT -+#if defined(SIZEOF_INT) -+# define LZO_SIZEOF_INT (SIZEOF_INT) + #if defined(SIZEOF_INT) + # define LZO_SIZEOF_INT (SIZEOF_INT) +#elif defined(__SIZEOF_INT__) +# define LZO_SIZEOF_INT (__SIZEOF_INT__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF_LONG -+#if defined(SIZEOF_LONG) -+# define LZO_SIZEOF_LONG (SIZEOF_LONG) + #if defined(SIZEOF_LONG) + # define LZO_SIZEOF_LONG (SIZEOF_LONG) +#elif defined(__SIZEOF_LONG__) +# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF_LONG_LONG -+#if defined(SIZEOF_LONG_LONG) -+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) + #if defined(SIZEOF_LONG_LONG) + # define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#elif defined(__SIZEOF_LONG_LONG__) +# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF___INT16 -+#if defined(SIZEOF___INT16) -+# define LZO_SIZEOF___INT16 (SIZEOF___INT16) -+#endif + #if defined(SIZEOF___INT16) + # define LZO_SIZEOF___INT16 (SIZEOF___INT16) + #endif +#endif +#ifndef LZO_SIZEOF___INT32 -+#if defined(SIZEOF___INT32) -+# define LZO_SIZEOF___INT32 (SIZEOF___INT32) -+#endif + #if defined(SIZEOF___INT32) + # define LZO_SIZEOF___INT32 (SIZEOF___INT32) + #endif +#endif +#ifndef LZO_SIZEOF___INT64 -+#if defined(SIZEOF___INT64) -+# define LZO_SIZEOF___INT64 (SIZEOF___INT64) -+#endif + #if defined(SIZEOF___INT64) + # define LZO_SIZEOF___INT64 (SIZEOF___INT64) + #endif +#endif +#ifndef LZO_SIZEOF_VOID_P -+#if defined(SIZEOF_VOID_P) -+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) + #if defined(SIZEOF_VOID_P) + # define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#elif defined(__SIZEOF_POINTER__) +# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF_SIZE_T -+#if defined(SIZEOF_SIZE_T) -+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) + #if defined(SIZEOF_SIZE_T) + # define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#elif defined(__SIZEOF_SIZE_T__) +# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) -+#endif + #endif +#endif +#ifndef LZO_SIZEOF_PTRDIFF_T -+#if defined(SIZEOF_PTRDIFF_T) -+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) + #if defined(SIZEOF_PTRDIFF_T) + # define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#elif defined(__SIZEOF_PTRDIFF_T__) +# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) +#endif -+#endif -+#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) -+#if !defined(LZO_SIZEOF_SHORT) -+# if (LZO_ARCH_CRAY_PVP) -+# define LZO_SIZEOF_SHORT 8 -+# elif (USHRT_MAX == LZO_0xffffL) -+# define LZO_SIZEOF_SHORT 2 -+# elif (__LZO_LSR(USHRT_MAX,7) == 1) -+# define LZO_SIZEOF_SHORT 1 -+# elif (__LZO_LSR(USHRT_MAX,15) == 1) -+# define LZO_SIZEOF_SHORT 2 -+# elif (__LZO_LSR(USHRT_MAX,31) == 1) -+# define LZO_SIZEOF_SHORT 4 -+# elif (__LZO_LSR(USHRT_MAX,63) == 1) -+# define LZO_SIZEOF_SHORT 8 -+# elif (__LZO_LSR(USHRT_MAX,127) == 1) -+# define LZO_SIZEOF_SHORT 16 -+# else -+# error "LZO_SIZEOF_SHORT" -+# endif -+#endif + #endif + #define __LZO_LSR(x,b) (((x)+0ul) >> (b)) + #if !defined(LZO_SIZEOF_SHORT) +@@ -1080,6 +2060,7 @@ extern "C" { + # error "LZO_SIZEOF_SHORT" + # endif + #endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) -+#if !defined(LZO_SIZEOF_INT) -+# if (LZO_ARCH_CRAY_PVP) -+# define LZO_SIZEOF_INT 8 -+# elif (UINT_MAX == LZO_0xffffL) -+# define LZO_SIZEOF_INT 2 -+# elif (UINT_MAX == LZO_0xffffffffL) -+# define LZO_SIZEOF_INT 4 -+# elif (__LZO_LSR(UINT_MAX,7) == 1) -+# define LZO_SIZEOF_INT 1 -+# elif (__LZO_LSR(UINT_MAX,15) == 1) -+# define LZO_SIZEOF_INT 2 -+# elif (__LZO_LSR(UINT_MAX,31) == 1) -+# define LZO_SIZEOF_INT 4 -+# elif (__LZO_LSR(UINT_MAX,63) == 1) -+# define LZO_SIZEOF_INT 8 -+# elif (__LZO_LSR(UINT_MAX,127) == 1) -+# define LZO_SIZEOF_INT 16 -+# else -+# error "LZO_SIZEOF_INT" -+# endif -+#endif + #if !defined(LZO_SIZEOF_INT) + # if (LZO_ARCH_CRAY_PVP) + # define LZO_SIZEOF_INT 8 +@@ -1101,6 +2082,7 @@ extern "C" { + # error "LZO_SIZEOF_INT" + # endif + #endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) -+#if !defined(LZO_SIZEOF_LONG) -+# if (ULONG_MAX == LZO_0xffffffffL) -+# define LZO_SIZEOF_LONG 4 -+# elif (__LZO_LSR(ULONG_MAX,7) == 1) -+# define LZO_SIZEOF_LONG 1 -+# elif (__LZO_LSR(ULONG_MAX,15) == 1) -+# define LZO_SIZEOF_LONG 2 -+# elif (__LZO_LSR(ULONG_MAX,31) == 1) -+# define LZO_SIZEOF_LONG 4 + #if !defined(LZO_SIZEOF_LONG) + # if (ULONG_MAX == LZO_0xffffffffL) + # define LZO_SIZEOF_LONG 4 +@@ -1110,6 +2092,8 @@ extern "C" { + # define LZO_SIZEOF_LONG 2 + # elif (__LZO_LSR(ULONG_MAX,31) == 1) + # define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,39) == 1) +# define LZO_SIZEOF_LONG 5 -+# elif (__LZO_LSR(ULONG_MAX,63) == 1) -+# define LZO_SIZEOF_LONG 8 -+# elif (__LZO_LSR(ULONG_MAX,127) == 1) -+# define LZO_SIZEOF_LONG 16 -+# else -+# error "LZO_SIZEOF_LONG" -+# endif -+#endif + # elif (__LZO_LSR(ULONG_MAX,63) == 1) + # define LZO_SIZEOF_LONG 8 + # elif (__LZO_LSR(ULONG_MAX,127) == 1) +@@ -1118,11 +2102,12 @@ extern "C" { + # error "LZO_SIZEOF_LONG" + # endif + #endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) -+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) -+# if (LZO_CC_GNUC >= 0x030300ul) + #if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) + #if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) + # if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) + # if (LZO_CC_GNUC >= 0x030300ul) +-# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) -+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG -+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) -+# define LZO_SIZEOF_LONG_LONG 4 -+# endif -+# endif -+# endif -+#endif -+#endif -+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -+#if (LZO_ARCH_I086 && LZO_CC_DMC) -+#elif (LZO_CC_CILLY) && defined(__GNUC__) -+# define LZO_SIZEOF_LONG_LONG 8 + # define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG + # elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) + # define LZO_SIZEOF_LONG_LONG 4 +@@ -1136,7 +2121,7 @@ extern "C" { + #if (LZO_ARCH_I086 && LZO_CC_DMC) + #elif (LZO_CC_CILLY) && defined(__GNUC__) + # define LZO_SIZEOF_LONG_LONG 8 +-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_OS_WIN64 || defined(_WIN64)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) -+# define LZO_SIZEOF___INT64 8 -+#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) -+# define LZO_SIZEOF___INT64 8 + # define LZO_SIZEOF_LONG_LONG 8 + #elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) + # define LZO_SIZEOF_LONG_LONG 8 +@@ -1158,11 +2143,13 @@ extern "C" { + # define LZO_SIZEOF___INT64 8 + #elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) + # define LZO_SIZEOF___INT64 8 +-#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) -+# define LZO_SIZEOF___INT64 8 -+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) -+# define LZO_SIZEOF_LONG_LONG 8 + # define LZO_SIZEOF___INT64 8 + #elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) + # define LZO_SIZEOF_LONG_LONG 8 +-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) -+# define LZO_SIZEOF_LONG_LONG 8 -+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) -+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -+# define LZO_SIZEOF_LONG_LONG 8 -+#endif -+#endif -+#endif -+#if defined(__cplusplus) && (LZO_CC_GNUC) -+# if (LZO_CC_GNUC < 0x020800ul) -+# undef LZO_SIZEOF_LONG_LONG -+# endif -+#endif + # define LZO_SIZEOF_LONG_LONG 8 + #elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) + #elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +@@ -1175,87 +2162,127 @@ extern "C" { + # undef LZO_SIZEOF_LONG_LONG + # endif + #endif +-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +#if (LZO_CFG_NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(_NO_LONGLONG) -+# undef LZO_SIZEOF_LONG_LONG -+#endif + # undef LZO_SIZEOF_LONG_LONG + #endif +-#if !defined(LZO_SIZEOF_VOID_P) +-#if (LZO_ARCH_I086) +-# define __LZO_WORDSIZE 2 +-# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +-# define LZO_SIZEOF_VOID_P 2 +-# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +-# define LZO_SIZEOF_VOID_P 4 +#if !defined(LZO_WORDSIZE) +#if (LZO_ARCH_ALPHA) +# define LZO_WORDSIZE 8 @@ -5461,9 +1672,12 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_WORDSIZE 4 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_WORDSIZE 4 -+# else + # else +-# error "LZO_MM" +# define LZO_WORDSIZE 2 -+# endif + # endif +-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +-# define __LZO_WORDSIZE 1 +#elif (LZO_ARCH_I086) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_IA64) @@ -5498,21 +1712,24 @@ index 25a1f68b3..ab2be5f4f 100644 +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_ARCH_AVR) -+# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) -+# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_ARCH_H8300) -+# if defined(__NORMAL_MODE__) -+# define LZO_SIZEOF_VOID_P 2 -+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -+# define LZO_SIZEOF_VOID_P 4 -+# else -+# define LZO_SIZEOF_VOID_P 2 -+# endif -+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT -+# endif + # define LZO_SIZEOF_VOID_P 2 + #elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) + # define LZO_SIZEOF_VOID_P 2 + #elif (LZO_ARCH_H8300) + # if defined(__NORMAL_MODE__) +-# define __LZO_WORDSIZE 4 + # define LZO_SIZEOF_VOID_P 2 + # elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +-# define __LZO_WORDSIZE 4 + # define LZO_SIZEOF_VOID_P 4 + # else +-# define __LZO_WORDSIZE 2 + # define LZO_SIZEOF_VOID_P 2 + # endif + # if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) + # define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT + # define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT + # endif +#elif (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 @@ -5521,99 +1738,116 @@ index 25a1f68b3..ab2be5f4f 100644 +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif -+#elif (LZO_ARCH_M16C) -+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) -+# define LZO_SIZEOF_VOID_P 4 -+# else -+# define LZO_SIZEOF_VOID_P 2 -+# endif + #elif (LZO_ARCH_M16C) +-# define __LZO_WORDSIZE 2 + # if defined(__m32c_cpu__) || defined(__m32cm_cpu__) + # define LZO_SIZEOF_VOID_P 4 + # else + # define LZO_SIZEOF_VOID_P 2 + # endif +#elif (LZO_ARCH_SPU) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_ARCH_Z80) +# define LZO_SIZEOF_VOID_P 2 -+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -+# define LZO_SIZEOF_VOID_P 4 -+#elif (LZO_OS_OS400 || defined(__OS400__)) + #elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +-# define __LZO_WORDSIZE 8 + # define LZO_SIZEOF_VOID_P 4 +-#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +-# define __LZO_WORDSIZE 8 +-# define LZO_SIZEOF_VOID_P 8 +-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +-# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG + #elif (LZO_OS_OS400 || defined(__OS400__)) +-# define __LZO_WORDSIZE LZO_SIZEOF_LONG +-# define LZO_SIZEOF_VOID_P 16 +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +-# define LZO_SIZEOF_VOID_P 8 +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +-#elif (LZO_ARCH_SPU) +-# if 0 +-# define __LZO_WORDSIZE 16 +-# endif +-# define LZO_SIZEOF_VOID_P 4 +-#else +-# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +-#endif +-#endif +-#if !defined(LZO_WORDSIZE) +-# if defined(__LZO_WORDSIZE) +-# define LZO_WORDSIZE __LZO_WORDSIZE +# if defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+# else + # else +-# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+# endif + # endif +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -+#endif + #endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) -+#if !defined(LZO_SIZEOF_SIZE_T) -+#if (LZO_ARCH_I086 || LZO_ARCH_M16C) -+# define LZO_SIZEOF_SIZE_T 2 + #if !defined(LZO_SIZEOF_SIZE_T) + #if (LZO_ARCH_I086 || LZO_ARCH_M16C) + # define LZO_SIZEOF_SIZE_T 2 +-#else +#endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) -+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P -+#endif + # define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P + #endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) -+#endif -+#if !defined(LZO_SIZEOF_PTRDIFF_T) -+#if (LZO_ARCH_I086) -+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P -+# elif (LZO_MM_COMPACT || LZO_MM_LARGE) -+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) -+# define LZO_SIZEOF_PTRDIFF_T 4 -+# else -+# define LZO_SIZEOF_PTRDIFF_T 2 -+# endif -+# else + #endif + #if !defined(LZO_SIZEOF_PTRDIFF_T) + #if (LZO_ARCH_I086) +@@ -1268,11 +2295,18 @@ extern "C" { + # define LZO_SIZEOF_PTRDIFF_T 2 + # endif + # else +-# error "LZO_MM" +# error "invalid LZO_ARCH_I086 memory model" -+# endif + # endif +-#else +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) -+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T -+#endif + # define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T + #endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) +#endif +#if !defined(LZO_WORDSIZE) +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P -+#endif -+#if (LZO_ABI_NEUTRAL_ENDIAN) -+# undef LZO_ABI_BIG_ENDIAN -+# undef LZO_ABI_LITTLE_ENDIAN -+#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) -+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) -+# define LZO_ABI_LITTLE_ENDIAN 1 + #endif + #if (LZO_ABI_NEUTRAL_ENDIAN) + # undef LZO_ABI_BIG_ENDIAN +@@ -1284,7 +2318,7 @@ extern "C" { + # define LZO_ABI_LITTLE_ENDIAN 1 + #elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) + # define LZO_ABI_LITTLE_ENDIAN 1 +-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390) +#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) -+# if (__LITTLE_ENDIAN__ == 1) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+# else -+# define LZO_ABI_BIG_ENDIAN 1 -+# endif -+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) -+# define LZO_ABI_LITTLE_ENDIAN 1 + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) + # if (__LITTLE_ENDIAN__ == 1) +@@ -1300,6 +2334,19 @@ extern "C" { + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) + # define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) +# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" @@ -5627,89 +1861,430 @@ index 25a1f68b3..ab2be5f4f 100644 +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) +# define LZO_ABI_LITTLE_ENDIAN 1 -+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) -+# define LZO_ABI_BIG_ENDIAN 1 -+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) -+# define LZO_ABI_LITTLE_ENDIAN 1 -+#endif -+#endif -+#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) + #elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +@@ -1307,7 +2354,7 @@ extern "C" { + #endif + #endif + #if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) +-# error "this should not happen" +# error "unexpected configuration - check your compiler defines" -+#endif -+#if (LZO_ABI_BIG_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "be" -+#elif (LZO_ABI_LITTLE_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "le" -+#elif (LZO_ABI_NEUTRAL_ENDIAN) -+# define LZO_INFO_ABI_ENDIAN "neutral" -+#endif -+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -+# define LZO_ABI_I8LP16 1 -+# define LZO_INFO_ABI_PM "i8lp16" -+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -+# define LZO_ABI_ILP16 1 -+# define LZO_INFO_ABI_PM "ilp16" + #endif + #if (LZO_ABI_BIG_ENDIAN) + # define LZO_INFO_ABI_ENDIAN "be" +@@ -1322,6 +2369,9 @@ extern "C" { + #elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) + # define LZO_ABI_ILP16 1 + # define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_LP32 1 +# define LZO_INFO_ABI_PM "lp32" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -+# define LZO_ABI_ILP32 1 -+# define LZO_INFO_ABI_PM "ilp32" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) -+# define LZO_ABI_LLP64 1 -+# define LZO_INFO_ABI_PM "llp64" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -+# define LZO_ABI_LP64 1 -+# define LZO_INFO_ABI_PM "lp64" -+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -+# define LZO_ABI_ILP64 1 -+# define LZO_INFO_ABI_PM "ilp64" -+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) -+# define LZO_ABI_IP32L64 1 -+# define LZO_INFO_ABI_PM "ip32l64" -+#endif + #elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) + # define LZO_ABI_ILP32 1 + # define LZO_INFO_ABI_PM "ilp32" +@@ -1338,7 +2388,8 @@ extern "C" { + # define LZO_ABI_IP32L64 1 + # define LZO_INFO_ABI_PM "ip32l64" + #endif +-#if !defined(__LZO_LIBC_OVERRIDE) +#if 0 +#elif !defined(__LZO_LIBC_OVERRIDE) -+#if (LZO_LIBC_NAKED) -+# define LZO_INFO_LIBC "naked" -+#elif (LZO_LIBC_FREESTANDING) -+# define LZO_INFO_LIBC "freestanding" -+#elif (LZO_LIBC_MOSTLY_FREESTANDING) -+# define LZO_INFO_LIBC "mfreestanding" -+#elif (LZO_LIBC_ISOC90) -+# define LZO_INFO_LIBC "isoc90" -+#elif (LZO_LIBC_ISOC99) -+# define LZO_INFO_LIBC "isoc99" + #if (LZO_LIBC_NAKED) + # define LZO_INFO_LIBC "naked" + #elif (LZO_LIBC_FREESTANDING) +@@ -1349,6 +2400,9 @@ extern "C" { + # define LZO_INFO_LIBC "isoc90" + #elif (LZO_LIBC_ISOC99) + # define LZO_INFO_LIBC "isoc99" +#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" -+#elif defined(__dietlibc__) -+# define LZO_LIBC_DIETLIBC 1 -+# define LZO_INFO_LIBC "dietlibc" -+#elif defined(_NEWLIB_VERSION) -+# define LZO_LIBC_NEWLIB 1 -+# define LZO_INFO_LIBC "newlib" -+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) -+# if defined(__UCLIBC_SUBLEVEL__) + #elif defined(__dietlibc__) + # define LZO_LIBC_DIETLIBC 1 + # define LZO_INFO_LIBC "dietlibc" +@@ -1357,13 +2411,13 @@ extern "C" { + # define LZO_INFO_LIBC "newlib" + #elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) + # if defined(__UCLIBC_SUBLEVEL__) +-# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) -+# else -+# define LZO_LIBC_UCLIBC 0x00090bL -+# endif + # else + # define LZO_LIBC_UCLIBC 0x00090bL + # endif +-# define LZO_INFO_LIBC "uclibc" +# define LZO_INFO_LIBC "uc" "libc" -+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) + #elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +-# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) -+# define LZO_INFO_LIBC "glibc" -+#elif (LZO_CC_MWERKS) && defined(__MSL__) -+# define LZO_LIBC_MSL __MSL__ -+# define LZO_INFO_LIBC "msl" -+#elif 1 && defined(__IAR_SYSTEMS_ICC__) -+# define LZO_LIBC_ISOC90 1 -+# define LZO_INFO_LIBC "isoc90" -+#else -+# define LZO_LIBC_DEFAULT 1 -+# define LZO_INFO_LIBC "default" -+#endif -+#endif + # define LZO_INFO_LIBC "glibc" + #elif (LZO_CC_MWERKS) && defined(__MSL__) + # define LZO_LIBC_MSL __MSL__ +@@ -1376,423 +2430,159 @@ extern "C" { + # define LZO_INFO_LIBC "default" + #endif + #endif +-#if !defined(__lzo_gnuc_extension__) +-#if (LZO_CC_GNUC >= 0x020800ul) +-# define __lzo_gnuc_extension__ __extension__ +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_gnuc_extension__ __extension__ +-#else +-# define __lzo_gnuc_extension__ /*empty*/ +-#endif +-#endif +-#if !defined(__lzo_ua_volatile) +-# define __lzo_ua_volatile volatile +-#endif +-#if !defined(__lzo_alignof) +-#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +-# define __lzo_alignof(e) __alignof__(e) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +-# define __lzo_alignof(e) __alignof__(e) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +-# define __lzo_alignof(e) __alignof(e) +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_alignof(e) __alignof__(e) +-#endif +-#endif +-#if defined(__lzo_alignof) +-# define __lzo_HAVE_alignof 1 +-#endif +-#if !defined(__lzo_constructor) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_constructor __attribute__((__constructor__,__used__)) +-#elif (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_constructor __attribute__((__constructor__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_constructor __attribute__((__constructor__)) +-#endif +-#endif +-#if defined(__lzo_constructor) +-# define __lzo_HAVE_constructor 1 +-#endif +-#if !defined(__lzo_destructor) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_destructor __attribute__((__destructor__,__used__)) +-#elif (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_destructor __attribute__((__destructor__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_destructor __attribute__((__destructor__)) +-#endif +-#endif +-#if defined(__lzo_destructor) +-# define __lzo_HAVE_destructor 1 +-#endif +-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +-# error "this should not happen" +-#endif +-#if !defined(__lzo_inline) +-#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +-#elif defined(__cplusplus) +-# define __lzo_inline inline +-#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +-# define __lzo_inline __inline +-#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +-# define __lzo_inline __inline__ +-#elif (LZO_CC_DMC) +-# define __lzo_inline __inline +-#elif (LZO_CC_INTELC) +-# define __lzo_inline __inline +-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +-# define __lzo_inline __inline +-#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +-# define __lzo_inline __inline +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_inline __inline__ +-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +-# define __lzo_inline inline +-#endif +-#endif +-#if defined(__lzo_inline) +-# define __lzo_HAVE_inline 1 +-#else +-# define __lzo_inline /*empty*/ +-#endif +-#if !defined(__lzo_forceinline) +-#if (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +-# define __lzo_forceinline __forceinline +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +-# define __lzo_forceinline __forceinline +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#endif +-#endif +-#if defined(__lzo_forceinline) +-# define __lzo_HAVE_forceinline 1 +-#else +-# define __lzo_forceinline /*empty*/ +-#endif +-#if !defined(__lzo_noinline) +-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +-# define __lzo_noinline __attribute__((__noinline__,__used__)) +-#elif (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +-# define __lzo_noinline __declspec(noinline) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +-# define __lzo_noinline __declspec(noinline) +-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +-# if defined(__cplusplus) +-# else +-# define __lzo_noinline __declspec(noinline) +-# endif +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_noinline __attribute__((__noinline__)) +-#endif +-#endif +-#if defined(__lzo_noinline) +-# define __lzo_HAVE_noinline 1 +-#else +-# define __lzo_noinline /*empty*/ +-#endif +-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +-# error "this should not happen" +-#endif +-#if !defined(__lzo_noreturn) +-#if (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +-# define __lzo_noreturn __declspec(noreturn) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +-# define __lzo_noreturn __declspec(noreturn) +-#endif +-#endif +-#if defined(__lzo_noreturn) +-# define __lzo_HAVE_noreturn 1 +-#else +-# define __lzo_noreturn /*empty*/ +-#endif +-#if !defined(__lzo_nothrow) +-#if (LZO_CC_GNUC >= 0x030300ul) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +-# define __lzo_nothrow __declspec(nothrow) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +-# define __lzo_nothrow __declspec(nothrow) +-#endif +-#endif +-#if defined(__lzo_nothrow) +-# define __lzo_HAVE_nothrow 1 +-#else +-# define __lzo_nothrow /*empty*/ +-#endif +-#if !defined(__lzo_restrict) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_CLANG || LZO_CC_LLVM) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +-# define __lzo_restrict __restrict +-#endif +-#endif +-#if defined(__lzo_restrict) +-# define __lzo_HAVE_restrict 1 +-#else +-# define __lzo_restrict /*empty*/ +-#endif +-#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +-#if (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#endif +-#endif +-#if defined(__lzo_likely) +-# define __lzo_HAVE_likely 1 +-#else +-# define __lzo_likely(e) (e) +-#endif +-#if defined(__lzo_unlikely) +-# define __lzo_HAVE_unlikely 1 +-#else +-# define __lzo_unlikely(e) (e) +-#endif +-#if !defined(LZO_UNUSED) +-# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +-# define LZO_UNUSED(var) ((void) &var) +-# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +-# define LZO_UNUSED(var) if (&var) ; else +-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define LZO_UNUSED(var) ((void) var) +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_UNUSED(var) if (&var) ; else +-# elif (LZO_CC_KEILC) +-# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +-# elif (LZO_CC_PACIFICC) +-# define LZO_UNUSED(var) ((void) sizeof(var)) +-# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +-# define LZO_UNUSED(var) ((void) var) +-# else +-# define LZO_UNUSED(var) ((void) &var) +-# endif +-#endif +-#if !defined(LZO_UNUSED_FUNC) +-# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +-# define LZO_UNUSED_FUNC(func) ((void) func) +-# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +-# define LZO_UNUSED_FUNC(func) if (func) ; else +-# elif (LZO_CC_CLANG || LZO_CC_LLVM) +-# define LZO_UNUSED_FUNC(func) ((void) &func) +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_UNUSED_FUNC(func) if (func) ; else +-# elif (LZO_CC_MSC) +-# define LZO_UNUSED_FUNC(func) ((void) &func) +-# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +-# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +-# else +-# define LZO_UNUSED_FUNC(func) ((void) func) +-# endif +-#endif +-#if !defined(LZO_UNUSED_LABEL) +-# if (LZO_CC_WATCOMC) && defined(__cplusplus) +-# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +-# elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +-# define LZO_UNUSED_LABEL(l) if (0) goto l +-# else +-# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +-# endif +-#endif +-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +-# if 0 +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +-# elif 0 && (LZO_CC_GNUC) +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +-# else +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +-# endif +-#endif +-#if !defined(LZO_UNCONST_CAST) +-# if 0 && defined(__cplusplus) +-# define LZO_UNCONST_CAST(t,e) (const_cast (e)) +-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e)))))) +-# else +-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e))))) +-# endif +-#endif +-#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +-# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +-# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +-# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +-# else +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +-# endif +-#endif +-#if !defined(LZO_COMPILE_TIME_ASSERT) +-# if (LZO_CC_AZTECC) +-# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +-# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# else +-# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +-# endif +-#endif +-#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +-# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +-# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +-# define __lzo_cdecl __cdecl +-# define __lzo_cdecl_atexit /*empty*/ +-# define __lzo_cdecl_main __cdecl +-# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +-# define __lzo_cdecl_qsort __pascal +-# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +-# define __lzo_cdecl_qsort _stdcall +-# else +-# define __lzo_cdecl_qsort __cdecl +-# endif +-# elif (LZO_CC_WATCOMC) +-# define __lzo_cdecl __cdecl +-# else +-# define __lzo_cdecl __cdecl +-# define __lzo_cdecl_atexit __cdecl +-# define __lzo_cdecl_main __cdecl +-# define __lzo_cdecl_qsort __cdecl +-# endif +-# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +-# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +-# define __lzo_cdecl_sighandler __pascal +-# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +-# define __lzo_cdecl_sighandler _stdcall +-# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +-# define __lzo_cdecl_sighandler __clrcall +-# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +-# if defined(_DLL) +-# define __lzo_cdecl_sighandler _far _cdecl _loadds +-# elif defined(_MT) +-# define __lzo_cdecl_sighandler _far _cdecl +-# else +-# define __lzo_cdecl_sighandler _cdecl +-# endif +-# else +-# define __lzo_cdecl_sighandler __cdecl +-# endif +-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +-# define __lzo_cdecl __cdecl +-#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +-# define __lzo_cdecl cdecl +-#endif +-#if !defined(__lzo_cdecl) +-# define __lzo_cdecl /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_atexit) +-# define __lzo_cdecl_atexit /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_main) +-# define __lzo_cdecl_main /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_qsort) +-# define __lzo_cdecl_qsort /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_sighandler) +-# define __lzo_cdecl_sighandler /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_va) +-# define __lzo_cdecl_va __lzo_cdecl +-#endif +-#if !(LZO_CFG_NO_WINDOWS_H) +-#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +-# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +-# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +-# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +-# else +-# define LZO_HAVE_WINDOWS_H 1 +-# endif +#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) @@ -5737,8 +2312,8 @@ index 25a1f68b3..ab2be5f4f 100644 +# define __LZO_ASM_CLOBBER_LIST_CC : "cc" +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -+#endif -+#endif + #endif + #endif #if (LZO_ARCH_ALPHA) -# define LZO_OPT_AVOID_UINT_INDEX 1 -# define LZO_OPT_AVOID_SHORT 1 @@ -6375,7 +2950,7 @@ index 25a1f68b3..ab2be5f4f 100644 #endif #if (LZO_CC_SUNPROC) -@@ -1937,48 +3074,15 @@ extern "C" { +@@ -1937,49 +3074,16 @@ extern "C" { #endif #endif @@ -6401,8 +2976,10 @@ index 25a1f68b3..ab2be5f4f 100644 -# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0]) -# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1]) -# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o))) --#endif -- ++#if defined(LZO_HAVE_CONFIG_H) ++# define LZO_CFG_NO_CONFIG_HEADER 1 + #endif + -#if !defined(lzo_uintptr_t) -# if defined(__LZO_MMODEL_HUGE) -# define lzo_uintptr_t unsigned long @@ -6421,13 +2998,12 @@ index 25a1f68b3..ab2be5f4f 100644 -# else -# define lzo_uintptr_t size_t -# endif -+#if defined(LZO_HAVE_CONFIG_H) -+# define LZO_CFG_NO_CONFIG_HEADER 1 - #endif +-#endif -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) - +- #if 1 && !defined(LZO_CFG_FREESTANDING) #if 1 && !defined(HAVE_STRING_H) + #define HAVE_STRING_H 1 @@ -2002,6 +3106,23 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) #include #endif @@ -6452,7 +3028,7 @@ index 25a1f68b3..ab2be5f4f 100644 #if (LZO_CFG_FREESTANDING) # undef HAVE_MEMCMP # undef HAVE_MEMCPY -@@ -2012,169 +3133,635 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) +@@ -2012,28 +3133,28 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) #if !(HAVE_MEMCMP) # undef memcmp # define memcmp(a,b,c) lzo_memcmp(a,b,c) @@ -6485,40 +3061,31 @@ index 25a1f68b3..ab2be5f4f 100644 # undef lzo_memset # define lzo_memset(a,b,c) memset(a,b,c) #endif +@@ -2058,27 +3179,29 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + # define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) + #endif + +-#if !defined(__lzo_inline) +-# define __lzo_inline /*empty*/ +-#endif +-#if !defined(__lzo_forceinline) +-# define __lzo_forceinline /*empty*/ +-#endif +-#if !defined(__lzo_noinline) +-# define __lzo_noinline /*empty*/ +-#endif +- + #if (LZO_CFG_PGO) +-# undef __acc_likely +-# undef __acc_unlikely + # undef __lzo_likely + # undef __lzo_unlikely +-# define __acc_likely(e) (e) +-# define __acc_unlikely(e) (e) + # define __lzo_likely(e) (e) + # define __lzo_unlikely(e) (e) + #endif --#undef NDEBUG --#if (LZO_CFG_FREESTANDING) --# undef LZO_DEBUG --# define NDEBUG 1 --# undef assert --# define assert(e) ((void)0) -+#undef NDEBUG -+#if (LZO_CFG_FREESTANDING) -+# undef LZO_DEBUG -+# define NDEBUG 1 -+# undef assert -+# define assert(e) ((void)0) -+#else -+# if !defined(LZO_DEBUG) -+# define NDEBUG 1 -+# endif -+# include -+#endif -+ -+#if 0 && defined(__BOUNDS_CHECKING_ON) -+# include -+#else -+# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt -+# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) -+#endif -+ -+#if (LZO_CFG_PGO) -+# undef __lzo_likely -+# undef __lzo_unlikely -+# define __lzo_likely(e) (e) -+# define __lzo_unlikely(e) (e) -+#endif -+ +#undef _ +#undef __ +#undef ___ @@ -6535,36 +3102,92 @@ index 25a1f68b3..ab2be5f4f 100644 +#undef _s4 +#undef _ww + -+#if 1 -+# define LZO_BYTE(x) ((unsigned char) (x)) -+#else -+# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) -+#endif -+ -+#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) -+#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) -+#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) -+#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) -+ -+#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) -+ -+#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) -+ -+#define LZO_SIZE(bits) (1u << (bits)) -+#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) -+ -+#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) -+#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) -+ -+#if !defined(DMUL) -+#if 0 -+ + #if 1 + # define LZO_BYTE(x) ((unsigned char) (x)) + #else +@@ -2097,84 +3220,548 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + #define LZO_SIZE(bits) (1u << (bits)) + #define LZO_MASK(bits) (LZO_SIZE(bits) - 1) + +-#define LZO_LSIZE(bits) (1ul << (bits)) +-#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1) +- + #define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) + #define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) + + #if !defined(DMUL) + #if 0 + +-# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b))) +# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b))) -+#else -+# define DMUL(a,b) ((lzo_xint) ((a) * (b))) -+#endif -+#endif -+ + #else + # define DMUL(a,b) ((lzo_xint) ((a) * (b))) + #endif + #endif + +-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC) +-# if (LZO_SIZEOF_SHORT == 2) +-# define LZO_UNALIGNED_OK_2 1 +-# endif +-# if (LZO_SIZEOF_INT == 4) +-# define LZO_UNALIGNED_OK_4 1 +-# endif +-#endif +-#if 1 && (LZO_ARCH_AMD64) +-# if defined(LZO_UINT64_MAX) +-# define LZO_UNALIGNED_OK_8 1 +-# endif +-#endif +-#if (LZO_CFG_NO_UNALIGNED) +-# undef LZO_UNALIGNED_OK_2 +-# undef LZO_UNALIGNED_OK_4 +-# undef LZO_UNALIGNED_OK_8 +-#endif +- +-#undef UA_GET16 +-#undef UA_SET16 +-#undef UA_COPY16 +-#undef UA_GET32 +-#undef UA_SET32 +-#undef UA_COPY32 +-#undef UA_GET64 +-#undef UA_SET64 +-#undef UA_COPY64 +-#if defined(LZO_UNALIGNED_OK_2) +- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2) +-# if 1 && defined(ACC_UA_COPY16) +-# define UA_GET16 ACC_UA_GET16 +-# define UA_SET16 ACC_UA_SET16 +-# define UA_COPY16 ACC_UA_COPY16 +-# else +-# define UA_GET16(p) (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p)) +-# define UA_SET16(p,v) ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v)) +-# define UA_COPY16(d,s) UA_SET16(d, UA_GET16(s)) +-# endif +-#endif +-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +-# if 1 && defined(ACC_UA_COPY32) +-# define UA_GET32 ACC_UA_GET32 +-# define UA_SET32 ACC_UA_SET32 +-# define UA_COPY32 ACC_UA_COPY32 +-# else +-# define UA_GET32(p) (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p)) +-# define UA_SET32(p,v) ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v)) +-# define UA_COPY32(d,s) UA_SET32(d, UA_GET32(s)) +-# endif +-#endif +-#if defined(LZO_UNALIGNED_OK_8) +- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8) +-# if 1 && defined(ACC_UA_COPY64) +-# define UA_GET64 ACC_UA_GET64 +-# define UA_SET64 ACC_UA_SET64 +-# define UA_COPY64 ACC_UA_COPY64 +-# else +-# define UA_GET64(p) (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p)) +-# define UA_SET64(p,v) ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v)) +-# define UA_COPY64(d,s) UA_SET64(d, UA_GET64(s)) +-# endif +#ifndef __LZO_FUNC_H +#define __LZO_FUNC_H 1 + @@ -6866,32 +3489,18 @@ index 25a1f68b3..ab2be5f4f 100644 + unsigned long vv; + __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s)); + v = (lzo_uint16_t) vv; - #else --# if !defined(LZO_DEBUG) --# define NDEBUG 1 --# endif --# include ++#else + const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; + v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8)); - #endif -- --#if 0 && defined(__BOUNDS_CHECKING_ON) --# include ++#endif + return v; +} +#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) - #else --# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt --# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) ++#else +#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss) - #endif - --#if !defined(__lzo_inline) --# define __lzo_inline /*empty*/ --#endif --#if !defined(__lzo_forceinline) --# define __lzo_forceinline /*empty*/ ++#endif ++ +__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss) +{ + lzo_uint32_t v; @@ -6905,32 +3514,19 @@ index 25a1f68b3..ab2be5f4f 100644 +#else + const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; + v = (lzo_uint32_t) (((lzo_uint32_t)s[0]) | ((lzo_uint32_t)s[1] << 8) | ((lzo_uint32_t)s[2] << 16) | ((lzo_uint32_t)s[3] << 24)); - #endif --#if !defined(__lzo_noinline) --# define __lzo_noinline /*empty*/ ++#endif + return v; +} +#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) +#else +#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss) - #endif - --#if (LZO_CFG_PGO) --# undef __acc_likely --# undef __acc_unlikely --# undef __lzo_likely --# undef __lzo_unlikely --# define __acc_likely(e) (e) --# define __acc_unlikely(e) (e) --# define __lzo_likely(e) (e) --# define __lzo_unlikely(e) (e) ++#endif ++ +#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) - #endif - --#if 1 --# define LZO_BYTE(x) ((unsigned char) (x)) ++#endif ++ +__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss) +{ + lzo_uint16_t v; @@ -6939,17 +3535,10 @@ index 25a1f68b3..ab2be5f4f 100644 +} +#if (LZO_OPT_UNALIGNED16) +#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) - #else --# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) ++#else +#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss) - #endif - --#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) --#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) --#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) --#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) -- --#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) ++#endif ++ +__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss) +{ + lzo_uint32_t v; @@ -6961,14 +3550,11 @@ index 25a1f68b3..ab2be5f4f 100644 +#else +#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss) +#endif - --#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) ++ +#if (LZO_OPT_UNALIGNED64) +#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) +#endif - --#define LZO_SIZE(bits) (1u << (bits)) --#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) ++ +__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv) +{ +#if (LZO_ABI_LITTLE_ENDIAN) @@ -6988,9 +3574,7 @@ index 25a1f68b3..ab2be5f4f 100644 +#else +#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv) +#endif - --#define LZO_LSIZE(bits) (1ul << (bits)) --#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1) ++ +__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv) +{ +#if (LZO_ABI_LITTLE_ENDIAN) @@ -7012,9 +3596,7 @@ index 25a1f68b3..ab2be5f4f 100644 +#else +#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv) +#endif - --#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) --#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) ++ +__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv) +{ + LZO_MEMOPS_COPY2(dd, &vv); @@ -7024,9 +3606,7 @@ index 25a1f68b3..ab2be5f4f 100644 +#else +#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv) +#endif - --#if !defined(DMUL) --#if 0 ++ +__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv) +{ + LZO_MEMOPS_COPY4(dd, &vv); @@ -7036,14 +3616,12 @@ index 25a1f68b3..ab2be5f4f 100644 +#else +#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv) +#endif - --# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b))) ++ +#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +static void __attribute__((__unused__)) - #else --# define DMUL(a,b) ((lzo_xint) ((a) * (b))) ++#else +__lzo_static_forceinline void - #endif ++#endif +lzo_memops_unused_funcs(void) +{ + LZO_UNUSED_FUNC(lzo_memops_get_le16); @@ -7057,79 +3635,20 @@ index 25a1f68b3..ab2be5f4f 100644 + LZO_UNUSED_FUNC(lzo_memops_unused_funcs); +} + - #endif - --#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC) --# if (LZO_SIZEOF_SHORT == 2) --# define LZO_UNALIGNED_OK_2 1 --# endif --# if (LZO_SIZEOF_INT == 4) --# define LZO_UNALIGNED_OK_4 1 --# endif ++#endif ++ +#ifndef UA_SET1 +#define UA_SET1 LZO_MEMOPS_SET1 - #endif --#if 1 && (LZO_ARCH_AMD64) --# if defined(LZO_UINT64_MAX) --# define LZO_UNALIGNED_OK_8 1 --# endif ++#endif +#ifndef UA_SET2 +#define UA_SET2 LZO_MEMOPS_SET2 - #endif --#if (LZO_CFG_NO_UNALIGNED) --# undef LZO_UNALIGNED_OK_2 --# undef LZO_UNALIGNED_OK_4 --# undef LZO_UNALIGNED_OK_8 --#endif -- --#undef UA_GET16 --#undef UA_SET16 --#undef UA_COPY16 --#undef UA_GET32 --#undef UA_SET32 --#undef UA_COPY32 --#undef UA_GET64 --#undef UA_SET64 --#undef UA_COPY64 --#if defined(LZO_UNALIGNED_OK_2) -- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2) --# if 1 && defined(ACC_UA_COPY16) --# define UA_GET16 ACC_UA_GET16 --# define UA_SET16 ACC_UA_SET16 --# define UA_COPY16 ACC_UA_COPY16 --# else --# define UA_GET16(p) (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p)) --# define UA_SET16(p,v) ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v)) --# define UA_COPY16(d,s) UA_SET16(d, UA_GET16(s)) --# endif ++#endif +#ifndef UA_SET3 +#define UA_SET3 LZO_MEMOPS_SET3 - #endif --#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) -- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) --# if 1 && defined(ACC_UA_COPY32) --# define UA_GET32 ACC_UA_GET32 --# define UA_SET32 ACC_UA_SET32 --# define UA_COPY32 ACC_UA_COPY32 --# else --# define UA_GET32(p) (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p)) --# define UA_SET32(p,v) ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v)) --# define UA_COPY32(d,s) UA_SET32(d, UA_GET32(s)) --# endif ++#endif +#ifndef UA_SET4 +#define UA_SET4 LZO_MEMOPS_SET4 - #endif --#if defined(LZO_UNALIGNED_OK_8) -- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8) --# if 1 && defined(ACC_UA_COPY64) --# define UA_GET64 ACC_UA_GET64 --# define UA_SET64 ACC_UA_SET64 --# define UA_COPY64 ACC_UA_COPY64 --# else --# define UA_GET64(p) (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p)) --# define UA_SET64(p,v) ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v)) --# define UA_COPY64(d,s) UA_SET64(d, UA_GET64(s)) --# endif ++#endif +#ifndef UA_MOVE1 +#define UA_MOVE1 LZO_MEMOPS_MOVE1 +#endif @@ -7239,7 +3758,6 @@ index 25a1f68b3..ab2be5f4f 100644 -#if defined(LZO_UINT64_MAX) - lzo_int64 a_lzo_int64; - lzo_uint64 a_lzo_uint64; --#endif + lzo_xint a_lzo_xint; + lzo_int16_t a_lzo_int16_t; + lzo_uint16_t a_lzo_uint16_t; @@ -7248,7 +3766,7 @@ index 25a1f68b3..ab2be5f4f 100644 +#if defined(lzo_uint64_t) + lzo_int64_t a_lzo_int64_t; + lzo_uint64_t a_lzo_uint64_t; -+#endif + #endif + size_t a_size_t; ptrdiff_t a_ptrdiff_t; lzo_uintptr_t a_lzo_uintptr_t; @@ -7426,7 +3944,9 @@ index 25a1f68b3..ab2be5f4f 100644 -#define ACC_WANT_ACC_CHK_CH 1 -#undef ACCCHK_ASSERT -- ++#define LZO_WANT_ACC_CHK_CH 1 ++#undef LZOCHK_ASSERT + - ACCCHK_ASSERT_IS_SIGNED_T(lzo_int) - ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) - @@ -7438,30 +3958,34 @@ index 25a1f68b3..ab2be5f4f 100644 - ACCCHK_ASSERT(sizeof(lzo_uint64) == 8) - ACCCHK_ASSERT_IS_SIGNED_T(lzo_int64) - ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64) --#endif -- --#if !defined(__LZO_UINTPTR_T_IS_POINTER) -- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) --#endif -- ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) -- -- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) -- ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32)) -- ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint)) -- ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint)) -+#define LZO_WANT_ACC_CHK_CH 1 -+#undef LZOCHK_ASSERT - + LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) + LZOCHK_ASSERT_IS_SIGNED_T(lzo_int) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) +#if !(__LZO_UINTPTR_T_IS_POINTER) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) #endif --#undef ACCCHK_ASSERT + LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) +-#if !defined(__LZO_UINTPTR_T_IS_POINTER) +- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) + #endif +- ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) +- +- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) +- ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32)) +- ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint)) +- ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint)) ++#undef LZOCHK_ASSERT + ++union lzo_config_check_union { ++ lzo_uint a[2]; ++ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))]; ++#if defined(lzo_uint64_t) ++ lzo_uint64_t c[2]; + #endif +-#undef ACCCHK_ASSERT +- -#if 0 -#define WANT_lzo_bitops_clz32 1 -#define WANT_lzo_bitops_clz64 1 @@ -7510,9 +4034,8 @@ index 25a1f68b3..ab2be5f4f 100644 - return (unsigned) r; -} -#define lzo_bitops_ctz64 lzo_bitops_ctz64 - #endif -+#undef LZOCHK_ASSERT - +-#endif +- -#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || LZO_CC_LLVM) -#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) -#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v)) @@ -7532,12 +4055,7 @@ index 25a1f68b3..ab2be5f4f 100644 -#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX) -#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v)) -#endif -+union lzo_config_check_union { -+ lzo_uint a[2]; -+ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))]; -+#if defined(lzo_uint64_t) -+ lzo_uint64_t c[2]; - #endif +-#endif +}; #if 0 @@ -7551,14 +4069,13 @@ index 25a1f68b3..ab2be5f4f 100644 - lzo_xint a[2]; unsigned char b[2*LZO_MAX(8,sizeof(lzo_xint))]; -#if defined(LZO_UNALIGNED_OK_8) - lzo_uint64 c[2]; --#endif -- unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2]; -- } u; +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul)) +# if 0 + volatile +# endif -+#endif + #endif +- unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2]; +- } u; + union lzo_config_check_union u; lzo_voidp p; + unsigned r = 1; @@ -7612,43 +4129,17 @@ index 25a1f68b3..ab2be5f4f 100644 + r &= UA_GET_LE32(p) == LZO_UINT32_C(0x83828180); +#if (LZO_ABI_BIG_ENDIAN) + r &= UA_GET_NE32(p) == LZO_UINT32_C(0x80818283); - #endif --#if defined(LZO_UNALIGNED_OK_8) ++#endif +#if (LZO_ABI_LITTLE_ENDIAN) + r &= UA_GET_NE32(p) == LZO_UINT32_C(0x83828180); -+#endif + #endif +-#if defined(LZO_UNALIGNED_OK_8) +#if defined(UA_GET_NE64) u.c[0] = u.c[1] = 0; - u.b[0] = 5; u.b[sizeof(lzo_uint64) + 1] = 6; + u.b[0] = 5; u.b[9] = 6; p = u2p(&u, 1); - r &= ((* (lzo_uint64p) p) == 0); --#endif --#if defined(lzo_bitops_clz32) -- { unsigned i; lzo_uint32 v = 1; -- for (i = 0; i < 31; i++, v <<= 1) -- r &= lzo_bitops_clz32(v) == 31 - i; -- } --#endif --#if defined(lzo_bitops_clz64) -- { unsigned i; lzo_uint64 v = 1; -- for (i = 0; i < 63; i++, v <<= 1) -- r &= lzo_bitops_clz64(v) == 63 - i; -- } --#endif --#if defined(lzo_bitops_ctz32) -- { unsigned i; lzo_uint32 v = 1; -- for (i = 0; i < 31; i++, v <<= 1) -- r &= lzo_bitops_ctz32(v) == i; -- } --#endif --#if defined(lzo_bitops_ctz64) -- { unsigned i; lzo_uint64 v = 1; -- for (i = 0; i < 63; i++, v <<= 1) -- r &= lzo_bitops_ctz64(v) == i; -- } --#endif --#endif + u.c[0] = u.c[1] = 0; + r &= UA_GET_NE64(p) == 0; +#if defined(UA_GET_LE64) @@ -7656,36 +4147,56 @@ index 25a1f68b3..ab2be5f4f 100644 + u.b[1] = 128; + r &= UA_GET_LE64(p) == 128; +#endif -+#endif + #endif +-#if defined(lzo_bitops_clz32) +- { unsigned i; lzo_uint32 v = 1; +- for (i = 0; i < 31; i++, v <<= 1) +- r &= lzo_bitops_clz32(v) == 31 - i; +- } +#if defined(lzo_bitops_ctlz32) + { unsigned i = 0; lzo_uint32_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_ctlz32(v) == 31 - i; + r &= lzo_bitops_ctlz32_func(v) == 31 - i; + }} -+#endif + #endif +-#if defined(lzo_bitops_clz64) +- { unsigned i; lzo_uint64 v = 1; +- for (i = 0; i < 63; i++, v <<= 1) +- r &= lzo_bitops_clz64(v) == 63 - i; +- } +#if defined(lzo_bitops_ctlz64) + { unsigned i = 0; lzo_uint64_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_ctlz64(v) == 63 - i; + r &= lzo_bitops_ctlz64_func(v) == 63 - i; + }} -+#endif + #endif +-#if defined(lzo_bitops_ctz32) +- { unsigned i; lzo_uint32 v = 1; +- for (i = 0; i < 31; i++, v <<= 1) +- r &= lzo_bitops_ctz32(v) == i; +- } +#if defined(lzo_bitops_cttz32) + { unsigned i = 0; lzo_uint32_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_cttz32(v) == i; + r &= lzo_bitops_cttz32_func(v) == i; + }} -+#endif + #endif +-#if defined(lzo_bitops_ctz64) +- { unsigned i; lzo_uint64 v = 1; +- for (i = 0; i < 63; i++, v <<= 1) +- r &= lzo_bitops_ctz64(v) == i; +- } +#if defined(lzo_bitops_cttz64) + { unsigned i = 0; lzo_uint64_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_cttz64(v) == i; + r &= lzo_bitops_cttz64_func(v) == i; + }} -+#endif -+#endif + #endif + #endif + LZO_UNUSED_FUNC(lzo_bitops_unused_funcs); return r == 1 ? LZO_E_OK : LZO_E_ERROR; @@ -8739,8 +5250,3219 @@ index 25a1f68b3..ab2be5f4f 100644 /***** End of minilzo.c *****/ - +diff --git a/grub-core/lib/minilzo/lzoconf.h b/grub-core/lib/minilzo/lzoconf.h +index 1d0fe14fcda..61be29c5dc2 100644 +--- a/grub-core/lib/minilzo/lzoconf.h ++++ b/grub-core/lib/minilzo/lzoconf.h +@@ -2,22 +2,7 @@ + + This file is part of the LZO real-time data compression library. + +- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer ++ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or +@@ -44,9 +29,9 @@ + #ifndef __LZOCONF_H_INCLUDED + #define __LZOCONF_H_INCLUDED 1 + +-#define LZO_VERSION 0x2050 +-#define LZO_VERSION_STRING "2.05" +-#define LZO_VERSION_DATE "Apr 23 2011" ++#define LZO_VERSION 0x2080 ++#define LZO_VERSION_STRING "2.08" ++#define LZO_VERSION_DATE "Jun 29 2014" + + /* internal Autoconf configuration file - only used when building LZO */ + #if defined(LZO_HAVE_CONFIG_H) +@@ -63,7 +48,7 @@ + #if !defined(CHAR_BIT) || (CHAR_BIT != 8) + # error "invalid CHAR_BIT" + #endif +-#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) ++#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) + # error "check your compiler installation" + #endif + #if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) +@@ -85,14 +70,6 @@ extern "C" { + // some core defines + ************************************************************************/ + +-#if !defined(LZO_UINT32_C) +-# if (UINT_MAX < LZO_0xffffffffL) +-# define LZO_UINT32_C(c) c ## UL +-# else +-# define LZO_UINT32_C(c) ((c) + 0U) +-# endif +-#endif +- + /* memory checkers */ + #if !defined(__LZO_CHECKER) + # if defined(__BOUNDS_CHECKING_ON) +@@ -111,28 +88,31 @@ extern "C" { + // integral and pointer types + ************************************************************************/ + +-/* lzo_uint should match size_t */ ++/* lzo_uint must match size_t */ + #if !defined(LZO_UINT_MAX) +-# if defined(LZO_ABI_LLP64) /* WIN64 */ +-# if defined(LZO_OS_WIN64) ++# if (LZO_ABI_LLP64) ++# if (LZO_OS_WIN64) + typedef unsigned __int64 lzo_uint; + typedef __int64 lzo_int; + # else +- typedef unsigned long long lzo_uint; +- typedef long long lzo_int; ++ typedef lzo_ullong_t lzo_uint; ++ typedef lzo_llong_t lzo_int; + # endif ++# define LZO_SIZEOF_LZO_UINT 8 + # define LZO_UINT_MAX 0xffffffffffffffffull + # define LZO_INT_MAX 9223372036854775807LL + # define LZO_INT_MIN (-1LL - LZO_INT_MAX) +-# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */ ++# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ + typedef unsigned int lzo_uint; + typedef int lzo_int; ++# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT + # define LZO_UINT_MAX UINT_MAX + # define LZO_INT_MAX INT_MAX + # define LZO_INT_MIN INT_MIN + # elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint; + typedef long lzo_int; ++# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG + # define LZO_UINT_MAX ULONG_MAX + # define LZO_INT_MAX LONG_MAX + # define LZO_INT_MIN LONG_MIN +@@ -141,63 +121,22 @@ extern "C" { + # endif + #endif + +-/* Integral types with 32 bits or more. */ +-#if !defined(LZO_UINT32_MAX) +-# if (UINT_MAX >= LZO_0xffffffffL) +- typedef unsigned int lzo_uint32; +- typedef int lzo_int32; +-# define LZO_UINT32_MAX UINT_MAX +-# define LZO_INT32_MAX INT_MAX +-# define LZO_INT32_MIN INT_MIN +-# elif (ULONG_MAX >= LZO_0xffffffffL) +- typedef unsigned long lzo_uint32; +- typedef long lzo_int32; +-# define LZO_UINT32_MAX ULONG_MAX +-# define LZO_INT32_MAX LONG_MAX +-# define LZO_INT32_MIN LONG_MIN +-# else +-# error "lzo_uint32" +-# endif +-#endif +- +-/* Integral types with exactly 64 bits. */ +-#if !defined(LZO_UINT64_MAX) +-# if (LZO_UINT_MAX >= LZO_0xffffffffL) +-# if ((((LZO_UINT_MAX) >> 31) >> 31) == 3) +-# define lzo_uint64 lzo_uint +-# define lzo_int64 lzo_int +-# define LZO_UINT64_MAX LZO_UINT_MAX +-# define LZO_INT64_MAX LZO_INT_MAX +-# define LZO_INT64_MIN LZO_INT_MIN +-# endif +-# elif (ULONG_MAX >= LZO_0xffffffffL) +-# if ((((ULONG_MAX) >> 31) >> 31) == 3) +- typedef unsigned long lzo_uint64; +- typedef long lzo_int64; +-# define LZO_UINT64_MAX ULONG_MAX +-# define LZO_INT64_MAX LONG_MAX +-# define LZO_INT64_MIN LONG_MIN +-# endif +-# endif +-#endif +- +-/* The larger type of lzo_uint and lzo_uint32. */ +-#if (LZO_UINT_MAX >= LZO_UINT32_MAX) ++/* The larger type of lzo_uint and lzo_uint32_t. */ ++#if (LZO_SIZEOF_LZO_UINT >= 4) + # define lzo_xint lzo_uint + #else +-# define lzo_xint lzo_uint32 ++# define lzo_xint lzo_uint32_t + #endif + +-/* Memory model that allows to access memory at offsets of lzo_uint. */ +-#if !defined(__LZO_MMODEL) +-# if (LZO_UINT_MAX <= UINT_MAX) +-# define __LZO_MMODEL /*empty*/ +-# elif defined(LZO_HAVE_MM_HUGE_PTR) +-# define __LZO_MMODEL_HUGE 1 +-# define __LZO_MMODEL __huge +-# else +-# define __LZO_MMODEL /*empty*/ +-# endif ++typedef int lzo_bool; ++ ++/* sanity checks */ ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) ++ ++#ifndef __LZO_MMODEL ++#define __LZO_MMODEL /*empty*/ + #endif + + /* no typedef here because of const-pointer issues */ +@@ -206,21 +145,52 @@ extern "C" { + #define lzo_voidp void __LZO_MMODEL * + #define lzo_shortp short __LZO_MMODEL * + #define lzo_ushortp unsigned short __LZO_MMODEL * +-#define lzo_uint32p lzo_uint32 __LZO_MMODEL * +-#define lzo_int32p lzo_int32 __LZO_MMODEL * +-#if defined(LZO_UINT64_MAX) +-#define lzo_uint64p lzo_uint64 __LZO_MMODEL * +-#define lzo_int64p lzo_int64 __LZO_MMODEL * +-#endif +-#define lzo_uintp lzo_uint __LZO_MMODEL * + #define lzo_intp lzo_int __LZO_MMODEL * ++#define lzo_uintp lzo_uint __LZO_MMODEL * + #define lzo_xintp lzo_xint __LZO_MMODEL * + #define lzo_voidpp lzo_voidp __LZO_MMODEL * + #define lzo_bytepp lzo_bytep __LZO_MMODEL * +-/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ +-#define lzo_byte unsigned char __LZO_MMODEL + +-typedef int lzo_bool; ++#define lzo_int8_tp lzo_int8_t __LZO_MMODEL * ++#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL * ++#define lzo_int16_tp lzo_int16_t __LZO_MMODEL * ++#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL * ++#define lzo_int32_tp lzo_int32_t __LZO_MMODEL * ++#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL * ++#if defined(lzo_int64_t) ++#define lzo_int64_tp lzo_int64_t __LZO_MMODEL * ++#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL * ++#endif ++ ++/* Older LZO versions used to support ancient systems and memory models ++ * like 16-bit MSDOS with __huge pointers and Cray PVP, but these ++ * obsolete configurations are not supported any longer. ++ */ ++#if defined(__LZO_MMODEL_HUGE) ++#error "__LZO_MMODEL_HUGE is unsupported" ++#endif ++#if (LZO_MM_PVP) ++#error "LZO_MM_PVP is unsupported" ++#endif ++#if (LZO_SIZEOF_INT < 4) ++#error "LZO_SIZEOF_INT < 4 is unsupported" ++#endif ++#if (__LZO_UINTPTR_T_IS_POINTER) ++#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" ++#endif ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4) ++/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should ++ * work but have not received much testing lately, so be strict here. ++ */ ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp)) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) + + + /*********************************************************************** +@@ -315,7 +285,7 @@ struct lzo_callback_t + /* a progress indicator callback function (set to 0 to disable) */ + lzo_progress_func_t nprogress; + +- /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress ++ /* INFO: the first parameter "self" of the nalloc/nfree/nprogress + * callbacks points back to this struct, so you are free to store + * some extra info in the following variables. */ + lzo_voidp user1; +@@ -343,6 +313,9 @@ struct lzo_callback_t + #define LZO_E_INPUT_NOT_CONSUMED (-8) + #define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ + #define LZO_E_INVALID_ARGUMENT (-10) ++#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */ ++#define LZO_E_OUTPUT_NOT_CONSUMED (-12) ++#define LZO_E_INTERNAL_ERROR (-99) + + + #ifndef lzo_sizeof_dict_t +@@ -356,7 +329,7 @@ struct lzo_callback_t + * compiler's view of various types are consistent. + */ + #define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ +- (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\ ++ (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\ + (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ + (int)sizeof(lzo_callback_t)) + LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); +@@ -379,18 +352,22 @@ LZO_EXTERN(lzo_voidp) + lzo_memset(lzo_voidp buf, int c, lzo_uint len); + + /* checksum functions */ +-LZO_EXTERN(lzo_uint32) +- lzo_adler32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len); +-LZO_EXTERN(lzo_uint32) +- lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len); +-LZO_EXTERN(const lzo_uint32p) ++LZO_EXTERN(lzo_uint32_t) ++ lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); ++LZO_EXTERN(lzo_uint32_t) ++ lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); ++LZO_EXTERN(const lzo_uint32_tp) + lzo_get_crc32_table(void); + + /* misc. */ + LZO_EXTERN(int) _lzo_config_check(void); +-typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u; +-typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u; +-typedef union { void *vp; lzo_bytep bp; lzo_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t; ++typedef union { ++ lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04; ++ void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09; ++#if defined(lzo_int64_t) ++ lzo_uint64_t a10; ++#endif ++} lzo_align_t; + + /* align a char pointer on a boundary that is a multiple of 'size' */ + LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); +@@ -399,9 +376,30 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); + + + /*********************************************************************** +-// deprecated macros - only for backward compatibility with LZO v1.xx ++// deprecated macros - only for backward compatibility + ************************************************************************/ + ++/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ ++#define lzo_byte unsigned char ++/* deprecated type names */ ++#define lzo_int32 lzo_int32_t ++#define lzo_uint32 lzo_uint32_t ++#define lzo_int32p lzo_int32_t __LZO_MMODEL * ++#define lzo_uint32p lzo_uint32_t __LZO_MMODEL * ++#define LZO_INT32_MAX LZO_INT32_C(2147483647) ++#define LZO_UINT32_MAX LZO_UINT32_C(4294967295) ++#if defined(lzo_int64_t) ++#define lzo_int64 lzo_int64_t ++#define lzo_uint64 lzo_uint64_t ++#define lzo_int64p lzo_int64_t __LZO_MMODEL * ++#define lzo_uint64p lzo_uint64_t __LZO_MMODEL * ++#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807) ++#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615) ++#endif ++/* deprecated types */ ++typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; ++typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; ++ + #if defined(LZO_CFG_COMPAT) + + #define __LZOCONF_H 1 +@@ -443,4 +441,4 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); + #endif /* already included */ + + +-/* vim:set ts=4 et: */ ++/* vim:set ts=4 sw=4 et: */ +diff --git a/grub-core/lib/minilzo/lzodefs.h b/grub-core/lib/minilzo/lzodefs.h +index 0e40e332a8d..f4ae9487ebe 100644 +--- a/grub-core/lib/minilzo/lzodefs.h ++++ b/grub-core/lib/minilzo/lzodefs.h +@@ -2,22 +2,7 @@ + + This file is part of the LZO real-time data compression library. + +- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +- Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer ++ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or +@@ -47,12 +32,6 @@ + #if defined(__CYGWIN32__) && !defined(__CYGWIN__) + # define __CYGWIN__ __CYGWIN32__ + #endif +-#if defined(__IBMCPP__) && !defined(__IBMC__) +-# define __IBMC__ __IBMCPP__ +-#endif +-#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +-# define __INTEL_COMPILER __ICL +-#endif + #if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) + # define _ALL_SOURCE 1 + #endif +@@ -61,19 +40,30 @@ + # define __LONG_MAX__ 9223372036854775807L + # endif + #endif +-#if defined(__INTEL_COMPILER) && defined(__linux__) ++#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) ++#if defined(__ARMCC_VERSION) ++# pragma diag_suppress 193 ++#elif defined(__clang__) && defined(__clang_minor__) ++# pragma clang diagnostic ignored "-Wundef" ++#elif defined(__INTEL_COMPILER) + # pragma warning(disable: 193) +-#endif +-#if defined(__KEIL__) && defined(__C166__) ++#elif defined(__KEIL__) && defined(__C166__) + # pragma warning disable = 322 +-#elif 0 && defined(__C251__) +-# pragma warning disable = 322 +-#endif +-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +-# if (_MSC_VER >= 1300) ++#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) ++# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) ++# pragma GCC diagnostic ignored "-Wundef" ++# endif ++#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) ++# if ((_MSC_VER-0) >= 1300) + # pragma warning(disable: 4668) + # endif + #endif ++#endif ++#if 0 && defined(__POCC__) && defined(_WIN32) ++# if (__POCC__ >= 400) ++# pragma warn(disable: 2216) ++# endif ++#endif + #if 0 && defined(__WATCOMC__) + # if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) + # pragma warning 203 9 +@@ -82,13 +72,29 @@ + #if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) + # pragma option -h + #endif ++#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) ++#ifndef _CRT_NONSTDC_NO_DEPRECATE ++#define _CRT_NONSTDC_NO_DEPRECATE 1 ++#endif ++#ifndef _CRT_NONSTDC_NO_WARNINGS ++#define _CRT_NONSTDC_NO_WARNINGS 1 ++#endif ++#ifndef _CRT_SECURE_NO_DEPRECATE ++#define _CRT_SECURE_NO_DEPRECATE 1 ++#endif ++#ifndef _CRT_SECURE_NO_WARNINGS ++#define _CRT_SECURE_NO_WARNINGS 1 ++#endif ++#endif + #if 0 +-#define LZO_0xffffL 0xfffful +-#define LZO_0xffffffffL 0xfffffffful ++#define LZO_0xffffUL 0xfffful ++#define LZO_0xffffffffUL 0xfffffffful + #else +-#define LZO_0xffffL 65535ul +-#define LZO_0xffffffffL 4294967295ul ++#define LZO_0xffffUL 65535ul ++#define LZO_0xffffffffUL 4294967295ul + #endif ++#define LZO_0xffffL LZO_0xffffUL ++#define LZO_0xffffffffL LZO_0xffffffffUL + #if (LZO_0xffffL == LZO_0xffffffffL) + # error "your preprocessor is broken 1" + #endif +@@ -103,6 +109,13 @@ + # error "your preprocessor is broken 4" + #endif + #endif ++#if defined(__COUNTER__) ++# ifndef LZO_CFG_USE_COUNTER ++# define LZO_CFG_USE_COUNTER 1 ++# endif ++#else ++# undef LZO_CFG_USE_COUNTER ++#endif + #if (UINT_MAX == LZO_0xffffL) + #if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) + # if !defined(MSDOS) +@@ -233,14 +246,31 @@ + #endif + #define LZO_PP_STRINGIZE(x) #x + #define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) ++#define LZO_PP_CONCAT0() /*empty*/ ++#define LZO_PP_CONCAT1(a) a + #define LZO_PP_CONCAT2(a,b) a ## b + #define LZO_PP_CONCAT3(a,b,c) a ## b ## c + #define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d + #define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e ++#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f ++#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g ++#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() ++#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) + #define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) + #define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) + #define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) + #define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) ++#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) ++#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) ++#define LZO_PP_EMPTY /*empty*/ ++#define LZO_PP_EMPTY0() /*empty*/ ++#define LZO_PP_EMPTY1(a) /*empty*/ ++#define LZO_PP_EMPTY2(a,b) /*empty*/ ++#define LZO_PP_EMPTY3(a,b,c) /*empty*/ ++#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ ++#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ ++#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ ++#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ + #if 1 + #define LZO_CPP_STRINGIZE(x) #x + #define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +@@ -248,12 +278,16 @@ + #define LZO_CPP_CONCAT3(a,b,c) a ## b ## c + #define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d + #define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e ++#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f ++#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g + #define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) + #define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) + #define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) + #define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) ++#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) ++#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) + #endif +-#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) ++#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) + #if 1 && defined(__cplusplus) + # if !defined(__STDC_CONSTANT_MACROS) + # define __STDC_CONSTANT_MACROS 1 +@@ -263,9 +297,13 @@ + # endif + #endif + #if defined(__cplusplus) +-# define LZO_EXTERN_C extern "C" ++# define LZO_EXTERN_C extern "C" ++# define LZO_EXTERN_C_BEGIN extern "C" { ++# define LZO_EXTERN_C_END } + #else +-# define LZO_EXTERN_C extern ++# define LZO_EXTERN_C extern ++# define LZO_EXTERN_C_BEGIN /*empty*/ ++# define LZO_EXTERN_C_END /*empty*/ + #endif + #if !defined(__LZO_OS_OVERRIDE) + #if (LZO_OS_FREESTANDING) +@@ -366,12 +404,12 @@ + #elif defined(__VMS) + # define LZO_OS_VMS 1 + # define LZO_INFO_OS "vms" +-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) ++#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) + # define LZO_OS_CONSOLE 1 + # define LZO_OS_CONSOLE_PS2 1 + # define LZO_INFO_OS "console" + # define LZO_INFO_OS_CONSOLE "ps2" +-#elif (defined(__mips__) && defined(__psp__)) ++#elif defined(__mips__) && defined(__psp__) + # define LZO_OS_CONSOLE 1 + # define LZO_OS_CONSOLE_PSP 1 + # define LZO_INFO_OS "console" +@@ -399,9 +437,18 @@ + # elif defined(__linux__) || defined(__linux) || defined(__LINUX__) + # define LZO_OS_POSIX_LINUX 1 + # define LZO_INFO_OS_POSIX "linux" +-# elif defined(__APPLE__) || defined(__MACOS__) +-# define LZO_OS_POSIX_MACOSX 1 +-# define LZO_INFO_OS_POSIX "macosx" ++# elif defined(__APPLE__) && defined(__MACH__) ++# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) ++# define LZO_OS_POSIX_DARWIN 1040 ++# define LZO_INFO_OS_POSIX "darwin_iphone" ++# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) ++# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ ++# define LZO_INFO_OS_POSIX "darwin" ++# else ++# define LZO_OS_POSIX_DARWIN 1 ++# define LZO_INFO_OS_POSIX "darwin" ++# endif ++# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN + # elif defined(__minix__) || defined(__minix) + # define LZO_OS_POSIX_MINIX 1 + # define LZO_INFO_OS_POSIX "minix" +@@ -436,18 +483,18 @@ + #endif + #if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) + # if (UINT_MAX != LZO_0xffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + # if (ULONG_MAX != LZO_0xffffffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + #endif + #if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) + # if (UINT_MAX != LZO_0xffffffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + # if (ULONG_MAX != LZO_0xffffffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + #endif + #if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +@@ -463,59 +510,65 @@ + # define LZO_INFO_CC "sdcc" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) + #elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +-# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) ++# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) + # define LZO_INFO_CC "Pathscale C" + # define LZO_INFO_CCVER __PATHSCALE__ +-#elif defined(__INTEL_COMPILER) +-# define LZO_CC_INTELC 1 ++# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) ++# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) ++# endif ++#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) ++# define LZO_CC_INTELC __INTEL_COMPILER + # define LZO_INFO_CC "Intel C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +-# if defined(_WIN32) || defined(_WIN64) +-# define LZO_CC_SYNTAX_MSC 1 +-# else +-# define LZO_CC_SYNTAX_GNUC 1 ++# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) ++# define LZO_CC_INTELC_MSC _MSC_VER ++# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) ++# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) + # endif + #elif defined(__POCC__) && defined(_WIN32) + # define LZO_CC_PELLESC 1 + # define LZO_INFO_CC "Pelles C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) ++#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) + # if defined(__GNUC_PATCHLEVEL__) +-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) ++# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) + # else +-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) ++# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) + # endif ++# define LZO_CC_ARMCC __ARMCC_VERSION ++# define LZO_INFO_CC "ARM C Compiler" ++# define LZO_INFO_CCVER __VERSION__ ++#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) + # if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) +-# define LZO_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__) ++# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) + # else +-# define LZO_CC_CLANG_CLANG 0x010000L ++# define LZO_CC_CLANG 0x010000L ++# endif ++# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) ++# define LZO_CC_CLANG_MSC _MSC_VER ++# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) ++# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) + # endif +-# define LZO_CC_CLANG LZO_CC_CLANG_GNUC + # define LZO_INFO_CC "clang" + # define LZO_INFO_CCVER __VERSION__ + #elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) + # if defined(__GNUC_PATCHLEVEL__) +-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) ++# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) + # else +-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) ++# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) + # endif + # define LZO_CC_LLVM LZO_CC_LLVM_GNUC + # define LZO_INFO_CC "llvm-gcc" + # define LZO_INFO_CCVER __VERSION__ +-#elif defined(__GNUC__) && defined(__VERSION__) +-# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +-# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +-# elif defined(__GNUC_MINOR__) +-# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +-# else +-# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +-# endif +-# define LZO_INFO_CC "gcc" +-# define LZO_INFO_CCVER __VERSION__ + #elif defined(__ACK__) && defined(_ACK) + # define LZO_CC_ACK 1 + # define LZO_INFO_CC "Amsterdam Compiler Kit C" + # define LZO_INFO_CCVER "unknown" ++#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) ++# define LZO_CC_ARMCC __ARMCC_VERSION ++# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION ++# define LZO_INFO_CC "ARM C Compiler" ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) + #elif defined(__AZTEC_C__) + # define LZO_CC_AZTECC 1 + # define LZO_INFO_CC "Aztec C" +@@ -540,10 +593,23 @@ + # define LZO_CC_DECC 1 + # define LZO_INFO_CC "DEC C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) ++#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) ++# define LZO_CC_GHS 1 ++# define LZO_INFO_CC "Green Hills C" ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) ++# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) ++# define LZO_CC_GHS_MSC _MSC_VER ++# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) ++# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) ++# endif + #elif defined(__HIGHC__) + # define LZO_CC_HIGHC 1 + # define LZO_INFO_CC "MetaWare High C" + # define LZO_INFO_CCVER "unknown" ++#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) ++# define LZO_CC_HPACC __HP_aCC ++# define LZO_INFO_CC "HP aCC" ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) + #elif defined(__IAR_SYSTEMS_ICC__) + # define LZO_CC_IARC 1 + # define LZO_INFO_CC "IAR C" +@@ -552,10 +618,14 @@ + # else + # define LZO_INFO_CCVER "unknown" + # endif +-#elif defined(__IBMC__) +-# define LZO_CC_IBMC 1 ++#elif defined(__IBMC__) && ((__IBMC__-0) > 0) ++# define LZO_CC_IBMC __IBMC__ + # define LZO_INFO_CC "IBM C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) ++#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) ++# define LZO_CC_IBMC __IBMCPP__ ++# define LZO_INFO_CC "IBM C" ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) + #elif defined(__KEIL__) && defined(__C166__) + # define LZO_CC_KEILC 1 + # define LZO_INFO_CC "Keil C" +@@ -572,16 +642,8 @@ + # else + # define LZO_INFO_CCVER "unknown" + # endif +-#elif defined(_MSC_VER) +-# define LZO_CC_MSC 1 +-# define LZO_INFO_CC "Microsoft C" +-# if defined(_MSC_FULL_VER) +-# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +-# else +-# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +-# endif +-#elif defined(__MWERKS__) +-# define LZO_CC_MWERKS 1 ++#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) ++# define LZO_CC_MWERKS __MWERKS__ + # define LZO_INFO_CC "Metrowerks C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) + #elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +@@ -592,6 +654,15 @@ + # define LZO_CC_PACIFICC 1 + # define LZO_INFO_CC "Pacific C" + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) ++#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) ++# if defined(__PGIC_PATCHLEVEL__) ++# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) ++# else ++# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" ++# endif ++# define LZO_INFO_CC "Portland Group PGI C" + #elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) + # define LZO_CC_PGI 1 + # define LZO_INFO_CC "Portland Group PGI C" +@@ -606,7 +677,7 @@ + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) + #elif defined(__SUNPRO_C) + # define LZO_INFO_CC "SunPro C" +-# if ((__SUNPRO_C)+0 > 0) ++# if ((__SUNPRO_C-0) > 0) + # define LZO_CC_SUNPROC __SUNPRO_C + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) + # else +@@ -615,7 +686,7 @@ + # endif + #elif defined(__SUNPRO_CC) + # define LZO_INFO_CC "SunPro C" +-# if ((__SUNPRO_CC)+0 > 0) ++# if ((__SUNPRO_CC-0) > 0) + # define LZO_CC_SUNPROC __SUNPRO_CC + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) + # else +@@ -641,16 +712,46 @@ + #elif defined(__ZTC__) + # define LZO_CC_ZORTECHC 1 + # define LZO_INFO_CC "Zortech C" +-# if (__ZTC__ == 0x310) ++# if ((__ZTC__-0) == 0x310) + # define LZO_INFO_CCVER "0x310" + # else + # define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) + # endif ++#elif defined(__GNUC__) && defined(__VERSION__) ++# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) ++# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) ++# elif defined(__GNUC_MINOR__) ++# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) ++# else ++# define LZO_CC_GNUC (__GNUC__ * 0x10000L) ++# endif ++# define LZO_INFO_CC "gcc" ++# define LZO_INFO_CCVER __VERSION__ ++#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) ++# define LZO_CC_MSC _MSC_VER ++# define LZO_INFO_CC "Microsoft C" ++# if defined(_MSC_FULL_VER) ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) ++# else ++# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) ++# endif + #else + # define LZO_CC_UNKNOWN 1 + # define LZO_INFO_CC "unknown" + # define LZO_INFO_CCVER "unknown" + #endif ++#if (LZO_CC_GNUC) && defined(__OPEN64__) ++# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) ++# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) ++# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC ++# endif ++#endif ++#if (LZO_CC_GNUC) && defined(__PCC__) ++# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) ++# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) ++# define LZO_CC_PCC_GNUC LZO_CC_GNUC ++# endif ++#endif + #if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) + # error "LZO_CC_MSC: _MSC_FULL_VER is not defined" + #endif +@@ -668,8 +769,10 @@ + # define LZO_INFO_ARCH "generic" + #elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) + # define LZO_ARCH_I086 1 +-# define LZO_ARCH_IA16 1 + # define LZO_INFO_ARCH "i086" ++#elif defined(__aarch64__) ++# define LZO_ARCH_ARM64 1 ++# define LZO_INFO_ARCH "arm64" + #elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) + # define LZO_ARCH_ALPHA 1 + # define LZO_INFO_ARCH "alpha" +@@ -685,10 +788,10 @@ + # define LZO_INFO_ARCH "arm_thumb" + #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) + # define LZO_ARCH_ARM 1 +-# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) ++# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1) + # define LZO_ARCH_ARM_THUMB 1 + # define LZO_INFO_ARCH "arm_thumb" +-# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) ++# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2) + # define LZO_INFO_ARCH "arm" + # else + # define LZO_INFO_ARCH "arm" +@@ -806,53 +909,147 @@ + # error "FIXME - missing define for CPU architecture" + #endif + #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +-# error "FIXME - missing WIN32 define for CPU architecture" ++# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" + #endif + #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +-# error "FIXME - missing WIN64 define for CPU architecture" ++# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" + #endif + #if (LZO_OS_OS216 || LZO_OS_WIN16) + # define LZO_ARCH_I086PM 1 +-# define LZO_ARCH_IA16PM 1 + #elif 1 && (LZO_OS_DOS16 && defined(BLX286)) + # define LZO_ARCH_I086PM 1 +-# define LZO_ARCH_IA16PM 1 + #elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) + # define LZO_ARCH_I086PM 1 +-# define LZO_ARCH_IA16PM 1 + #elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) + # define LZO_ARCH_I086PM 1 +-# define LZO_ARCH_IA16PM 1 + #endif +-#if (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM) +-# error "this should not happen" ++#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) ++# define LZO_ARCH_X64 1 ++#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) ++# define LZO_ARCH_AMD64 1 + #endif +-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086) +-# error "this should not happen" ++#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) ++# define LZO_ARCH_AARCH64 1 ++#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) ++# define LZO_ARCH_ARM64 1 ++#endif ++#if (LZO_ARCH_I386 && !LZO_ARCH_X86) ++# define LZO_ARCH_X86 1 ++#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) ++# define LZO_ARCH_I386 1 ++#endif ++#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) ++# error "unexpected configuration - check your compiler defines" + #endif + #if (LZO_ARCH_I086) + # if (UINT_MAX != LZO_0xffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + # if (ULONG_MAX != LZO_0xffffffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + #endif + #if (LZO_ARCH_I386) + # if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + # if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + # if (ULONG_MAX != LZO_0xffffffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + #endif +-#if !defined(__LZO_MM_OVERRIDE) ++#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) ++# if !defined(LZO_TARGET_FEATURE_SSE2) ++# if defined(__SSE2__) ++# define LZO_TARGET_FEATURE_SSE2 1 ++# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64)) ++# define LZO_TARGET_FEATURE_SSE2 1 ++# endif ++# endif ++# if !defined(LZO_TARGET_FEATURE_SSSE3) ++# if (LZO_TARGET_FEATURE_SSE2) ++# if defined(__SSSE3__) ++# define LZO_TARGET_FEATURE_SSSE3 1 ++# elif defined(_MSC_VER) && defined(__AVX__) ++# define LZO_TARGET_FEATURE_SSSE3 1 ++# endif ++# endif ++# endif ++# if !defined(LZO_TARGET_FEATURE_SSE4_2) ++# if (LZO_TARGET_FEATURE_SSSE3) ++# if defined(__SSE4_2__) ++# define LZO_TARGET_FEATURE_SSE4_2 1 ++# endif ++# endif ++# endif ++# if !defined(LZO_TARGET_FEATURE_AVX) ++# if (LZO_TARGET_FEATURE_SSSE3) ++# if defined(__AVX__) ++# define LZO_TARGET_FEATURE_AVX 1 ++# endif ++# endif ++# endif ++# if !defined(LZO_TARGET_FEATURE_AVX2) ++# if (LZO_TARGET_FEATURE_AVX) ++# if defined(__AVX2__) ++# define LZO_TARGET_FEATURE_AVX2 1 ++# endif ++# endif ++# endif ++#endif ++#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if (LZO_ARCH_ARM) ++# if !defined(LZO_TARGET_FEATURE_NEON) ++# if defined(__ARM_NEON__) ++# define LZO_TARGET_FEATURE_NEON 1 ++# endif ++# endif ++#elif (LZO_ARCH_ARM64) ++# if !defined(LZO_TARGET_FEATURE_NEON) ++# if 1 ++# define LZO_TARGET_FEATURE_NEON 1 ++# endif ++# endif ++#endif ++#if 0 ++#elif !defined(__LZO_MM_OVERRIDE) + #if (LZO_ARCH_I086) + #if (UINT_MAX != LZO_0xffffL) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + #endif + #if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) + # define LZO_MM_TINY 1 +@@ -879,7 +1076,7 @@ + #elif (LZO_CC_ZORTECHC && defined(__VCM__)) + # define LZO_MM_LARGE 1 + #else +-# error "unknown memory model" ++# error "unknown LZO_ARCH_I086 memory model" + #endif + #if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) + #define LZO_HAVE_MM_HUGE_PTR 1 +@@ -902,10 +1099,10 @@ + #endif + #if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) + # if (LZO_OS_DOS16) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # elif (LZO_CC_ZORTECHC) + # else +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + # endif + #endif + #ifdef __cplusplus +@@ -937,7 +1134,7 @@ extern "C" { + #endif + #elif (LZO_ARCH_C166) + #if !defined(__MODEL__) +-# error "FIXME - C166 __MODEL__" ++# error "FIXME - LZO_ARCH_C166 __MODEL__" + #elif ((__MODEL__) == 0) + # define LZO_MM_SMALL 1 + #elif ((__MODEL__) == 1) +@@ -951,11 +1148,11 @@ extern "C" { + #elif ((__MODEL__) == 5) + # define LZO_MM_XSMALL 1 + #else +-# error "FIXME - C166 __MODEL__" ++# error "FIXME - LZO_ARCH_C166 __MODEL__" + #endif + #elif (LZO_ARCH_MCS251) + #if !defined(__MODEL__) +-# error "FIXME - MCS251 __MODEL__" ++# error "FIXME - LZO_ARCH_MCS251 __MODEL__" + #elif ((__MODEL__) == 0) + # define LZO_MM_SMALL 1 + #elif ((__MODEL__) == 2) +@@ -967,11 +1164,11 @@ extern "C" { + #elif ((__MODEL__) == 5) + # define LZO_MM_XSMALL 1 + #else +-# error "FIXME - MCS251 __MODEL__" ++# error "FIXME - LZO_ARCH_MCS251 __MODEL__" + #endif + #elif (LZO_ARCH_MCS51) + #if !defined(__MODEL__) +-# error "FIXME - MCS51 __MODEL__" ++# error "FIXME - LZO_ARCH_MCS51 __MODEL__" + #elif ((__MODEL__) == 1) + # define LZO_MM_SMALL 1 + #elif ((__MODEL__) == 2) +@@ -983,7 +1180,7 @@ extern "C" { + #elif ((__MODEL__) == 5) + # define LZO_MM_XSMALL 1 + #else +-# error "FIXME - MCS51 __MODEL__" ++# error "FIXME - LZO_ARCH_MCS51 __MODEL__" + #endif + #elif (LZO_ARCH_CRAY_PVP) + # define LZO_MM_PVP 1 +@@ -1010,35 +1207,818 @@ extern "C" { + # error "unknown memory model" + #endif + #endif ++#if !defined(__lzo_gnuc_extension__) ++#if (LZO_CC_GNUC >= 0x020800ul) ++# define __lzo_gnuc_extension__ __extension__ ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_gnuc_extension__ __extension__ ++#elif (LZO_CC_IBMC >= 600) ++# define __lzo_gnuc_extension__ __extension__ ++#else ++#endif ++#endif ++#if !defined(__lzo_gnuc_extension__) ++# define __lzo_gnuc_extension__ /*empty*/ ++#endif ++#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 ++# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) ++# define LZO_CFG_USE_NEW_STYLE_CASTS 0 ++# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) ++# define LZO_CFG_USE_NEW_STYLE_CASTS 0 ++# else ++# define LZO_CFG_USE_NEW_STYLE_CASTS 1 ++# endif ++#endif ++#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_CFG_USE_NEW_STYLE_CASTS 0 ++#endif ++#if !defined(__cplusplus) ++# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) ++# undef LZO_CFG_USE_NEW_STYLE_CASTS ++# endif ++# define LZO_CFG_USE_NEW_STYLE_CASTS 0 ++#endif ++#if !defined(LZO_REINTERPRET_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) ++# endif ++#endif ++#if !defined(LZO_REINTERPRET_CAST) ++# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) ++#endif ++#if !defined(LZO_STATIC_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_STATIC_CAST(t,e) (static_cast (e)) ++# endif ++#endif ++#if !defined(LZO_STATIC_CAST) ++# define LZO_STATIC_CAST(t,e) ((t) (e)) ++#endif ++#if !defined(LZO_STATIC_CAST2) ++# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) ++#endif ++#if !defined(LZO_UNCONST_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_UNCONST_CAST(t,e) (const_cast (e)) ++# elif (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_UNCONST_CAST(t,e) ((t) (e)) ++# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) ++# endif ++#endif ++#if !defined(LZO_UNCONST_CAST) ++# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) ++#endif ++#if !defined(LZO_UNCONST_VOLATILE_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast (e)) ++# elif (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) ++# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) ++# endif ++#endif ++#if !defined(LZO_UNCONST_VOLATILE_CAST) ++# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) ++#endif ++#if !defined(LZO_UNVOLATILE_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_UNVOLATILE_CAST(t,e) (const_cast (e)) ++# elif (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) ++# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) ++# endif ++#endif ++#if !defined(LZO_UNVOLATILE_CAST) ++# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) ++#endif ++#if !defined(LZO_UNVOLATILE_CONST_CAST) ++# if (LZO_CFG_USE_NEW_STYLE_CASTS) ++# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) ++# elif (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) ++# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) ++# endif ++#endif ++#if !defined(LZO_UNVOLATILE_CONST_CAST) ++# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) ++#endif ++#if !defined(LZO_PCAST) ++# if (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_PCAST(t,e) ((t) (e)) ++# endif ++#endif ++#if !defined(LZO_PCAST) ++# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) ++#endif ++#if !defined(LZO_CCAST) ++# if (LZO_HAVE_MM_HUGE_PTR) ++# define LZO_CCAST(t,e) ((t) (e)) ++# endif ++#endif ++#if !defined(LZO_CCAST) ++# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) ++#endif ++#if !defined(LZO_ICONV) ++# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) ++#endif ++#if !defined(LZO_ICAST) ++# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) ++#endif ++#if !defined(LZO_ITRUNC) ++# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) ++#endif ++#if !defined(__lzo_cte) ++# if (LZO_CC_MSC || LZO_CC_WATCOMC) ++# define __lzo_cte(e) ((void)0,(e)) ++# elif 1 ++# define __lzo_cte(e) ((void)0,(e)) ++# endif ++#endif ++#if !defined(__lzo_cte) ++# define __lzo_cte(e) (e) ++#endif ++#if !defined(LZO_BLOCK_BEGIN) ++# define LZO_BLOCK_BEGIN do { ++# define LZO_BLOCK_END } while __lzo_cte(0) ++#endif ++#if !defined(LZO_UNUSED) ++# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) ++# define LZO_UNUSED(var) ((void) &var) ++# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) ++# define LZO_UNUSED(var) if (&var) ; else ++# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) ++# define LZO_UNUSED(var) ((void) &var) ++# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define LZO_UNUSED(var) ((void) var) ++# elif (LZO_CC_MSC && (_MSC_VER < 900)) ++# define LZO_UNUSED(var) if (&var) ; else ++# elif (LZO_CC_KEILC) ++# define LZO_UNUSED(var) {LZO_EXTERN_C int lzo_unused__[1-2*!(sizeof(var)>0)];} ++# elif (LZO_CC_PACIFICC) ++# define LZO_UNUSED(var) ((void) sizeof(var)) ++# elif (LZO_CC_WATCOMC) && defined(__cplusplus) ++# define LZO_UNUSED(var) ((void) var) ++# else ++# define LZO_UNUSED(var) ((void) &var) ++# endif ++#endif ++#if !defined(LZO_UNUSED_FUNC) ++# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) ++# define LZO_UNUSED_FUNC(func) ((void) func) ++# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) ++# define LZO_UNUSED_FUNC(func) if (func) ; else ++# elif (LZO_CC_CLANG || LZO_CC_LLVM) ++# define LZO_UNUSED_FUNC(func) ((void) &func) ++# elif (LZO_CC_MSC && (_MSC_VER < 900)) ++# define LZO_UNUSED_FUNC(func) if (func) ; else ++# elif (LZO_CC_MSC) ++# define LZO_UNUSED_FUNC(func) ((void) &func) ++# elif (LZO_CC_KEILC || LZO_CC_PELLESC) ++# define LZO_UNUSED_FUNC(func) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];} ++# else ++# define LZO_UNUSED_FUNC(func) ((void) func) ++# endif ++#endif ++#if !defined(LZO_UNUSED_LABEL) ++# if (LZO_CC_CLANG >= 0x020800ul) ++# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) ++# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) ++# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l ++# else ++# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l ++# endif ++#endif ++#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) ++# if 0 ++# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var ++# elif 0 && (LZO_CC_GNUC) ++# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var ++# else ++# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init ++# endif ++#endif ++#if !defined(__lzo_inline) ++#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) ++#elif defined(__cplusplus) ++# define __lzo_inline inline ++#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) ++# define __lzo_inline inline ++#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) ++# define __lzo_inline __inline ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) ++# define __lzo_inline __inline__ ++#elif (LZO_CC_DMC) ++# define __lzo_inline __inline ++#elif (LZO_CC_GHS) ++# define __lzo_inline __inline__ ++#elif (LZO_CC_IBMC >= 600) ++# define __lzo_inline __inline__ ++#elif (LZO_CC_INTELC) ++# define __lzo_inline __inline ++#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) ++# define __lzo_inline __inline ++#elif (LZO_CC_MSC && (_MSC_VER >= 900)) ++# define __lzo_inline __inline ++#elif (LZO_CC_SUNPROC >= 0x5100) ++# define __lzo_inline __inline__ ++#endif ++#endif ++#if defined(__lzo_inline) ++# ifndef __lzo_HAVE_inline ++# define __lzo_HAVE_inline 1 ++# endif ++#else ++# define __lzo_inline /*empty*/ ++#endif ++#if !defined(__lzo_forceinline) ++#if (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_IBMC >= 700) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) ++# define __lzo_forceinline __forceinline ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) ++# define __lzo_forceinline __forceinline ++#elif (LZO_CC_PGI >= 0x0d0a00ul) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#elif (LZO_CC_SUNPROC >= 0x5100) ++# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) ++#endif ++#endif ++#if defined(__lzo_forceinline) ++# ifndef __lzo_HAVE_forceinline ++# define __lzo_HAVE_forceinline 1 ++# endif ++#else ++# define __lzo_forceinline __lzo_inline ++#endif ++#if !defined(__lzo_noinline) ++#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) ++# define __lzo_noinline __attribute__((__noinline__,__used__)) ++#elif (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_IBMC >= 700) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) ++# define __lzo_noinline __declspec(noinline) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_noinline __declspec(noinline) ++#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) ++# if defined(__cplusplus) ++# else ++# define __lzo_noinline __declspec(noinline) ++# endif ++#elif (LZO_CC_PGI >= 0x0d0a00ul) ++# define __lzo_noinline __attribute__((__noinline__)) ++#elif (LZO_CC_SUNPROC >= 0x5100) ++# define __lzo_noinline __attribute__((__noinline__)) ++#endif ++#endif ++#if defined(__lzo_noinline) ++# ifndef __lzo_HAVE_noinline ++# define __lzo_HAVE_noinline 1 ++# endif ++#else ++# define __lzo_noinline /*empty*/ ++#endif ++#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if !defined(__lzo_static_inline) ++#if (LZO_CC_IBMC) ++# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline ++#endif ++#endif ++#if !defined(__lzo_static_inline) ++# define __lzo_static_inline static __lzo_inline ++#endif ++#if !defined(__lzo_static_forceinline) ++#if (LZO_CC_IBMC) ++# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline ++#endif ++#endif ++#if !defined(__lzo_static_forceinline) ++# define __lzo_static_forceinline static __lzo_forceinline ++#endif ++#if !defined(__lzo_static_noinline) ++#if (LZO_CC_IBMC) ++# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline ++#endif ++#endif ++#if !defined(__lzo_static_noinline) ++# define __lzo_static_noinline static __lzo_noinline ++#endif ++#if !defined(__lzo_c99_extern_inline) ++#if defined(__GNUC_GNU_INLINE__) ++# define __lzo_c99_extern_inline __lzo_inline ++#elif defined(__GNUC_STDC_INLINE__) ++# define __lzo_c99_extern_inline extern __lzo_inline ++#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) ++# define __lzo_c99_extern_inline extern __lzo_inline ++#endif ++#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) ++# define __lzo_c99_extern_inline __lzo_inline ++#endif ++#endif ++#if defined(__lzo_c99_extern_inline) ++# ifndef __lzo_HAVE_c99_extern_inline ++# define __lzo_HAVE_c99_extern_inline 1 ++# endif ++#else ++# define __lzo_c99_extern_inline /*empty*/ ++#endif ++#if !defined(__lzo_may_alias) ++#if (LZO_CC_GNUC >= 0x030400ul) ++# define __lzo_may_alias __attribute__((__may_alias__)) ++#elif (LZO_CC_CLANG >= 0x020900ul) ++# define __lzo_may_alias __attribute__((__may_alias__)) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 ++# define __lzo_may_alias __attribute__((__may_alias__)) ++#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 ++# define __lzo_may_alias __attribute__((__may_alias__)) ++#endif ++#endif ++#if defined(__lzo_may_alias) ++# ifndef __lzo_HAVE_may_alias ++# define __lzo_HAVE_may_alias 1 ++# endif ++#else ++# define __lzo_may_alias /*empty*/ ++#endif ++#if !defined(__lzo_noreturn) ++#if (LZO_CC_GNUC >= 0x020700ul) ++# define __lzo_noreturn __attribute__((__noreturn__)) ++#elif (LZO_CC_IBMC >= 700) ++# define __lzo_noreturn __attribute__((__noreturn__)) ++#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) ++# define __lzo_noreturn __declspec(noreturn) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) ++# define __lzo_noreturn __attribute__((__noreturn__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_noreturn __attribute__((__noreturn__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) ++# define __lzo_noreturn __declspec(noreturn) ++#elif (LZO_CC_PGI >= 0x0d0a00ul) ++# define __lzo_noreturn __attribute__((__noreturn__)) ++#endif ++#endif ++#if defined(__lzo_noreturn) ++# ifndef __lzo_HAVE_noreturn ++# define __lzo_HAVE_noreturn 1 ++# endif ++#else ++# define __lzo_noreturn /*empty*/ ++#endif ++#if !defined(__lzo_nothrow) ++#if (LZO_CC_GNUC >= 0x030300ul) ++# define __lzo_nothrow __attribute__((__nothrow__)) ++#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) ++# define __lzo_nothrow __declspec(nothrow) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) ++# define __lzo_nothrow __attribute__((__nothrow__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_nothrow __attribute__((__nothrow__)) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) ++# define __lzo_nothrow __declspec(nothrow) ++#endif ++#endif ++#if defined(__lzo_nothrow) ++# ifndef __lzo_HAVE_nothrow ++# define __lzo_HAVE_nothrow 1 ++# endif ++#else ++# define __lzo_nothrow /*empty*/ ++#endif ++#if !defined(__lzo_restrict) ++#if (LZO_CC_GNUC >= 0x030400ul) ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_IBMC >= 1210) ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) ++# define __lzo_restrict __restrict__ ++#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) ++# define __lzo_restrict __restrict ++#elif (LZO_CC_PGI >= 0x0d0a00ul) ++# define __lzo_restrict __restrict__ ++#endif ++#endif ++#if defined(__lzo_restrict) ++# ifndef __lzo_HAVE_restrict ++# define __lzo_HAVE_restrict 1 ++# endif ++#else ++# define __lzo_restrict /*empty*/ ++#endif ++#if !defined(__lzo_alignof) ++#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) ++# define __lzo_alignof(e) __alignof__(e) ++#elif (LZO_CC_GHS) && !defined(__cplusplus) ++# define __lzo_alignof(e) __alignof__(e) ++#elif (LZO_CC_IBMC >= 600) ++# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) ++#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) ++# define __lzo_alignof(e) __alignof__(e) ++#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_alignof(e) __alignof(e) ++#elif (LZO_CC_SUNPROC >= 0x5100) ++# define __lzo_alignof(e) __alignof__(e) ++#endif ++#endif ++#if defined(__lzo_alignof) ++# ifndef __lzo_HAVE_alignof ++# define __lzo_HAVE_alignof 1 ++# endif ++#endif ++#if !defined(__lzo_struct_packed) ++#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) ++#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) ++#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) ++#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) ++#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) ++#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) ++# define __lzo_struct_packed(s) struct s { ++# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); ++# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); ++#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) ++# define __lzo_struct_packed(s) struct s { ++# define __lzo_struct_packed_end() } __attribute__((__packed__)); ++# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); ++#elif (LZO_CC_IBMC >= 700) ++# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { ++# define __lzo_struct_packed_end() } __attribute__((__packed__)); ++# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); ++#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { ++# define __lzo_struct_packed_end() } __pragma(pack(pop)); ++#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) ++# define __lzo_struct_packed(s) _Packed struct s { ++# define __lzo_struct_packed_end() }; ++#endif ++#endif ++#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) ++# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) ++#endif ++#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) ++# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() ++#endif ++#if !defined(__lzo_byte_struct) ++#if defined(__lzo_struct_packed) ++# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() ++# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() ++#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) ++# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); ++# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); ++#endif ++#endif ++#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) ++# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) ++#endif ++#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) ++#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) ++#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) ++#elif (LZO_CC_CILLY || LZO_CC_PCC) ++#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_struct_align16(s) struct __declspec(align(16)) s { ++# define __lzo_struct_align16_end() }; ++# define __lzo_struct_align32(s) struct __declspec(align(32)) s { ++# define __lzo_struct_align32_end() }; ++# define __lzo_struct_align64(s) struct __declspec(align(64)) s { ++# define __lzo_struct_align64_end() }; ++#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_struct_align16(s) struct s { ++# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); ++# define __lzo_struct_align32(s) struct s { ++# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); ++# define __lzo_struct_align64(s) struct s { ++# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); ++#endif ++#endif ++#if !defined(__lzo_union_um) ++#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) ++#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) ++#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) ++#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) ++#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) ++#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) ++# define __lzo_union_am(s) union s { ++# define __lzo_union_am_end() } __lzo_may_alias; ++# define __lzo_union_um(s) union s { ++# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); ++#elif (LZO_CC_IBMC >= 700) ++# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { ++# define __lzo_union_am_end() } __lzo_may_alias; ++# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { ++# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); ++#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) ++# define __lzo_union_um(s) __pragma(pack(push,1)) union s { ++# define __lzo_union_um_end() } __pragma(pack(pop)); ++#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) ++# define __lzo_union_um(s) _Packed union s { ++# define __lzo_union_um_end() }; ++#endif ++#endif ++#if !defined(__lzo_union_am) ++# define __lzo_union_am(s) union s { ++# define __lzo_union_am_end() }; ++#endif ++#if !defined(__lzo_constructor) ++#if (LZO_CC_GNUC >= 0x030400ul) ++# define __lzo_constructor __attribute__((__constructor__,__used__)) ++#elif (LZO_CC_GNUC >= 0x020700ul) ++# define __lzo_constructor __attribute__((__constructor__)) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) ++# define __lzo_constructor __attribute__((__constructor__,__used__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_constructor __attribute__((__constructor__)) ++#endif ++#endif ++#if defined(__lzo_constructor) ++# ifndef __lzo_HAVE_constructor ++# define __lzo_HAVE_constructor 1 ++# endif ++#endif ++#if !defined(__lzo_destructor) ++#if (LZO_CC_GNUC >= 0x030400ul) ++# define __lzo_destructor __attribute__((__destructor__,__used__)) ++#elif (LZO_CC_GNUC >= 0x020700ul) ++# define __lzo_destructor __attribute__((__destructor__)) ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) ++# define __lzo_destructor __attribute__((__destructor__,__used__)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_destructor __attribute__((__destructor__)) ++#endif ++#endif ++#if defined(__lzo_destructor) ++# ifndef __lzo_HAVE_destructor ++# define __lzo_HAVE_destructor 1 ++# endif ++#endif ++#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) ++# error "unexpected configuration - check your compiler defines" ++#endif ++#if !defined(__lzo_likely) && !defined(__lzo_unlikely) ++#if (LZO_CC_GNUC >= 0x030200ul) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#elif (LZO_CC_IBMC >= 1010) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++# define __lzo_likely(e) (__builtin_expect(!!(e),1)) ++# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) ++#endif ++#endif ++#if defined(__lzo_likely) ++# ifndef __lzo_HAVE_likely ++# define __lzo_HAVE_likely 1 ++# endif ++#else ++# define __lzo_likely(e) (e) ++#endif ++#if defined(__lzo_unlikely) ++# ifndef __lzo_HAVE_unlikely ++# define __lzo_HAVE_unlikely 1 ++# endif ++#else ++# define __lzo_unlikely(e) (e) ++#endif ++#if !defined(__lzo_static_unused_void_func) ++# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) ++# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void) ++# else ++# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void) ++# endif ++#endif ++#if !defined(__lzo_loop_forever) ++# if (LZO_CC_IBMC) ++# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END ++# else ++# define __lzo_loop_forever() do { ; } while __lzo_cte(1) ++# endif ++#endif ++#if !defined(__lzo_unreachable) ++#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) ++# define __lzo_unreachable() __builtin_unreachable(); ++#elif (LZO_CC_GNUC >= 0x040500ul) ++# define __lzo_unreachable() __builtin_unreachable(); ++#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 ++# define __lzo_unreachable() __builtin_unreachable(); ++#endif ++#endif ++#if defined(__lzo_unreachable) ++# ifndef __lzo_HAVE_unreachable ++# define __lzo_HAVE_unreachable 1 ++# endif ++#else ++# if 0 ++# define __lzo_unreachable() ((void)0); ++# else ++# define __lzo_unreachable() __lzo_loop_forever(); ++# endif ++#endif ++#ifndef __LZO_CTA_NAME ++#if (LZO_CFG_USE_COUNTER) ++# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) ++#else ++# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) ++#endif ++#endif ++#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) ++# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END ++# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END ++# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END ++# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END ++# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END ++# else ++# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END ++# endif ++#endif ++#if !defined(LZO_COMPILE_TIME_ASSERT) ++# if (LZO_CC_AZTECC) ++# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} ++# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) ++# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} ++# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) ++# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} ++# elif (LZO_CC_GNUC >= 0x040700ul) ++# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} ++# elif (LZO_CC_MSC && (_MSC_VER < 900)) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) ++# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; ++# else ++# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} ++# endif ++#endif ++LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) ++#if defined(__cplusplus) ++extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } ++#endif ++LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) ++#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) ++# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) ++# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) ++# define __lzo_cdecl __cdecl ++# define __lzo_cdecl_atexit /*empty*/ ++# define __lzo_cdecl_main __cdecl ++# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) ++# define __lzo_cdecl_qsort __pascal ++# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) ++# define __lzo_cdecl_qsort _stdcall ++# else ++# define __lzo_cdecl_qsort __cdecl ++# endif ++# elif (LZO_CC_WATCOMC) ++# define __lzo_cdecl __cdecl ++# else ++# define __lzo_cdecl __cdecl ++# define __lzo_cdecl_atexit __cdecl ++# define __lzo_cdecl_main __cdecl ++# define __lzo_cdecl_qsort __cdecl ++# endif ++# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) ++# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) ++# define __lzo_cdecl_sighandler __pascal ++# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) ++# define __lzo_cdecl_sighandler _stdcall ++# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) ++# define __lzo_cdecl_sighandler __clrcall ++# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) ++# if defined(_DLL) ++# define __lzo_cdecl_sighandler _far _cdecl _loadds ++# elif defined(_MT) ++# define __lzo_cdecl_sighandler _far _cdecl ++# else ++# define __lzo_cdecl_sighandler _cdecl ++# endif ++# else ++# define __lzo_cdecl_sighandler __cdecl ++# endif ++#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) ++# define __lzo_cdecl __cdecl ++#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) ++# define __lzo_cdecl cdecl ++#endif ++#if !defined(__lzo_cdecl) ++# define __lzo_cdecl /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_atexit) ++# define __lzo_cdecl_atexit /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_main) ++# define __lzo_cdecl_main /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_qsort) ++# define __lzo_cdecl_qsort /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_sighandler) ++# define __lzo_cdecl_sighandler /*empty*/ ++#endif ++#if !defined(__lzo_cdecl_va) ++# define __lzo_cdecl_va __lzo_cdecl ++#endif ++#if !(LZO_CFG_NO_WINDOWS_H) ++#if !defined(LZO_HAVE_WINDOWS_H) ++#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) ++# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) ++# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) ++# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) ++# else ++# define LZO_HAVE_WINDOWS_H 1 ++# endif ++#endif ++#endif ++#endif ++#ifndef LZO_SIZEOF_SHORT + #if defined(SIZEOF_SHORT) + # define LZO_SIZEOF_SHORT (SIZEOF_SHORT) ++#elif defined(__SIZEOF_SHORT__) ++# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) + #endif ++#endif ++#ifndef LZO_SIZEOF_INT + #if defined(SIZEOF_INT) + # define LZO_SIZEOF_INT (SIZEOF_INT) ++#elif defined(__SIZEOF_INT__) ++# define LZO_SIZEOF_INT (__SIZEOF_INT__) + #endif ++#endif ++#ifndef LZO_SIZEOF_LONG + #if defined(SIZEOF_LONG) + # define LZO_SIZEOF_LONG (SIZEOF_LONG) ++#elif defined(__SIZEOF_LONG__) ++# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) + #endif ++#endif ++#ifndef LZO_SIZEOF_LONG_LONG + #if defined(SIZEOF_LONG_LONG) + # define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) ++#elif defined(__SIZEOF_LONG_LONG__) ++# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) + #endif ++#endif ++#ifndef LZO_SIZEOF___INT16 + #if defined(SIZEOF___INT16) + # define LZO_SIZEOF___INT16 (SIZEOF___INT16) + #endif ++#endif ++#ifndef LZO_SIZEOF___INT32 + #if defined(SIZEOF___INT32) + # define LZO_SIZEOF___INT32 (SIZEOF___INT32) + #endif ++#endif ++#ifndef LZO_SIZEOF___INT64 + #if defined(SIZEOF___INT64) + # define LZO_SIZEOF___INT64 (SIZEOF___INT64) + #endif ++#endif ++#ifndef LZO_SIZEOF_VOID_P + #if defined(SIZEOF_VOID_P) + # define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) ++#elif defined(__SIZEOF_POINTER__) ++# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) + #endif ++#endif ++#ifndef LZO_SIZEOF_SIZE_T + #if defined(SIZEOF_SIZE_T) + # define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) ++#elif defined(__SIZEOF_SIZE_T__) ++# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) + #endif ++#endif ++#ifndef LZO_SIZEOF_PTRDIFF_T + #if defined(SIZEOF_PTRDIFF_T) + # define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) ++#elif defined(__SIZEOF_PTRDIFF_T__) ++# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) ++#endif + #endif + #define __LZO_LSR(x,b) (((x)+0ul) >> (b)) + #if !defined(LZO_SIZEOF_SHORT) +@@ -1060,6 +2040,7 @@ extern "C" { + # error "LZO_SIZEOF_SHORT" + # endif + #endif ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) + #if !defined(LZO_SIZEOF_INT) + # if (LZO_ARCH_CRAY_PVP) + # define LZO_SIZEOF_INT 8 +@@ -1081,6 +2062,7 @@ extern "C" { + # error "LZO_SIZEOF_INT" + # endif + #endif ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) + #if !defined(LZO_SIZEOF_LONG) + # if (ULONG_MAX == LZO_0xffffffffL) + # define LZO_SIZEOF_LONG 4 +@@ -1090,6 +2072,8 @@ extern "C" { + # define LZO_SIZEOF_LONG 2 + # elif (__LZO_LSR(ULONG_MAX,31) == 1) + # define LZO_SIZEOF_LONG 4 ++# elif (__LZO_LSR(ULONG_MAX,39) == 1) ++# define LZO_SIZEOF_LONG 5 + # elif (__LZO_LSR(ULONG_MAX,63) == 1) + # define LZO_SIZEOF_LONG 8 + # elif (__LZO_LSR(ULONG_MAX,127) == 1) +@@ -1098,11 +2082,12 @@ extern "C" { + # error "LZO_SIZEOF_LONG" + # endif + #endif ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) + #if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) + #if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) + # if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) + # if (LZO_CC_GNUC >= 0x030300ul) +-# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) ++# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) + # define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG + # elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) + # define LZO_SIZEOF_LONG_LONG 4 +@@ -1116,7 +2101,7 @@ extern "C" { + #if (LZO_ARCH_I086 && LZO_CC_DMC) + #elif (LZO_CC_CILLY) && defined(__GNUC__) + # define LZO_SIZEOF_LONG_LONG 8 +-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) ++#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) + # define LZO_SIZEOF_LONG_LONG 8 + #elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) + # define LZO_SIZEOF_LONG_LONG 8 +@@ -1138,11 +2123,13 @@ extern "C" { + # define LZO_SIZEOF___INT64 8 + #elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) + # define LZO_SIZEOF___INT64 8 +-#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) ++#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) ++# define LZO_SIZEOF_LONG_LONG 8 ++#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) + # define LZO_SIZEOF___INT64 8 + #elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) + # define LZO_SIZEOF_LONG_LONG 8 +-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) ++#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) + # define LZO_SIZEOF_LONG_LONG 8 + #elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) + #elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +@@ -1155,87 +2142,127 @@ extern "C" { + # undef LZO_SIZEOF_LONG_LONG + # endif + #endif +-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) ++#if (LZO_CFG_NO_LONG_LONG) ++# undef LZO_SIZEOF_LONG_LONG ++#elif defined(__NO_LONG_LONG) ++# undef LZO_SIZEOF_LONG_LONG ++#elif defined(_NO_LONGLONG) + # undef LZO_SIZEOF_LONG_LONG + #endif +-#if !defined(LZO_SIZEOF_VOID_P) +-#if (LZO_ARCH_I086) +-# define __LZO_WORDSIZE 2 +-# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +-# define LZO_SIZEOF_VOID_P 2 +-# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +-# define LZO_SIZEOF_VOID_P 4 ++#if !defined(LZO_WORDSIZE) ++#if (LZO_ARCH_ALPHA) ++# define LZO_WORDSIZE 8 ++#elif (LZO_ARCH_AMD64) ++# define LZO_WORDSIZE 8 ++#elif (LZO_ARCH_AVR) ++# define LZO_WORDSIZE 1 ++#elif (LZO_ARCH_H8300) ++# if defined(__NORMAL_MODE__) ++# define LZO_WORDSIZE 4 ++# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) ++# define LZO_WORDSIZE 4 + # else +-# error "LZO_MM" ++# define LZO_WORDSIZE 2 + # endif +-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +-# define __LZO_WORDSIZE 1 ++#elif (LZO_ARCH_I086) ++# define LZO_WORDSIZE 2 ++#elif (LZO_ARCH_IA64) ++# define LZO_WORDSIZE 8 ++#elif (LZO_ARCH_M16C) ++# define LZO_WORDSIZE 2 ++#elif (LZO_ARCH_SPU) ++# define LZO_WORDSIZE 4 ++#elif (LZO_ARCH_Z80) ++# define LZO_WORDSIZE 1 ++#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) ++# define LZO_WORDSIZE 8 ++#elif (LZO_OS_OS400 || defined(__OS400__)) ++# define LZO_WORDSIZE 8 ++#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) ++# define LZO_WORDSIZE 8 ++#endif ++#endif ++#if !defined(LZO_SIZEOF_VOID_P) ++#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) ++# define LZO_SIZEOF_VOID_P 4 ++#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) ++# define LZO_SIZEOF_VOID_P 8 ++#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) ++# define LZO_SIZEOF_VOID_P 8 ++#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) ++# define LZO_SIZEOF_VOID_P 8 ++#elif (LZO_ARCH_AVR) + # define LZO_SIZEOF_VOID_P 2 + #elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) + # define LZO_SIZEOF_VOID_P 2 + #elif (LZO_ARCH_H8300) + # if defined(__NORMAL_MODE__) +-# define __LZO_WORDSIZE 4 + # define LZO_SIZEOF_VOID_P 2 + # elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +-# define __LZO_WORDSIZE 4 + # define LZO_SIZEOF_VOID_P 4 + # else +-# define __LZO_WORDSIZE 2 + # define LZO_SIZEOF_VOID_P 2 + # endif + # if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) + # define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT + # define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT + # endif ++#elif (LZO_ARCH_I086) ++# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) ++# define LZO_SIZEOF_VOID_P 2 ++# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) ++# define LZO_SIZEOF_VOID_P 4 ++# else ++# error "invalid LZO_ARCH_I086 memory model" ++# endif + #elif (LZO_ARCH_M16C) +-# define __LZO_WORDSIZE 2 + # if defined(__m32c_cpu__) || defined(__m32cm_cpu__) + # define LZO_SIZEOF_VOID_P 4 + # else + # define LZO_SIZEOF_VOID_P 2 + # endif ++#elif (LZO_ARCH_SPU) ++# define LZO_SIZEOF_VOID_P 4 ++#elif (LZO_ARCH_Z80) ++# define LZO_SIZEOF_VOID_P 2 + #elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +-# define __LZO_WORDSIZE 8 + # define LZO_SIZEOF_VOID_P 4 +-#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +-# define __LZO_WORDSIZE 8 +-# define LZO_SIZEOF_VOID_P 8 +-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +-# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG + #elif (LZO_OS_OS400 || defined(__OS400__)) +-# define __LZO_WORDSIZE LZO_SIZEOF_LONG +-# define LZO_SIZEOF_VOID_P 16 +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +-# define LZO_SIZEOF_VOID_P 8 +-# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +-# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +-#elif (LZO_ARCH_SPU) +-# if 0 +-# define __LZO_WORDSIZE 16 +-# endif +-# define LZO_SIZEOF_VOID_P 4 +-#else +-# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +-#endif +-#endif +-#if !defined(LZO_WORDSIZE) +-# if defined(__LZO_WORDSIZE) +-# define LZO_WORDSIZE __LZO_WORDSIZE ++# if defined(__LLP64_IFC__) ++# define LZO_SIZEOF_VOID_P 8 ++# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG ++# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG + # else +-# define LZO_WORDSIZE LZO_SIZEOF_VOID_P ++# define LZO_SIZEOF_VOID_P 16 ++# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG ++# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG + # endif ++#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) ++# define LZO_SIZEOF_VOID_P 8 ++# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG ++# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG + #endif ++#endif ++#if !defined(LZO_SIZEOF_VOID_P) ++# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG ++#endif ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) + #if !defined(LZO_SIZEOF_SIZE_T) + #if (LZO_ARCH_I086 || LZO_ARCH_M16C) + # define LZO_SIZEOF_SIZE_T 2 +-#else ++#endif ++#endif ++#if !defined(LZO_SIZEOF_SIZE_T) + # define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P + #endif ++#if defined(offsetof) ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) + #endif + #if !defined(LZO_SIZEOF_PTRDIFF_T) + #if (LZO_ARCH_I086) +@@ -1248,11 +2275,18 @@ extern "C" { + # define LZO_SIZEOF_PTRDIFF_T 2 + # endif + # else +-# error "LZO_MM" ++# error "invalid LZO_ARCH_I086 memory model" + # endif +-#else ++#endif ++#endif ++#if !defined(LZO_SIZEOF_PTRDIFF_T) + # define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T + #endif ++#if defined(offsetof) ++LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) ++#endif ++#if !defined(LZO_WORDSIZE) ++# define LZO_WORDSIZE LZO_SIZEOF_VOID_P + #endif + #if (LZO_ABI_NEUTRAL_ENDIAN) + # undef LZO_ABI_BIG_ENDIAN +@@ -1264,7 +2298,7 @@ extern "C" { + # define LZO_ABI_LITTLE_ENDIAN 1 + #elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) + # define LZO_ABI_LITTLE_ENDIAN 1 +-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390) ++#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) + # if (__LITTLE_ENDIAN__ == 1) +@@ -1280,6 +2314,19 @@ extern "C" { + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) + # define LZO_ABI_LITTLE_ENDIAN 1 ++#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) ++# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) ++# error "unexpected configuration - check your compiler defines" ++# elif defined(__BIG_ENDIAN) ++# define LZO_ABI_BIG_ENDIAN 1 ++# else ++# define LZO_ABI_LITTLE_ENDIAN 1 ++# endif ++# define LZO_ABI_LITTLE_ENDIAN 1 ++#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) ++# define LZO_ABI_BIG_ENDIAN 1 ++#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) ++# define LZO_ABI_LITTLE_ENDIAN 1 + #elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) + # define LZO_ABI_BIG_ENDIAN 1 + #elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +@@ -1287,7 +2334,7 @@ extern "C" { + #endif + #endif + #if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) +-# error "this should not happen" ++# error "unexpected configuration - check your compiler defines" + #endif + #if (LZO_ABI_BIG_ENDIAN) + # define LZO_INFO_ABI_ENDIAN "be" +@@ -1302,6 +2349,9 @@ extern "C" { + #elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) + # define LZO_ABI_ILP16 1 + # define LZO_INFO_ABI_PM "ilp16" ++#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) ++# define LZO_ABI_LP32 1 ++# define LZO_INFO_ABI_PM "lp32" + #elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) + # define LZO_ABI_ILP32 1 + # define LZO_INFO_ABI_PM "ilp32" +@@ -1318,7 +2368,8 @@ extern "C" { + # define LZO_ABI_IP32L64 1 + # define LZO_INFO_ABI_PM "ip32l64" + #endif +-#if !defined(__LZO_LIBC_OVERRIDE) ++#if 0 ++#elif !defined(__LZO_LIBC_OVERRIDE) + #if (LZO_LIBC_NAKED) + # define LZO_INFO_LIBC "naked" + #elif (LZO_LIBC_FREESTANDING) +@@ -1329,6 +2380,9 @@ extern "C" { + # define LZO_INFO_LIBC "isoc90" + #elif (LZO_LIBC_ISOC99) + # define LZO_INFO_LIBC "isoc99" ++#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) ++# define LZO_LIBC_ISOC90 1 ++# define LZO_INFO_LIBC "isoc90" + #elif defined(__dietlibc__) + # define LZO_LIBC_DIETLIBC 1 + # define LZO_INFO_LIBC "dietlibc" +@@ -1337,13 +2391,13 @@ extern "C" { + # define LZO_INFO_LIBC "newlib" + #elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) + # if defined(__UCLIBC_SUBLEVEL__) +-# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) ++# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) + # else + # define LZO_LIBC_UCLIBC 0x00090bL + # endif +-# define LZO_INFO_LIBC "uclibc" ++# define LZO_INFO_LIBC "uc" "libc" + #elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +-# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) ++# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) + # define LZO_INFO_LIBC "glibc" + #elif (LZO_CC_MWERKS) && defined(__MSL__) + # define LZO_LIBC_MSL __MSL__ +@@ -1356,423 +2410,159 @@ extern "C" { + # define LZO_INFO_LIBC "default" + #endif + #endif +-#if !defined(__lzo_gnuc_extension__) +-#if (LZO_CC_GNUC >= 0x020800ul) +-# define __lzo_gnuc_extension__ __extension__ +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_gnuc_extension__ __extension__ +-#else +-# define __lzo_gnuc_extension__ /*empty*/ +-#endif +-#endif +-#if !defined(__lzo_ua_volatile) +-# define __lzo_ua_volatile volatile +-#endif +-#if !defined(__lzo_alignof) +-#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +-# define __lzo_alignof(e) __alignof__(e) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +-# define __lzo_alignof(e) __alignof__(e) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +-# define __lzo_alignof(e) __alignof(e) +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_alignof(e) __alignof__(e) +-#endif +-#endif +-#if defined(__lzo_alignof) +-# define __lzo_HAVE_alignof 1 +-#endif +-#if !defined(__lzo_constructor) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_constructor __attribute__((__constructor__,__used__)) +-#elif (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_constructor __attribute__((__constructor__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_constructor __attribute__((__constructor__)) +-#endif +-#endif +-#if defined(__lzo_constructor) +-# define __lzo_HAVE_constructor 1 +-#endif +-#if !defined(__lzo_destructor) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_destructor __attribute__((__destructor__,__used__)) +-#elif (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_destructor __attribute__((__destructor__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_destructor __attribute__((__destructor__)) +-#endif +-#endif +-#if defined(__lzo_destructor) +-# define __lzo_HAVE_destructor 1 +-#endif +-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +-# error "this should not happen" +-#endif +-#if !defined(__lzo_inline) +-#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +-#elif defined(__cplusplus) +-# define __lzo_inline inline +-#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +-# define __lzo_inline __inline +-#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +-# define __lzo_inline __inline__ +-#elif (LZO_CC_DMC) +-# define __lzo_inline __inline +-#elif (LZO_CC_INTELC) +-# define __lzo_inline __inline +-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +-# define __lzo_inline __inline +-#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +-# define __lzo_inline __inline +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_inline __inline__ +-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +-# define __lzo_inline inline +-#endif +-#endif +-#if defined(__lzo_inline) +-# define __lzo_HAVE_inline 1 +-#else +-# define __lzo_inline /*empty*/ +-#endif +-#if !defined(__lzo_forceinline) +-#if (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +-# define __lzo_forceinline __forceinline +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +-# define __lzo_forceinline __forceinline +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +-#endif +-#endif +-#if defined(__lzo_forceinline) +-# define __lzo_HAVE_forceinline 1 +-#else +-# define __lzo_forceinline /*empty*/ +-#endif +-#if !defined(__lzo_noinline) +-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +-# define __lzo_noinline __attribute__((__noinline__,__used__)) +-#elif (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +-# define __lzo_noinline __declspec(noinline) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_noinline __attribute__((__noinline__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +-# define __lzo_noinline __declspec(noinline) +-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +-# if defined(__cplusplus) +-# else +-# define __lzo_noinline __declspec(noinline) +-# endif +-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100)) +-# define __lzo_noinline __attribute__((__noinline__)) +-#endif +-#endif +-#if defined(__lzo_noinline) +-# define __lzo_HAVE_noinline 1 +-#else +-# define __lzo_noinline /*empty*/ +-#endif +-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +-# error "this should not happen" +-#endif +-#if !defined(__lzo_noreturn) +-#if (LZO_CC_GNUC >= 0x020700ul) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +-# define __lzo_noreturn __declspec(noreturn) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_noreturn __attribute__((__noreturn__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +-# define __lzo_noreturn __declspec(noreturn) +-#endif +-#endif +-#if defined(__lzo_noreturn) +-# define __lzo_HAVE_noreturn 1 +-#else +-# define __lzo_noreturn /*empty*/ +-#endif +-#if !defined(__lzo_nothrow) +-#if (LZO_CC_GNUC >= 0x030300ul) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +-# define __lzo_nothrow __declspec(nothrow) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_nothrow __attribute__((__nothrow__)) +-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +-# define __lzo_nothrow __declspec(nothrow) +-#endif +-#endif +-#if defined(__lzo_nothrow) +-# define __lzo_HAVE_nothrow 1 +-#else +-# define __lzo_nothrow /*empty*/ +-#endif +-#if !defined(__lzo_restrict) +-#if (LZO_CC_GNUC >= 0x030400ul) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_CLANG || LZO_CC_LLVM) +-# define __lzo_restrict __restrict__ +-#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +-# define __lzo_restrict __restrict +-#endif +-#endif +-#if defined(__lzo_restrict) +-# define __lzo_HAVE_restrict 1 +-#else +-# define __lzo_restrict /*empty*/ +-#endif +-#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +-#if (LZO_CC_GNUC >= 0x030200ul) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +-#endif +-#endif +-#if defined(__lzo_likely) +-# define __lzo_HAVE_likely 1 +-#else +-# define __lzo_likely(e) (e) +-#endif +-#if defined(__lzo_unlikely) +-# define __lzo_HAVE_unlikely 1 +-#else +-# define __lzo_unlikely(e) (e) +-#endif +-#if !defined(LZO_UNUSED) +-# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +-# define LZO_UNUSED(var) ((void) &var) +-# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +-# define LZO_UNUSED(var) if (&var) ; else +-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define LZO_UNUSED(var) ((void) var) +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_UNUSED(var) if (&var) ; else +-# elif (LZO_CC_KEILC) +-# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +-# elif (LZO_CC_PACIFICC) +-# define LZO_UNUSED(var) ((void) sizeof(var)) +-# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +-# define LZO_UNUSED(var) ((void) var) +-# else +-# define LZO_UNUSED(var) ((void) &var) +-# endif +-#endif +-#if !defined(LZO_UNUSED_FUNC) +-# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +-# define LZO_UNUSED_FUNC(func) ((void) func) +-# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +-# define LZO_UNUSED_FUNC(func) if (func) ; else +-# elif (LZO_CC_CLANG || LZO_CC_LLVM) +-# define LZO_UNUSED_FUNC(func) ((void) &func) +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_UNUSED_FUNC(func) if (func) ; else +-# elif (LZO_CC_MSC) +-# define LZO_UNUSED_FUNC(func) ((void) &func) +-# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +-# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +-# else +-# define LZO_UNUSED_FUNC(func) ((void) func) +-# endif +-#endif +-#if !defined(LZO_UNUSED_LABEL) +-# if (LZO_CC_WATCOMC) && defined(__cplusplus) +-# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +-# elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +-# define LZO_UNUSED_LABEL(l) if (0) goto l +-# else +-# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +-# endif +-#endif +-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +-# if 0 +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +-# elif 0 && (LZO_CC_GNUC) +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +-# else +-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +-# endif +-#endif +-#if !defined(LZO_UNCONST_CAST) +-# if 0 && defined(__cplusplus) +-# define LZO_UNCONST_CAST(t,e) (const_cast (e)) +-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e)))))) +-# else +-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e))))) +-# endif +-#endif +-#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +-# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +-# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +-# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +-# else +-# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +-# endif +-#endif +-#if !defined(LZO_COMPILE_TIME_ASSERT) +-# if (LZO_CC_AZTECC) +-# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +-# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# elif (LZO_CC_MSC && (_MSC_VER < 900)) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +-# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +-# else +-# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +-# endif +-#endif +-#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +-# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +-# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +-# define __lzo_cdecl __cdecl +-# define __lzo_cdecl_atexit /*empty*/ +-# define __lzo_cdecl_main __cdecl +-# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +-# define __lzo_cdecl_qsort __pascal +-# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +-# define __lzo_cdecl_qsort _stdcall +-# else +-# define __lzo_cdecl_qsort __cdecl +-# endif +-# elif (LZO_CC_WATCOMC) +-# define __lzo_cdecl __cdecl +-# else +-# define __lzo_cdecl __cdecl +-# define __lzo_cdecl_atexit __cdecl +-# define __lzo_cdecl_main __cdecl +-# define __lzo_cdecl_qsort __cdecl +-# endif +-# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +-# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +-# define __lzo_cdecl_sighandler __pascal +-# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +-# define __lzo_cdecl_sighandler _stdcall +-# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +-# define __lzo_cdecl_sighandler __clrcall +-# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +-# if defined(_DLL) +-# define __lzo_cdecl_sighandler _far _cdecl _loadds +-# elif defined(_MT) +-# define __lzo_cdecl_sighandler _far _cdecl +-# else +-# define __lzo_cdecl_sighandler _cdecl +-# endif +-# else +-# define __lzo_cdecl_sighandler __cdecl +-# endif +-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +-# define __lzo_cdecl __cdecl +-#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +-# define __lzo_cdecl cdecl +-#endif +-#if !defined(__lzo_cdecl) +-# define __lzo_cdecl /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_atexit) +-# define __lzo_cdecl_atexit /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_main) +-# define __lzo_cdecl_main /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_qsort) +-# define __lzo_cdecl_qsort /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_sighandler) +-# define __lzo_cdecl_sighandler /*empty*/ +-#endif +-#if !defined(__lzo_cdecl_va) +-# define __lzo_cdecl_va __lzo_cdecl +-#endif +-#if !(LZO_CFG_NO_WINDOWS_H) +-#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +-# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +-# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +-# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +-# else +-# define LZO_HAVE_WINDOWS_H 1 +-# endif ++#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) ++# define LZO_ASM_SYNTAX_MSC 1 ++#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) ++#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) ++#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) ++# define LZO_ASM_SYNTAX_GNUC 1 ++#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) ++# define LZO_ASM_SYNTAX_GNUC 1 ++#elif (LZO_CC_GNUC) ++# define LZO_ASM_SYNTAX_GNUC 1 ++#endif ++#if (LZO_ASM_SYNTAX_GNUC) ++#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) ++# define __LZO_ASM_CLOBBER "ax" ++# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ ++# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ ++# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ ++#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) ++# define __LZO_ASM_CLOBBER "memory" ++# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ ++# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" ++# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ ++#else ++# define __LZO_ASM_CLOBBER "cc", "memory" ++# define __LZO_ASM_CLOBBER_LIST_CC : "cc" ++# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" ++# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ + #endif + #endif + #if (LZO_ARCH_ALPHA) +-# define LZO_OPT_AVOID_UINT_INDEX 1 +-# define LZO_OPT_AVOID_SHORT 1 +-# define LZO_OPT_AVOID_USHORT 1 ++# define LZO_OPT_AVOID_UINT_INDEX 1 + #elif (LZO_ARCH_AMD64) +-# define LZO_OPT_AVOID_INT_INDEX 1 +-# define LZO_OPT_AVOID_UINT_INDEX 1 +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 +-# define LZO_OPT_UNALIGNED64 1 +-#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) ++# define LZO_OPT_AVOID_INT_INDEX 1 ++# define LZO_OPT_AVOID_UINT_INDEX 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED64 ++# define LZO_OPT_UNALIGNED64 1 ++# endif + #elif (LZO_ARCH_ARM) +-# define LZO_OPT_AVOID_SHORT 1 +-# define LZO_OPT_AVOID_USHORT 1 ++# if defined(__ARM_FEATURE_UNALIGNED) ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7) ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M) ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# endif ++#elif (LZO_ARCH_ARM64) ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED64 ++# define LZO_OPT_UNALIGNED64 1 ++# endif + #elif (LZO_ARCH_CRIS) +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif + #elif (LZO_ARCH_I386) +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif + #elif (LZO_ARCH_IA64) +-# define LZO_OPT_AVOID_INT_INDEX 1 +-# define LZO_OPT_AVOID_UINT_INDEX 1 +-# define LZO_OPT_PREFER_POSTINC 1 ++# define LZO_OPT_AVOID_INT_INDEX 1 ++# define LZO_OPT_AVOID_UINT_INDEX 1 ++# define LZO_OPT_PREFER_POSTINC 1 + #elif (LZO_ARCH_M68K) +-# define LZO_OPT_PREFER_POSTINC 1 +-# define LZO_OPT_PREFER_PREDEC 1 ++# define LZO_OPT_PREFER_POSTINC 1 ++# define LZO_OPT_PREFER_PREDEC 1 + # if defined(__mc68020__) && !defined(__mcoldfire__) +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif + # endif + #elif (LZO_ARCH_MIPS) +-# define LZO_OPT_AVOID_UINT_INDEX 1 ++# define LZO_OPT_AVOID_UINT_INDEX 1 + #elif (LZO_ARCH_POWERPC) +-# define LZO_OPT_PREFER_PREINC 1 +-# define LZO_OPT_PREFER_PREDEC 1 ++# define LZO_OPT_PREFER_PREINC 1 ++# define LZO_OPT_PREFER_PREDEC 1 + # if (LZO_ABI_BIG_ENDIAN) +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# if (LZO_WORDSIZE == 8) ++# ifndef LZO_OPT_UNALIGNED64 ++# define LZO_OPT_UNALIGNED64 1 ++# endif ++# endif + # endif + #elif (LZO_ARCH_S390) +-# define LZO_OPT_UNALIGNED16 1 +-# define LZO_OPT_UNALIGNED32 1 +-# if (LZO_SIZEOF_SIZE_T == 8) +-# define LZO_OPT_UNALIGNED64 1 ++# ifndef LZO_OPT_UNALIGNED16 ++# define LZO_OPT_UNALIGNED16 1 ++# endif ++# ifndef LZO_OPT_UNALIGNED32 ++# define LZO_OPT_UNALIGNED32 1 ++# endif ++# if (LZO_WORDSIZE == 8) ++# ifndef LZO_OPT_UNALIGNED64 ++# define LZO_OPT_UNALIGNED64 1 ++# endif + # endif + #elif (LZO_ARCH_SH) +-# define LZO_OPT_PREFER_POSTINC 1 +-# define LZO_OPT_PREFER_PREDEC 1 ++# define LZO_OPT_PREFER_POSTINC 1 ++# define LZO_OPT_PREFER_PREDEC 1 + #endif + #ifndef LZO_CFG_NO_INLINE_ASM +-#if (LZO_CC_LLVM) ++#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) + # define LZO_CFG_NO_INLINE_ASM 1 ++#elif (LZO_CC_LLVM) ++# define LZO_CFG_NO_INLINE_ASM 1 ++#endif + #endif ++#if (LZO_CFG_NO_INLINE_ASM) ++# undef LZO_ASM_SYNTAX_MSC ++# undef LZO_ASM_SYNTAX_GNUC ++# undef __LZO_ASM_CLOBBER ++# undef __LZO_ASM_CLOBBER_LIST_CC ++# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY ++# undef __LZO_ASM_CLOBBER_LIST_EMPTY + #endif + #ifndef LZO_CFG_NO_UNALIGNED + #if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +@@ -1784,25 +2574,6 @@ extern "C" { + # undef LZO_OPT_UNALIGNED32 + # undef LZO_OPT_UNALIGNED64 + #endif +-#if (LZO_CFG_NO_INLINE_ASM) +-#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +-# define LZO_ASM_SYNTAX_MSC 1 +-#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +-#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) +-#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +-# define LZO_ASM_SYNTAX_GNUC 1 +-#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +-# define LZO_ASM_SYNTAX_GNUC 1 +-#endif +-#if (LZO_ASM_SYNTAX_GNUC) +-#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +-# define __LZO_ASM_CLOBBER "ax" +-#elif (LZO_CC_INTELC) +-# define __LZO_ASM_CLOBBER "memory" +-#else +-# define __LZO_ASM_CLOBBER "cc", "memory" +-#endif +-#endif + #if defined(__LZO_INFOSTR_MM) + #elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) + # define __LZO_INFOSTR_MM "" +@@ -1846,7 +2617,382 @@ extern "C" { + #define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER ++#if !(LZO_CFG_SKIP_LZO_TYPES) ++#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) ++# error "missing defines for sizes" ++#endif ++#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) ++# error "missing defines for sizes" ++#endif ++#if !defined(lzo_llong_t) ++#if (LZO_SIZEOF_LONG_LONG+0 > 0) ++__lzo_gnuc_extension__ typedef long long lzo_llong_t__; ++__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; ++# define lzo_llong_t lzo_llong_t__ ++# define lzo_ullong_t lzo_ullong_t__ ++#endif ++#endif ++#if !defined(lzo_int16e_t) ++#if (LZO_SIZEOF_LONG == 2) ++# define lzo_int16e_t long ++# define lzo_uint16e_t unsigned long ++#elif (LZO_SIZEOF_INT == 2) ++# define lzo_int16e_t int ++# define lzo_uint16e_t unsigned int ++#elif (LZO_SIZEOF_SHORT == 2) ++# define lzo_int16e_t short int ++# define lzo_uint16e_t unsigned short int ++#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) ++ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); ++ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); ++# define lzo_int16e_t lzo_int16e_hi_t__ ++# define lzo_uint16e_t lzo_uint16e_hi_t__ ++#elif (LZO_SIZEOF___INT16 == 2) ++# define lzo_int16e_t __int16 ++# define lzo_uint16e_t unsigned __int16 ++#else ++#endif ++#endif ++#if defined(lzo_int16e_t) ++# define LZO_SIZEOF_LZO_INT16E_T 2 ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) ++#endif ++#if !defined(lzo_int32e_t) ++#if (LZO_SIZEOF_LONG == 4) ++# define lzo_int32e_t long int ++# define lzo_uint32e_t unsigned long int ++#elif (LZO_SIZEOF_INT == 4) ++# define lzo_int32e_t int ++# define lzo_uint32e_t unsigned int ++#elif (LZO_SIZEOF_SHORT == 4) ++# define lzo_int32e_t short int ++# define lzo_uint32e_t unsigned short int ++#elif (LZO_SIZEOF_LONG_LONG == 4) ++# define lzo_int32e_t lzo_llong_t ++# define lzo_uint32e_t lzo_ullong_t ++#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) ++ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); ++ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); ++# define lzo_int32e_t lzo_int32e_si_t__ ++# define lzo_uint32e_t lzo_uint32e_si_t__ ++#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) ++ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); ++ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); ++# define lzo_int32e_t lzo_int32e_si_t__ ++# define lzo_uint32e_t lzo_uint32e_si_t__ ++# define LZO_INT32_C(c) (c##LL) ++# define LZO_UINT32_C(c) (c##ULL) ++#elif (LZO_SIZEOF___INT32 == 4) ++# define lzo_int32e_t __int32 ++# define lzo_uint32e_t unsigned __int32 ++#else ++#endif ++#endif ++#if defined(lzo_int32e_t) ++# define LZO_SIZEOF_LZO_INT32E_T 4 ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) ++#endif ++#if !defined(lzo_int64e_t) ++#if (LZO_SIZEOF___INT64 == 8) ++# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) ++# define LZO_CFG_TYPE_PREFER___INT64 1 ++# endif ++#endif ++#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) ++# define lzo_int64e_t int ++# define lzo_uint64e_t unsigned int ++# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT ++#elif (LZO_SIZEOF_LONG == 8) ++# define lzo_int64e_t long int ++# define lzo_uint64e_t unsigned long int ++# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG ++#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) ++# define lzo_int64e_t lzo_llong_t ++# define lzo_uint64e_t lzo_ullong_t ++# if (LZO_CC_BORLANDC) ++# define LZO_INT64_C(c) ((c) + 0ll) ++# define LZO_UINT64_C(c) ((c) + 0ull) ++# elif 0 ++# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) ++# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) ++# else ++# define LZO_INT64_C(c) (c##LL) ++# define LZO_UINT64_C(c) (c##ULL) ++# endif ++# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG ++#elif (LZO_SIZEOF___INT64 == 8) ++# define lzo_int64e_t __int64 ++# define lzo_uint64e_t unsigned __int64 ++# if (LZO_CC_BORLANDC) ++# define LZO_INT64_C(c) ((c) + 0i64) ++# define LZO_UINT64_C(c) ((c) + 0ui64) ++# else ++# define LZO_INT64_C(c) (c##i64) ++# define LZO_UINT64_C(c) (c##ui64) ++# endif ++# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64 ++#else ++#endif ++#endif ++#if defined(lzo_int64e_t) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) ++#endif ++#if !defined(lzo_int32l_t) ++#if defined(lzo_int32e_t) ++# define lzo_int32l_t lzo_int32e_t ++# define lzo_uint32l_t lzo_uint32e_t ++# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T ++#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) ++# define lzo_int32l_t int ++# define lzo_uint32l_t unsigned int ++# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT ++#elif (LZO_SIZEOF_LONG >= 4) ++# define lzo_int32l_t long int ++# define lzo_uint32l_t unsigned long int ++# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG ++#else ++# error "lzo_int32l_t" ++#endif ++#endif ++#if 1 ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) ++#endif ++#if !defined(lzo_int64l_t) ++#if defined(lzo_int64e_t) ++# define lzo_int64l_t lzo_int64e_t ++# define lzo_uint64l_t lzo_uint64e_t ++# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T ++#else ++#endif ++#endif ++#if defined(lzo_int64l_t) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) ++#endif ++#if !defined(lzo_int32f_t) ++#if (LZO_SIZEOF_SIZE_T >= 8) ++# define lzo_int32f_t lzo_int64l_t ++# define lzo_uint32f_t lzo_uint64l_t ++# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T ++#else ++# define lzo_int32f_t lzo_int32l_t ++# define lzo_uint32f_t lzo_uint32l_t ++# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T ++#endif ++#endif ++#if 1 ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) ++#endif ++#if !defined(lzo_int64f_t) ++#if defined(lzo_int64l_t) ++# define lzo_int64f_t lzo_int64l_t ++# define lzo_uint64f_t lzo_uint64l_t ++# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T ++#else ++#endif ++#endif ++#if defined(lzo_int64f_t) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) ++#endif ++#if !defined(lzo_intptr_t) ++#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) ++# define __LZO_INTPTR_T_IS_POINTER 1 ++ typedef char* lzo_intptr_t; ++ typedef char* lzo_uintptr_t; ++# define lzo_intptr_t lzo_intptr_t ++# define lzo_uintptr_t lzo_uintptr_t ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P ++#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) ++ typedef __w64 int lzo_intptr_t; ++ typedef __w64 unsigned int lzo_uintptr_t; ++# define lzo_intptr_t lzo_intptr_t ++# define lzo_uintptr_t lzo_uintptr_t ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT ++#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) ++# define lzo_intptr_t short ++# define lzo_uintptr_t unsigned short ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT ++#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) ++# define lzo_intptr_t int ++# define lzo_uintptr_t unsigned int ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT ++#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) ++# define lzo_intptr_t long ++# define lzo_uintptr_t unsigned long ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG ++#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) ++# define lzo_intptr_t lzo_int64l_t ++# define lzo_uintptr_t lzo_uint64l_t ++# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T ++#else ++# error "lzo_intptr_t" ++#endif ++#endif ++#if 1 ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) ++#endif ++#if !defined(lzo_word_t) ++#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) ++#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) ++# define lzo_word_t lzo_uintptr_t ++# define lzo_sword_t lzo_intptr_t ++# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T ++#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) ++# define lzo_word_t unsigned long ++# define lzo_sword_t long ++# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG ++#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) ++# define lzo_word_t unsigned int ++# define lzo_sword_t int ++# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT ++#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) ++# define lzo_word_t unsigned short ++# define lzo_sword_t short ++# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT ++#elif (LZO_WORDSIZE == 1) ++# define lzo_word_t unsigned char ++# define lzo_sword_t signed char ++# define LZO_SIZEOF_LZO_WORD_T 1 ++#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) ++# define lzo_word_t lzo_uint64l_t ++# define lzo_sword_t lzo_int64l_t ++# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T ++#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) ++#if 0 ++ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); ++ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); ++# define lzo_word_t lzo_word_t ++# define lzo_sword_t lzo_sword_t ++# define LZO_SIZEOF_LZO_WORD_T 16 ++#endif ++#else ++# error "lzo_word_t" ++#endif ++#endif ++#endif ++#if 1 && defined(lzo_word_t) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) ++ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) ++#endif ++#if 1 ++#define lzo_int8_t signed char ++#define lzo_uint8_t unsigned char ++#define LZO_SIZEOF_LZO_INT8_T 1 ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) ++#endif ++#if defined(lzo_int16e_t) ++#define lzo_int16_t lzo_int16e_t ++#define lzo_uint16_t lzo_uint16e_t ++#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) ++#endif ++#if defined(lzo_int32e_t) ++#define lzo_int32_t lzo_int32e_t ++#define lzo_uint32_t lzo_uint32e_t ++#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) ++#endif ++#if defined(lzo_int64e_t) ++#define lzo_int64_t lzo_int64e_t ++#define lzo_uint64_t lzo_uint64e_t ++#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) ++#endif ++#if 1 ++#define lzo_int_least32_t lzo_int32l_t ++#define lzo_uint_least32_t lzo_uint32l_t ++#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) ++#endif ++#if defined(lzo_int64l_t) ++#define lzo_int_least64_t lzo_int64l_t ++#define lzo_uint_least64_t lzo_uint64l_t ++#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) ++#endif ++#if 1 ++#define lzo_int_fast32_t lzo_int32f_t ++#define lzo_uint_fast32_t lzo_uint32f_t ++#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) ++#endif ++#if defined(lzo_int64f_t) ++#define lzo_int_fast64_t lzo_int64f_t ++#define lzo_uint_fast64_t lzo_uint64f_t ++#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) ++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) ++#endif ++#if !defined(LZO_INT16_C) ++# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) ++# define LZO_INT16_C(c) ((c) + 0) ++# define LZO_UINT16_C(c) ((c) + 0U) ++# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) ++# define LZO_INT16_C(c) ((c) + 0L) ++# define LZO_UINT16_C(c) ((c) + 0UL) ++# elif (LZO_SIZEOF_INT >= 2) ++# define LZO_INT16_C(c) (c) ++# define LZO_UINT16_C(c) (c##U) ++# elif (LZO_SIZEOF_LONG >= 2) ++# define LZO_INT16_C(c) (c##L) ++# define LZO_UINT16_C(c) (c##UL) ++# else ++# error "LZO_INT16_C" ++# endif ++#endif ++#if !defined(LZO_INT32_C) ++# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) ++# define LZO_INT32_C(c) ((c) + 0) ++# define LZO_UINT32_C(c) ((c) + 0U) ++# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) ++# define LZO_INT32_C(c) ((c) + 0L) ++# define LZO_UINT32_C(c) ((c) + 0UL) ++# elif (LZO_SIZEOF_INT >= 4) ++# define LZO_INT32_C(c) (c) ++# define LZO_UINT32_C(c) (c##U) ++# elif (LZO_SIZEOF_LONG >= 4) ++# define LZO_INT32_C(c) (c##L) ++# define LZO_UINT32_C(c) (c##UL) ++# elif (LZO_SIZEOF_LONG_LONG >= 4) ++# define LZO_INT32_C(c) (c##LL) ++# define LZO_UINT32_C(c) (c##ULL) ++# else ++# error "LZO_INT32_C" ++# endif ++#endif ++#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) ++# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) ++# define LZO_INT64_C(c) ((c) + 0) ++# define LZO_UINT64_C(c) ((c) + 0U) ++# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) ++# define LZO_INT64_C(c) ((c) + 0L) ++# define LZO_UINT64_C(c) ((c) + 0UL) ++# elif (LZO_SIZEOF_INT >= 8) ++# define LZO_INT64_C(c) (c) ++# define LZO_UINT64_C(c) (c##U) ++# elif (LZO_SIZEOF_LONG >= 8) ++# define LZO_INT64_C(c) (c##L) ++# define LZO_UINT64_C(c) (c##UL) ++# else ++# error "LZO_INT64_C" ++# endif ++#endif ++#endif + + #endif /* already included */ + +-/* vim:set ts=4 et: */ ++/* vim:set ts=4 sw=4 et: */ diff --git a/grub-core/lib/minilzo/minilzo.h b/grub-core/lib/minilzo/minilzo.h -index 74fefa9fe..793745467 100644 +index 74fefa9fe20..79374546748 100644 --- a/grub-core/lib/minilzo/minilzo.h +++ b/grub-core/lib/minilzo/minilzo.h @@ -2,22 +2,7 @@ @@ -8786,5 +8508,5 @@ index 74fefa9fe..793745467 100644 -- -2.14.3 +2.15.0 diff --git a/0072-Allow-fallback-to-include-entries-by-title-not-just-.patch b/0072-Allow-fallback-to-include-entries-by-title-not-just-.patch index 2d56ef6..d9c58f5 100644 --- a/0072-Allow-fallback-to-include-entries-by-title-not-just-.patch +++ b/0072-Allow-fallback-to-include-entries-by-title-not-just-.patch @@ -1,7 +1,7 @@ From 15e9ccc8abd5621107788bea6ae6f2bdb27a3ed3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 5 Sep 2014 10:07:04 -0400 -Subject: [PATCH 072/198] Allow "fallback" to include entries by title, not +Subject: [PATCH 072/206] Allow "fallback" to include entries by title, not just number. Resolves: rhbz#1026084 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 58 insertions(+), 27 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index e7a83c2d6..d2f64b05e 100644 +index e7a83c2d6e2..d2f64b05e0a 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -163,16 +163,41 @@ grub_menu_set_timeout (int timeout) @@ -140,5 +140,5 @@ index e7a83c2d6..d2f64b05e 100644 static int get_entry_number (grub_menu_t menu, const char *name) -- -2.14.3 +2.15.0 diff --git a/0073-Add-GRUB_DISABLE_UUID.patch b/0073-Add-GRUB_DISABLE_UUID.patch index a8faaf9..b4383eb 100644 --- a/0073-Add-GRUB_DISABLE_UUID.patch +++ b/0073-Add-GRUB_DISABLE_UUID.patch @@ -1,7 +1,7 @@ From 87602724b509a60628623baabf5a2c7741a68884 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 16:49:25 -0400 -Subject: [PATCH 073/198] Add GRUB_DISABLE_UUID. +Subject: [PATCH 073/206] Add GRUB_DISABLE_UUID. This will cause "search --fs-uuid --set=root ..." not to be generated by grub2-mkconfig, and instead simply attempt to use the grub device name @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index a0c4b9e4e..6fdd2a041 100644 +index a0c4b9e4e8e..6fdd2a041f7 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. @@ -33,7 +33,7 @@ index a0c4b9e4e..6fdd2a041 100644 If graphical video support is required, either because the @samp{gfxterm} graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 3b070fd76..c088b7054 100644 +index 3b070fd7632..c088b705442 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -133,11 +133,11 @@ fi @@ -73,7 +73,7 @@ index 3b070fd76..c088b7054 100644 GRUB_GFXMODE \ GRUB_BACKGROUND \ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 60b31cadd..cf35e4174 100644 +index 60b31caddeb..cf35e417470 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -156,7 +156,7 @@ prepare_grub_to_access_device () @@ -95,5 +95,5 @@ index 60b31cadd..cf35e4174 100644 else echo $device |sed 's, ,_,g' -- -2.14.3 +2.15.0 diff --git a/0074-Make-exit-take-a-return-code.patch b/0074-Make-exit-take-a-return-code.patch index 48ac129..7c9cf52 100644 --- a/0074-Make-exit-take-a-return-code.patch +++ b/0074-Make-exit-take-a-return-code.patch @@ -1,7 +1,7 @@ From 68d514b51b81911d8359d7825618112dae4a44d9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 26 Feb 2014 21:49:12 -0500 -Subject: [PATCH 074/198] Make "exit" take a return code. +Subject: [PATCH 074/206] Make "exit" take a return code. This adds "exit" with a return code. With this patch, any "exit" command /may/ include a return code, and on platforms that support @@ -27,7 +27,7 @@ Signed-off-by: Peter Jones 14 files changed, 39 insertions(+), 21 deletions(-) diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c -index a3a118241..b25ca4b9f 100644 +index a3a11824172..b25ca4b9f17 100644 --- a/grub-core/commands/minicmd.c +++ b/grub-core/commands/minicmd.c @@ -176,12 +176,24 @@ grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)), @@ -60,7 +60,7 @@ index a3a118241..b25ca4b9f 100644 } diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index d467785fc..684ca93f8 100644 +index d467785fc6c..684ca93f8f4 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -155,11 +155,16 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) @@ -83,7 +83,7 @@ index d467785fc..684ca93f8 100644 } diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c -index 425bb9603..55ea5a11c 100644 +index 425bb960347..55ea5a11ccd 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -67,7 +67,7 @@ grub_reboot (void) @@ -96,7 +96,7 @@ index 425bb9603..55ea5a11c 100644 grub_reboot (); } diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c -index 76661337f..82012a72f 100644 +index 76661337f10..82012a72fcb 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -137,9 +137,10 @@ xasprintf (const char *fmt, ...) @@ -113,7 +113,7 @@ index 76661337f..82012a72f 100644 #endif diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c -index 3314f027f..36f9134b7 100644 +index 3314f027fec..36f9134b7b7 100644 --- a/grub-core/kern/i386/coreboot/init.c +++ b/grub-core/kern/i386/coreboot/init.c @@ -41,7 +41,7 @@ extern grub_uint8_t _end[]; @@ -126,7 +126,7 @@ index 3314f027f..36f9134b7 100644 /* We can't use grub_fatal() in this function. This would create an infinite loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ diff --git a/grub-core/kern/i386/qemu/init.c b/grub-core/kern/i386/qemu/init.c -index 271b6fbfa..9fafe98f0 100644 +index 271b6fbfabd..9fafe98f015 100644 --- a/grub-core/kern/i386/qemu/init.c +++ b/grub-core/kern/i386/qemu/init.c @@ -42,7 +42,7 @@ extern grub_uint8_t _end[]; @@ -139,7 +139,7 @@ index 271b6fbfa..9fafe98f0 100644 /* We can't use grub_fatal() in this function. This would create an infinite loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 12590225e..e69c0133e 100644 +index 12590225eca..e69c0133e69 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -68,7 +68,7 @@ grub_addr_t grub_ieee1275_original_stack; @@ -152,7 +152,7 @@ index 12590225e..e69c0133e 100644 grub_ieee1275_exit (); } diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/init.c -index 3834a1490..86b3a25ec 100644 +index 3834a149093..86b3a25ec40 100644 --- a/grub-core/kern/mips/arc/init.c +++ b/grub-core/kern/mips/arc/init.c @@ -276,7 +276,7 @@ grub_halt (void) @@ -165,7 +165,7 @@ index 3834a1490..86b3a25ec 100644 GRUB_ARC_FIRMWARE_VECTOR->exit (); diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c -index 7b96531b9..dff598ca7 100644 +index 7b96531b983..dff598ca7b0 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -304,7 +304,7 @@ grub_halt (void) @@ -178,7 +178,7 @@ index 7b96531b9..dff598ca7 100644 grub_halt (); } diff --git a/grub-core/kern/mips/qemu_mips/init.c b/grub-core/kern/mips/qemu_mips/init.c -index be88b77d2..8b6c55ffc 100644 +index be88b77d22d..8b6c55ffc01 100644 --- a/grub-core/kern/mips/qemu_mips/init.c +++ b/grub-core/kern/mips/qemu_mips/init.c @@ -75,7 +75,7 @@ grub_machine_fini (int flags __attribute__ ((unused))) @@ -191,7 +191,7 @@ index be88b77d2..8b6c55ffc 100644 grub_halt (); } diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 3b633d51f..952411d5d 100644 +index 3b633d51f4c..952411d5dc6 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1095,7 +1095,7 @@ grub_abort (void) @@ -204,7 +204,7 @@ index 3b633d51f..952411d5d 100644 void diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c -index 3e338645c..be2a5be1d 100644 +index 3e338645c57..be2a5be1d07 100644 --- a/grub-core/kern/uboot/init.c +++ b/grub-core/kern/uboot/init.c @@ -39,9 +39,9 @@ extern grub_size_t grub_total_module_size; @@ -229,7 +229,7 @@ index 3e338645c..be2a5be1d 100644 else if (ver > API_SIG_VERSION) { diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c -index 0559c033c..fce526d41 100644 +index 0559c033c3d..fce526d417b 100644 --- a/grub-core/kern/xen/init.c +++ b/grub-core/kern/xen/init.c @@ -549,7 +549,7 @@ grub_machine_init (void) @@ -242,7 +242,7 @@ index 0559c033c..fce526d41 100644 struct sched_shutdown arg; diff --git a/include/grub/misc.h b/include/grub/misc.h -index 2a9f87cc2..062081437 100644 +index 2a9f87cc255..06208143779 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -334,7 +334,7 @@ int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt, @@ -255,5 +255,5 @@ index 2a9f87cc2..062081437 100644 grub_uint64_t d, grub_uint64_t *r); -- -2.14.3 +2.15.0 diff --git a/0075-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch b/0075-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch index ceb5435..0065b73 100644 --- a/0075-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch +++ b/0075-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch @@ -1,7 +1,7 @@ From 126f6952b853ea67e784650ed12f365ab7988f51 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 22 Jul 2015 11:21:01 -0400 -Subject: [PATCH 075/198] Mark po/exclude.pot as binary so git won't try to +Subject: [PATCH 075/206] Mark po/exclude.pot as binary so git won't try to diff nonprintables. Signed-off-by: Peter Jones @@ -12,11 +12,11 @@ Signed-off-by: Peter Jones diff --git a/.gitattributes b/.gitattributes new file mode 100644 -index 000000000..33ffaa404 +index 00000000000..33ffaa40460 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +po/exclude.pot binary -- -2.14.3 +2.15.0 diff --git a/0076-Make-efi-machines-load-an-env-block-from-a-variable.patch b/0076-Make-efi-machines-load-an-env-block-from-a-variable.patch index 50c6437..000c33d 100644 --- a/0076-Make-efi-machines-load-an-env-block-from-a-variable.patch +++ b/0076-Make-efi-machines-load-an-env-block-from-a-variable.patch @@ -1,7 +1,7 @@ From 506b52759b2b2ad46e7b389979fcbaa78d68dab9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 7 Dec 2015 14:20:49 -0500 -Subject: [PATCH 076/198] Make efi machines load an env block from a variable +Subject: [PATCH 076/206] Make efi machines load an env block from a variable Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index a65c27f7f..1eb86bed3 100644 +index a65c27f7ff2..1eb86bed33b 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -191,6 +191,7 @@ kernel = { @@ -22,7 +22,7 @@ index a65c27f7f..1eb86bed3 100644 i386_multiboot = kern/i386/pc/acpi.c; i386_coreboot = kern/acpi.c; diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index 2c31847bf..f7782b6e1 100644 +index 2c31847bf6d..f7782b6e114 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -25,9 +25,40 @@ @@ -80,5 +80,5 @@ index 2c31847bf..f7782b6e1 100644 char **path); -- -2.14.3 +2.15.0 diff --git a/0077-DHCP-client-ID-and-UUID-options-added.patch b/0077-DHCP-client-ID-and-UUID-options-added.patch index 5cdc929..f391b42 100644 --- a/0077-DHCP-client-ID-and-UUID-options-added.patch +++ b/0077-DHCP-client-ID-and-UUID-options-added.patch @@ -1,7 +1,7 @@ From 8a0b654a520e407da69e0cf64f3dd6bb7cf86240 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:18:53 -0200 -Subject: [PATCH 077/198] DHCP client ID and UUID options added. +Subject: [PATCH 077/206] DHCP client ID and UUID options added. --- grub-core/net/bootp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++----- @@ -9,7 +9,7 @@ Subject: [PATCH 077/198] DHCP client ID and UUID options added. 2 files changed, 81 insertions(+), 8 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 9e2fdb795..f03eeab2f 100644 +index 9e2fdb795f5..f03eeab2fb4 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -25,6 +25,49 @@ @@ -128,7 +128,7 @@ index 9e2fdb795..f03eeab2f 100644 grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), int argc, char **args) diff --git a/include/grub/net.h b/include/grub/net.h -index 1096b2432..e266bae23 100644 +index 1096b24322e..e266bae23f4 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -457,6 +457,8 @@ enum @@ -141,5 +141,5 @@ index 1096b2432..e266bae23 100644 }; -- -2.14.3 +2.15.0 diff --git a/0078-trim-arp-packets-with-abnormal-size.patch b/0078-trim-arp-packets-with-abnormal-size.patch index c2f62d0..5e4a36b 100644 --- a/0078-trim-arp-packets-with-abnormal-size.patch +++ b/0078-trim-arp-packets-with-abnormal-size.patch @@ -1,7 +1,7 @@ From c0fa21c8898437747ce093884e6aba48d45ac329 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 5 Feb 2014 09:42:42 -0200 -Subject: [PATCH 078/198] trim arp packets with abnormal size +Subject: [PATCH 078/206] trim arp packets with abnormal size GRUB uses arp request to create the arp response. If the incoming packet is foobared, GRUB needs to trim the arp response packet before sending it. @@ -10,7 +10,7 @@ is foobared, GRUB needs to trim the arp response packet before sending it. 1 file changed, 6 insertions(+) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 54306e3b1..2083b5a4b 100644 +index 54306e3b16d..2083b5a4b91 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -150,6 +150,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card, @@ -27,5 +27,5 @@ index 54306e3b1..2083b5a4b 100644 struct grub_net_buff nb_reply; struct arppkt *arp_reply; -- -2.14.3 +2.15.0 diff --git a/0079-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch b/0079-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch index 4a7c886..5b4028f 100644 --- a/0079-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +++ b/0079-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch @@ -1,7 +1,7 @@ From 60262dc77512d017974f38768d7492b4588d54f0 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 12 Mar 2014 10:58:16 -0400 -Subject: [PATCH 079/198] Fix bad test on GRUB_DISABLE_SUBMENU. +Subject: [PATCH 079/206] Fix bad test on GRUB_DISABLE_SUBMENU. The file /etc/grub.d/10_linux does @@ -20,7 +20,7 @@ Resolves: rhbz#1063414 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index de9044c7f..cf6331f2a 100644 +index de9044c7f28..cf6331f2a51 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -224,7 +224,11 @@ while [ "x$list" != "x" ] ; do @@ -37,5 +37,5 @@ index de9044c7f..cf6331f2a 100644 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -- -2.14.3 +2.15.0 diff --git a/0080-Add-support-for-UEFI-operating-systems-returned-by-o.patch b/0080-Add-support-for-UEFI-operating-systems-returned-by-o.patch index c87fe7c..a2e234d 100644 --- a/0080-Add-support-for-UEFI-operating-systems-returned-by-o.patch +++ b/0080-Add-support-for-UEFI-operating-systems-returned-by-o.patch @@ -1,7 +1,7 @@ From 699b7db9cabfe5e2dd48e61fcb079a91df3af4a7 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 12 Jun 2013 11:51:49 -0400 -Subject: [PATCH 080/198] Add support for UEFI operating systems returned by +Subject: [PATCH 080/206] Add support for UEFI operating systems returned by os-prober os-prober returns UEFI operating systems in the form: @@ -15,7 +15,7 @@ contrast to legacy OSes, where path is the device string. Handle this case. 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 515a68c7a..9b8f5968e 100644 +index 515a68c7aa0..9b8f5968e2d 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -328,8 +328,23 @@ EOF @@ -46,5 +46,5 @@ index 515a68c7a..9b8f5968e 100644 esac done -- -2.14.3 +2.15.0 diff --git a/0081-Migrate-PPC-from-Yaboot-to-Grub2.patch b/0081-Migrate-PPC-from-Yaboot-to-Grub2.patch index de58e27..307a763 100644 --- a/0081-Migrate-PPC-from-Yaboot-to-Grub2.patch +++ b/0081-Migrate-PPC-from-Yaboot-to-Grub2.patch @@ -1,7 +1,7 @@ From 91b2efdd5e9c3b0784d0a70282407324f07a30b8 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 28 Mar 2012 14:46:41 -0500 -Subject: [PATCH 081/198] Migrate PPC from Yaboot to Grub2 +Subject: [PATCH 081/206] Migrate PPC from Yaboot to Grub2 Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. @@ -12,7 +12,7 @@ maximum screen size so that text is not overwritten. create mode 100644 util/grub.d/20_ppc_terminfo.in diff --git a/Makefile.util.def b/Makefile.util.def -index f9caccb97..6d452da02 100644 +index f9caccb9780..6d452da029f 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -486,6 +486,13 @@ script = { @@ -31,7 +31,7 @@ index f9caccb97..6d452da02 100644 common = util/grub.d/30_os-prober.in; diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in new file mode 100644 -index 000000000..10d665868 +index 00000000000..10d66586820 --- /dev/null +++ b/util/grub.d/20_ppc_terminfo.in @@ -0,0 +1,114 @@ @@ -150,5 +150,5 @@ index 000000000..10d665868 + terminfo -g ${X}x${Y} ${TERMINAL} +EOF -- -2.14.3 +2.15.0 diff --git a/0082-Add-fw_path-variable-revised.patch b/0082-Add-fw_path-variable-revised.patch index b6a4eef..cd65ba5 100644 --- a/0082-Add-fw_path-variable-revised.patch +++ b/0082-Add-fw_path-variable-revised.patch @@ -1,7 +1,7 @@ From bcb1f1a6a5530ecbc4b674e61acbb406592714c6 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 19 Sep 2012 21:22:55 -0300 -Subject: [PATCH 082/198] Add fw_path variable (revised) +Subject: [PATCH 082/206] Add fw_path variable (revised) This patch makes grub look for its config file on efi where the app was found. It was originally written by Matthew Garrett, and adapted to fix the @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=857936 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 9cad0c448..8ab7794c4 100644 +index 9cad0c4485c..8ab7794c47b 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -127,16 +127,15 @@ grub_set_prefix_and_root (void) @@ -41,7 +41,7 @@ index 9cad0c448..8ab7794c4 100644 } diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 249e19bc7..759c475c4 100644 +index 249e19bc788..759c475c4d9 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -338,7 +338,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -77,5 +77,5 @@ index 249e19bc7..759c475c4 100644 prefix = grub_env_get ("prefix"); if (prefix) -- -2.14.3 +2.15.0 diff --git a/0083-Add-support-for-linuxefi.patch b/0083-Add-support-for-linuxefi.patch index 260a980..5bb75c2 100644 --- a/0083-Add-support-for-linuxefi.patch +++ b/0083-Add-support-for-linuxefi.patch @@ -1,7 +1,7 @@ From 28136df7d90f865a8030a0ff6513dacb3096dc10 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 10 Jul 2012 11:58:52 -0400 -Subject: [PATCH 083/198] Add support for linuxefi +Subject: [PATCH 083/206] Add support for linuxefi --- grub-core/Makefile.core.def | 8 + @@ -13,7 +13,7 @@ Subject: [PATCH 083/198] Add support for linuxefi create mode 100644 grub-core/loader/i386/efi/linux.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 1eb86bed3..c653c71c5 100644 +index 1eb86bed33b..c653c71c594 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1764,6 +1764,14 @@ module = { @@ -32,7 +32,7 @@ index 1eb86bed3..c653c71c5 100644 name = chain; efi = loader/efi/chainloader.c; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index ac2a4c556..f5440cb1d 100644 +index ac2a4c556b8..f5440cb1df9 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -49,6 +49,38 @@ static grub_efi_uintn_t finish_desc_size; @@ -76,7 +76,7 @@ index ac2a4c556..f5440cb1d 100644 grub_efi_allocate_pages_real (grub_efi_physical_address_t address, diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c new file mode 100644 -index 000000000..b79e6320b +index 00000000000..b79e6320ba9 --- /dev/null +++ b/grub-core/loader/i386/efi/linux.c @@ -0,0 +1,371 @@ @@ -452,7 +452,7 @@ index 000000000..b79e6320b + grub_unregister_command (cmd_initrd); +} diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 3fa082816..91e29ce66 100644 +index 3fa082816ca..91e29ce66f1 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -47,6 +47,9 @@ EXPORT_FUNC(grub_efi_allocate_fixed) (grub_efi_physical_address_t address, @@ -466,7 +466,7 @@ index 3fa082816..91e29ce66 100644 grub_efi_uintn_t pages); int diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index da0ca3b83..fc36bdaf3 100644 +index da0ca3b83cd..fc36bdaf367 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -139,6 +139,7 @@ struct linux_kernel_header @@ -478,5 +478,5 @@ index da0ca3b83..fc36bdaf3 100644 /* Boot parameters for Linux based on 2.6.12. This is used by the setup -- -2.14.3 +2.15.0 diff --git a/0084-Use-linuxefi-and-initrdefi-where-appropriate.patch b/0084-Use-linuxefi-and-initrdefi-where-appropriate.patch index 9794bef..3c0be25 100644 --- a/0084-Use-linuxefi-and-initrdefi-where-appropriate.patch +++ b/0084-Use-linuxefi-and-initrdefi-where-appropriate.patch @@ -1,14 +1,14 @@ From e915644108ed022ad0cc5d2d987f116d2605bcf2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 16 Jul 2012 18:57:11 -0400 -Subject: [PATCH 084/198] Use "linuxefi" and "initrdefi" where appropriate. +Subject: [PATCH 084/206] Use "linuxefi" and "initrdefi" where appropriate. --- util/grub.d/10_linux.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index cf6331f2a..8ccf012f7 100644 +index cf6331f2a51..8ccf012f747 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -129,17 +129,31 @@ linux_entry () @@ -46,5 +46,5 @@ index cf6331f2a..8ccf012f7 100644 sed "s/^/$submenu_indentation/" << EOF } -- -2.14.3 +2.15.0 diff --git a/0085-Don-t-allow-insmod-when-secure-boot-is-enabled.patch b/0085-Don-t-allow-insmod-when-secure-boot-is-enabled.patch index 4af2dde..3edfe4c 100644 --- a/0085-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +++ b/0085-Don-t-allow-insmod-when-secure-boot-is-enabled.patch @@ -1,7 +1,7 @@ From b1eb9a8b9aa961bf6b6f40d6b4d22a5741f29ae4 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Oct 2012 10:40:49 -0400 -Subject: [PATCH 085/198] Don't allow insmod when secure boot is enabled. +Subject: [PATCH 085/206] Don't allow insmod when secure boot is enabled. Hi, @@ -23,7 +23,7 @@ moves the check into grub_dl_load_file. 3 files changed, 51 insertions(+) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index e394cd96f..621070918 100644 +index e394cd96f8c..621070918d4 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -32,12 +32,21 @@ @@ -69,7 +69,7 @@ index e394cd96f..621070918 100644 file = grub_file_open (filename); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 684ca93f8..2588b481e 100644 +index 684ca93f8f4..2588b481e76 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -269,6 +269,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -108,7 +108,7 @@ index 684ca93f8..2588b481e 100644 /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 91e29ce66..bb3ab7dfd 100644 +index 91e29ce66f1..bb3ab7dfdeb 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -83,6 +83,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, @@ -120,5 +120,5 @@ index 91e29ce66..bb3ab7dfd 100644 EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, const grub_efi_device_path_t *dp2); -- -2.14.3 +2.15.0 diff --git a/0086-Pass-x-hex-hex-straight-through-unmolested.patch b/0086-Pass-x-hex-hex-straight-through-unmolested.patch index 119fa90..c6887ae 100644 --- a/0086-Pass-x-hex-hex-straight-through-unmolested.patch +++ b/0086-Pass-x-hex-hex-straight-through-unmolested.patch @@ -1,7 +1,7 @@ From cc8be4cafeb5a0af779afe5d2856da434c165612 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 Oct 2012 13:24:37 -0400 -Subject: [PATCH 086/198] Pass "\x[[:hex:]][[:hex:]]" straight through +Subject: [PATCH 086/206] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. --- @@ -11,7 +11,7 @@ Subject: [PATCH 086/198] Pass "\x[[:hex:]][[:hex:]]" straight through 3 files changed, 84 insertions(+), 9 deletions(-) diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c -index 9b4e72766..02c46f9fd 100644 +index 9b4e72766ff..02c46f9fdfa 100644 --- a/grub-core/commands/wildcard.c +++ b/grub-core/commands/wildcard.c @@ -462,6 +462,12 @@ check_file (const char *dir, const char *basename) @@ -45,7 +45,7 @@ index 9b4e72766..02c46f9fd 100644 *optr++ = iptr[1]; iptr += 2; diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c -index d5e10ee87..0a5b2afb9 100644 +index d5e10ee8798..0a5b2afb94b 100644 --- a/grub-core/lib/cmdline.c +++ b/grub-core/lib/cmdline.c @@ -20,6 +20,12 @@ @@ -104,7 +104,7 @@ index d5e10ee87..0a5b2afb9 100644 *buf++ = *c; diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index ab78ca87f..cf6cd6601 100644 +index ab78ca87f90..cf6cd6601d6 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -55,6 +55,12 @@ static struct grub_script_scope *scope = 0; @@ -179,5 +179,5 @@ index ab78ca87f..cf6cd6601 100644 case '$': if (escaped) -- -2.14.3 +2.15.0 diff --git a/0087-Add-X-option-to-printf-functions.patch b/0087-Add-X-option-to-printf-functions.patch index 928141c..f2e78cd 100644 --- a/0087-Add-X-option-to-printf-functions.patch +++ b/0087-Add-X-option-to-printf-functions.patch @@ -1,14 +1,14 @@ From d3e9800ae2fe7c0ed2d7795eae2be17a66e625ff Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 16:58:39 -0200 -Subject: [PATCH 087/198] Add %X option to printf functions. +Subject: [PATCH 087/206] Add %X option to printf functions. --- grub-core/kern/misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 952411d5d..8344526be 100644 +index 952411d5dc6..8344526be7f 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -588,7 +588,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) @@ -54,5 +54,5 @@ index 952411d5d..8344526be 100644 case 'd': { -- -2.14.3 +2.15.0 diff --git a/0088-Search-for-specific-config-file-for-netboot.patch b/0088-Search-for-specific-config-file-for-netboot.patch index 8a4a61a..5f17a24 100644 --- a/0088-Search-for-specific-config-file-for-netboot.patch +++ b/0088-Search-for-specific-config-file-for-netboot.patch @@ -1,7 +1,7 @@ From 30c15e39be47d60f6a4a45628a687911a9f11091 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:22:07 -0200 -Subject: [PATCH 088/198] Search for specific config file for netboot +Subject: [PATCH 088/206] Search for specific config file for netboot This patch implements a search for a specific configuration when the config file is on a remoteserver. It uses the following order: @@ -22,7 +22,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=873406 3 files changed, 135 insertions(+), 4 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 10773fc34..0769bf850 100644 +index 10773fc3435..0769bf850d3 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1735,6 +1735,124 @@ grub_net_restore_hw (void) @@ -151,7 +151,7 @@ index 10773fc34..0769bf850 100644 static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 759c475c4..b2654ef62 100644 +index 759c475c4d9..b2654ef62e8 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,7 @@ @@ -187,7 +187,7 @@ index 759c475c4..b2654ef62 100644 grub_enter_normal_mode (config); grub_free (config); diff --git a/include/grub/net.h b/include/grub/net.h -index e266bae23..50d62ab0c 100644 +index e266bae23f4..50d62ab0c8c 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -566,4 +566,7 @@ extern char *grub_net_default_server; @@ -199,5 +199,5 @@ index e266bae23..50d62ab0c 100644 + #endif /* ! GRUB_NET_HEADER */ -- -2.14.3 +2.15.0 diff --git a/0089-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch b/0089-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch index 65c4f93..a946e90 100644 --- a/0089-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +++ b/0089-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch @@ -1,7 +1,7 @@ From 266c7e797971879dc229594556a687a79c92d3b6 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Tue, 22 Jan 2013 06:31:38 +0100 -Subject: [PATCH 089/198] blscfg: add blscfg module to parse Boot Loader +Subject: [PATCH 089/206] blscfg: add blscfg module to parse Boot Loader Specification snippets http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec @@ -21,7 +21,7 @@ Signed-off-by: Peter Jones create mode 100644 grub-core/commands/blscfg.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index c653c71c5..7f3d5a2bf 100644 +index c653c71c594..7f3d5a2bfe6 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -768,6 +768,14 @@ module = { @@ -41,7 +41,7 @@ index c653c71c5..7f3d5a2bf 100644 common = commands/boot.c; diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c new file mode 100644 -index 000000000..4274aca5a +index 00000000000..4274aca5a9d --- /dev/null +++ b/grub-core/commands/blscfg.c @@ -0,0 +1,201 @@ @@ -247,5 +247,5 @@ index 000000000..4274aca5a + grub_unregister_extcmd (cmd); +} -- -2.14.3 +2.15.0 diff --git a/0090-Don-t-write-messages-to-the-screen.patch b/0090-Don-t-write-messages-to-the-screen.patch index 736c8c9..ab238d0 100644 --- a/0090-Don-t-write-messages-to-the-screen.patch +++ b/0090-Don-t-write-messages-to-the-screen.patch @@ -1,51 +1,21 @@ From 6609ba848331d9153c554bb52f2ef0a33531cf55 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:30:20 -0400 -Subject: [PATCH 090/198] Don't write messages to the screen +Subject: [PATCH 090/206] Don't write messages to the screen Writing messages to the screen before the menus or boot splash happens so quickly it looks like something is wrong and isn't very appealing. --- - grub-core/boot/i386/pc/boot.S | 3 --- - grub-core/boot/i386/pc/diskboot.S | 5 ----- grub-core/gettext/gettext.c | 25 +++++-------------------- grub-core/kern/main.c | 5 ----- + grub-core/boot/i386/pc/boot.S | 3 --- + grub-core/boot/i386/pc/diskboot.S | 5 ----- util/grub.d/10_linux.in | 7 ------- 5 files changed, 5 insertions(+), 40 deletions(-) -diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S -index 2bd0b2d28..ea167fe12 100644 ---- a/grub-core/boot/i386/pc/boot.S -+++ b/grub-core/boot/i386/pc/boot.S -@@ -249,9 +249,6 @@ real_start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- MSG(notification_string) -- - /* set %si to the disk address packet */ - movw $disk_address_packet, %si - -diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S -index 1ee4cf5b2..c8b87ed29 100644 ---- a/grub-core/boot/i386/pc/diskboot.S -+++ b/grub-core/boot/i386/pc/diskboot.S -@@ -50,11 +50,6 @@ _start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- pushw %si -- MSG(notification_string) -- popw %si -- - /* this sets up for the first run through "bootloop" */ - movw $LOCAL(firstlist), %di - diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c -index 4880cefe3..b22e1bcc9 100644 +index 4880cefe3f8..b22e1bcc94b 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -434,16 +434,12 @@ static char * @@ -127,7 +97,7 @@ index 4880cefe3..b22e1bcc9 100644 grub_register_variable_hook ("locale_dir", NULL, read_main); grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 8ab7794c4..da47b18b5 100644 +index 8ab7794c47b..da47b18b50e 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -268,11 +268,6 @@ grub_main (void) @@ -142,8 +112,38 @@ index 8ab7794c4..da47b18b5 100644 grub_load_config (); grub_boot_time ("Before loading embedded modules."); +diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S +index 2bd0b2d2866..ea167fe1206 100644 +--- a/grub-core/boot/i386/pc/boot.S ++++ b/grub-core/boot/i386/pc/boot.S +@@ -249,9 +249,6 @@ real_start: + /* save drive reference first thing! */ + pushw %dx + +- /* print a notification message on the screen */ +- MSG(notification_string) +- + /* set %si to the disk address packet */ + movw $disk_address_packet, %si + +diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S +index 1ee4cf5b2e0..c8b87ed293c 100644 +--- a/grub-core/boot/i386/pc/diskboot.S ++++ b/grub-core/boot/i386/pc/diskboot.S +@@ -50,11 +50,6 @@ _start: + /* save drive reference first thing! */ + pushw %dx + +- /* print a notification message on the screen */ +- pushw %si +- MSG(notification_string) +- popw %si +- + /* this sets up for the first run through "bootloop" */ + movw $LOCAL(firstlist), %di + diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 8ccf012f7..a3d9711d6 100644 +index 8ccf012f747..a3d9711d607 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -128,29 +128,22 @@ linux_entry () @@ -177,5 +177,5 @@ index 8ccf012f7..a3d9711d6 100644 EOF fi -- -2.14.3 +2.15.0 diff --git a/0091-Don-t-print-GNU-GRUB-header.patch b/0091-Don-t-print-GNU-GRUB-header.patch index b93af73..9a03f2d 100644 --- a/0091-Don-t-print-GNU-GRUB-header.patch +++ b/0091-Don-t-print-GNU-GRUB-header.patch @@ -1,7 +1,7 @@ From 95aeba5fe67ad11a995eb8e583708a722b8bdeb9 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:53:48 -0400 -Subject: [PATCH 091/198] Don't print GNU GRUB header +Subject: [PATCH 091/206] Don't print GNU GRUB header No one cares. --- @@ -9,7 +9,7 @@ No one cares. 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index b2654ef62..f57b7508a 100644 +index b2654ef62e8..f57b7508a76 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -202,15 +202,16 @@ read_config_file (const char *config) @@ -41,5 +41,5 @@ index b2654ef62..f57b7508a 100644 static void -- -2.14.3 +2.15.0 diff --git a/0092-Don-t-add-to-highlighted-row.patch b/0092-Don-t-add-to-highlighted-row.patch index 4c1e810..4ab4c75 100644 --- a/0092-Don-t-add-to-highlighted-row.patch +++ b/0092-Don-t-add-to-highlighted-row.patch @@ -1,7 +1,7 @@ From aca25c56911ece3e4d82ae9edbde6c705c1eaacc Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 17:49:45 -0400 -Subject: [PATCH 092/198] Don't add '*' to highlighted row +Subject: [PATCH 092/206] Don't add '*' to highlighted row It is already highlighted. --- @@ -9,7 +9,7 @@ It is already highlighted. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index e22bb91f6..a3d1f23f6 100644 +index e22bb91f6e8..a3d1f23f68f 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -242,7 +242,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -22,5 +22,5 @@ index e22bb91f6..a3d1f23f6 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -2.14.3 +2.15.0 diff --git a/0093-Message-string-cleanups.patch b/0093-Message-string-cleanups.patch index cd23a84..d76f995 100644 --- a/0093-Message-string-cleanups.patch +++ b/0093-Message-string-cleanups.patch @@ -1,7 +1,7 @@ From eef343ff642b42f0e46eb5e8ff5d89fef375f4a2 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 11:09:04 -0400 -Subject: [PATCH 093/198] Message string cleanups +Subject: [PATCH 093/206] Message string cleanups Make use of terminology consistent. Remove jargon. --- @@ -9,7 +9,7 @@ Make use of terminology consistent. Remove jargon. 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index a3d1f23f6..64a83862f 100644 +index a3d1f23f68f..64a83862f66 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,9 +157,8 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -67,5 +67,5 @@ index a3d1f23f6..64a83862f 100644 { grub_print_error (); -- -2.14.3 +2.15.0 diff --git a/0094-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch b/0094-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch index c67e9fe..b52ff30 100644 --- a/0094-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +++ b/0094-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch @@ -1,14 +1,14 @@ From c2e1e09485a5773dc3639d34eadc3a07ebce8fe5 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:23 -0400 -Subject: [PATCH 094/198] Fix border spacing now that we aren't displaying it +Subject: [PATCH 094/206] Fix border spacing now that we aren't displaying it --- grub-core/normal/menu_text.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 64a83862f..1062d64ee 100644 +index 64a83862f66..1062d64ee29 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -331,12 +331,12 @@ grub_menu_init_page (int nested, int edit, @@ -28,5 +28,5 @@ index 64a83862f..1062d64ee 100644 geo->timeout_lines = 2; -- -2.14.3 +2.15.0 diff --git a/0095-Use-the-correct-indentation-for-the-term-help-text.patch b/0095-Use-the-correct-indentation-for-the-term-help-text.patch index d47f7bd..69f97b5 100644 --- a/0095-Use-the-correct-indentation-for-the-term-help-text.patch +++ b/0095-Use-the-correct-indentation-for-the-term-help-text.patch @@ -1,7 +1,7 @@ From e29b4dd346fa10dc6a073239ef1ed8fb32a0c838 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:49 -0400 -Subject: [PATCH 095/198] Use the correct indentation for the term help text +Subject: [PATCH 095/206] Use the correct indentation for the term help text That is consistent with the menu help text --- @@ -9,7 +9,7 @@ That is consistent with the menu help text 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f57b7508a..0ce59fdc3 100644 +index f57b7508a76..0ce59fdc3f0 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -426,8 +426,8 @@ grub_normal_reader_init (int nested) @@ -24,5 +24,5 @@ index f57b7508a..0ce59fdc3 100644 grub_print_message_indented (msg_formatted, 0, 0, term); grub_putcode ('\n', term); -- -2.14.3 +2.15.0 diff --git a/0096-Indent-menu-entries.patch b/0096-Indent-menu-entries.patch index 4885cd6..cb787de 100644 --- a/0096-Indent-menu-entries.patch +++ b/0096-Indent-menu-entries.patch @@ -1,14 +1,14 @@ From a67be6e17cd318ad3d4a669efb2b8c5f6e76c003 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:30:55 -0400 -Subject: [PATCH 096/198] Indent menu entries +Subject: [PATCH 096/206] Indent menu entries --- grub-core/normal/menu_text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 1062d64ee..ecc60f99f 100644 +index 1062d64ee29..ecc60f99fc3 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -239,7 +239,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -22,5 +22,5 @@ index 1062d64ee..ecc60f99f 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -2.14.3 +2.15.0 diff --git a/0097-Fix-margins.patch b/0097-Fix-margins.patch index 8e93f57..c1dd251 100644 --- a/0097-Fix-margins.patch +++ b/0097-Fix-margins.patch @@ -1,14 +1,14 @@ From 8e5a006c6c48002f3debd99f4c377b443f9f8369 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:59:36 -0400 -Subject: [PATCH 097/198] Fix margins +Subject: [PATCH 097/206] Fix margins --- grub-core/normal/menu_text.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index ecc60f99f..0e43f2c10 100644 +index ecc60f99fc3..0e43f2c10cc 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -333,17 +333,15 @@ grub_menu_init_page (int nested, int edit, @@ -33,5 +33,5 @@ index ecc60f99f..0e43f2c10 100644 - geo->timeout_lines /* timeout */ - 1 /* empty final line */; -- -2.14.3 +2.15.0 diff --git a/0098-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch b/0098-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch index 94dc83a..5f00334 100644 --- a/0098-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +++ b/0098-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch @@ -1,7 +1,7 @@ From 01757871cb2a7355a7f67e80f77a57fecba26f54 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 21 Jun 2013 14:44:08 -0400 -Subject: [PATCH 098/198] Use -2 instead of -1 for our right-hand margin, so +Subject: [PATCH 098/206] Use -2 instead of -1 for our right-hand margin, so linewrapping works (#976643). Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 0e43f2c10..537d4bf86 100644 +index 0e43f2c10cc..537d4bf86ff 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -334,7 +334,7 @@ grub_menu_init_page (int nested, int edit, @@ -23,5 +23,5 @@ index 0e43f2c10..537d4bf86 100644 geo->first_entry_y = 3; /* three empty lines*/ -- -2.14.3 +2.15.0 diff --git a/0099-Use-linux16-when-appropriate-880840.patch b/0099-Use-linux16-when-appropriate-880840.patch index bcaea52..860446f 100644 --- a/0099-Use-linux16-when-appropriate-880840.patch +++ b/0099-Use-linux16-when-appropriate-880840.patch @@ -1,7 +1,7 @@ From ac001b7b4cc1819186fbe2bc695cbe58d2077d0f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:05:07 -0400 -Subject: [PATCH 099/198] Use linux16 when appropriate (#880840) +Subject: [PATCH 099/206] Use linux16 when appropriate (#880840) The kernel group really would prefer that we use the 16 bit entry point on x86 bios machines. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index a3d9711d6..f3bf6acd8 100644 +index a3d9711d607..f3bf6acd856 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -76,6 +76,11 @@ linux_entry () @@ -48,5 +48,5 @@ index a3d9711d6..f3bf6acd8 100644 fi fi -- -2.14.3 +2.15.0 diff --git a/0100-Enable-pager-by-default.-985860.patch b/0100-Enable-pager-by-default.-985860.patch index 5d9fa83..cf496de 100644 --- a/0100-Enable-pager-by-default.-985860.patch +++ b/0100-Enable-pager-by-default.-985860.patch @@ -1,7 +1,7 @@ From cc60fb5b7693dabcf100c910d42b3ffe1816597f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:09:27 -0400 -Subject: [PATCH 100/198] Enable pager by default. (#985860) +Subject: [PATCH 100/206] Enable pager by default. (#985860) Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 93a90233e..858b526c9 100644 +index 93a90233ead..858b526c925 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -43,6 +43,8 @@ if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_ @@ -22,5 +22,5 @@ index 93a90233e..858b526c9 100644 load_env fi -- -2.14.3 +2.15.0 diff --git a/0101-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch b/0101-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch index bae0ac1..3aac91b 100644 --- a/0101-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +++ b/0101-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch @@ -1,7 +1,7 @@ From f1cb6c5a7640406294b7dffab3c5e4a4afdaf745 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:13:27 -0400 -Subject: [PATCH 101/198] F10 doesn't work on serial, so don't tell the user to +Subject: [PATCH 101/206] F10 doesn't work on serial, so don't tell the user to hit it (#987443) Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 537d4bf86..452d55bf9 100644 +index 537d4bf86ff..452d55bf9ff 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,7 +157,7 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -23,5 +23,5 @@ index 537d4bf86..452d55bf9 100644 STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); -- -2.14.3 +2.15.0 diff --git a/0102-Don-t-say-GNU-Linux-in-generated-menus.patch b/0102-Don-t-say-GNU-Linux-in-generated-menus.patch index f3c37de..d389e16 100644 --- a/0102-Don-t-say-GNU-Linux-in-generated-menus.patch +++ b/0102-Don-t-say-GNU-Linux-in-generated-menus.patch @@ -1,7 +1,7 @@ From 13c028af4104555993650dd9a26dd633c516d23f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 14 Mar 2011 14:27:42 -0400 -Subject: [PATCH 102/198] Don't say "GNU/Linux" in generated menus. +Subject: [PATCH 102/206] Don't say "GNU/Linux" in generated menus. --- util/grub.d/10_linux.in | 4 ++-- @@ -9,7 +9,7 @@ Subject: [PATCH 102/198] Don't say "GNU/Linux" in generated menus. 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index f3bf6acd8..ef52cf3db 100644 +index f3bf6acd856..ef52cf3dbbb 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -25,7 +25,7 @@ index f3bf6acd8..ef52cf3db 100644 fi diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index c002fc9f9..54f1ec8a2 100644 +index c002fc9f946..54f1ec8a2fd 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -41,5 +41,5 @@ index c002fc9f9..54f1ec8a2 100644 fi -- -2.14.3 +2.15.0 diff --git a/0103-Don-t-draw-a-border-around-the-menu.patch b/0103-Don-t-draw-a-border-around-the-menu.patch index d84dfbf..ad29837 100644 --- a/0103-Don-t-draw-a-border-around-the-menu.patch +++ b/0103-Don-t-draw-a-border-around-the-menu.patch @@ -1,7 +1,7 @@ From 8b51cba8f5587746d1559bd6ec957db3e185c049 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 16:47:33 -0400 -Subject: [PATCH 103/198] Don't draw a border around the menu +Subject: [PATCH 103/206] Don't draw a border around the menu It looks cleaner without it. --- @@ -9,7 +9,7 @@ It looks cleaner without it. 1 file changed, 43 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 452d55bf9..1ed2bd92c 100644 +index 452d55bf9ff..1ed2bd92cf8 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right, @@ -70,5 +70,5 @@ index 452d55bf9..1ed2bd92c 100644 grub_term_highlight_color = old_color_highlight; geo->timeout_y = geo->first_entry_y + geo->num_entries -- -2.14.3 +2.15.0 diff --git a/0104-Use-the-standard-margin-for-the-timeout-string.patch b/0104-Use-the-standard-margin-for-the-timeout-string.patch index 07a3c23..c374c30 100644 --- a/0104-Use-the-standard-margin-for-the-timeout-string.patch +++ b/0104-Use-the-standard-margin-for-the-timeout-string.patch @@ -1,7 +1,7 @@ From 137250b0ef67150568074da35c568c6c649899f6 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 10:52:32 -0400 -Subject: [PATCH 104/198] Use the standard margin for the timeout string +Subject: [PATCH 104/206] Use the standard margin for the timeout string So that it aligns with the other messages --- @@ -9,7 +9,7 @@ So that it aligns with the other messages 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 1ed2bd92c..7681f7d28 100644 +index 1ed2bd92cf8..7681f7d2893 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -372,7 +372,7 @@ grub_menu_init_page (int nested, int edit, @@ -39,5 +39,5 @@ index 1ed2bd92c..7681f7d28 100644 } -- -2.14.3 +2.15.0 diff --git a/0105-Add-.eh_frame-to-list-of-relocations-stripped.patch b/0105-Add-.eh_frame-to-list-of-relocations-stripped.patch index cd5ec1a..096bd99 100644 --- a/0105-Add-.eh_frame-to-list-of-relocations-stripped.patch +++ b/0105-Add-.eh_frame-to-list-of-relocations-stripped.patch @@ -1,14 +1,14 @@ From 0464db837a67b88a761f100391b135a70b7054eb Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 13 Jan 2014 21:50:59 -0500 -Subject: [PATCH 105/198] Add .eh_frame to list of relocations stripped +Subject: [PATCH 105/206] Add .eh_frame to list of relocations stripped --- conf/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Makefile.common b/conf/Makefile.common -index 311da61c6..044ab3abe 100644 +index 311da61c6c5..044ab3abe88 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding @@ -21,5 +21,5 @@ index 311da61c6..044ab3abe 100644 CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d -- -2.14.3 +2.15.0 diff --git a/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch b/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch index 23c67fa..4261262 100644 --- a/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +++ b/0106-Make-10_linux-work-with-our-changes-for-linux16-and-.patch @@ -1,7 +1,7 @@ From fb582651ea4568d7226f96e6b618ad795430c842 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 13:12:23 -0500 -Subject: [PATCH 106/198] Make 10_linux work with our changes for linux16 and +Subject: [PATCH 106/206] Make 10_linux work with our changes for linux16 and linuxefi on aarch64 Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ef52cf3db..191aebe80 100644 +index ef52cf3dbbb..191aebe80bb 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -77,8 +77,18 @@ linux_entry () @@ -81,5 +81,5 @@ index ef52cf3db..191aebe80 100644 for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do if test -e "${i}" ; then -- -2.14.3 +2.15.0 diff --git a/0107-Don-t-print-during-fdt-loading-method.patch b/0107-Don-t-print-during-fdt-loading-method.patch index 383cf92..75c5a4d 100644 --- a/0107-Don-t-print-during-fdt-loading-method.patch +++ b/0107-Don-t-print-during-fdt-loading-method.patch @@ -1,7 +1,7 @@ From 40e56a4c2e879f5efcbcc36cf6a88ee1cb39d607 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 16:15:46 -0500 -Subject: [PATCH 107/198] Don't print during fdt loading method. +Subject: [PATCH 107/206] Don't print during fdt loading method. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 191aebe80..452a9f69d 100644 +index 191aebe80bb..452a9f69d28 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -164,9 +164,7 @@ EOF @@ -23,5 +23,5 @@ index 191aebe80..452a9f69d 100644 EOF fi -- -2.14.3 +2.15.0 diff --git a/0108-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch b/0108-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch index 6450831..eb27d20 100644 --- a/0108-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +++ b/0108-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch @@ -1,7 +1,7 @@ From ff25c6034ab8213d911414e666b7d44bc44496aa Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 30 Jun 2014 14:16:46 -0400 -Subject: [PATCH 108/198] Don't munge raw spaces when we're doing our cmdline +Subject: [PATCH 108/206] Don't munge raw spaces when we're doing our cmdline escaping (#923374) Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c -index 0a5b2afb9..970ea868c 100644 +index 0a5b2afb94b..970ea868c14 100644 --- a/grub-core/lib/cmdline.c +++ b/grub-core/lib/cmdline.c @@ -97,16 +97,7 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf, @@ -32,5 +32,5 @@ index 0a5b2afb9..970ea868c 100644 { *buf++ = *c++; -- -2.14.3 +2.15.0 diff --git a/0109-Don-t-require-a-password-to-boot-entries-generated-b.patch b/0109-Don-t-require-a-password-to-boot-entries-generated-b.patch index 413442b..81fa7e3 100644 --- a/0109-Don-t-require-a-password-to-boot-entries-generated-b.patch +++ b/0109-Don-t-require-a-password-to-boot-entries-generated-b.patch @@ -1,7 +1,7 @@ From 2df38f07986a91d2a06cb3e432f9121d9f678f89 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 11 Feb 2014 11:14:50 -0500 -Subject: [PATCH 109/198] Don't require a password to boot entries generated by +Subject: [PATCH 109/206] Don't require a password to boot entries generated by grub-mkconfig. When we set a password, we just want that to mean you can't /edit/ an entry. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 452a9f69d..79a747ebd 100644 +index 452a9f69d28..79a747ebd4d 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" @@ -27,5 +27,5 @@ index 452a9f69d..79a747ebd 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS="$(sed 's, release .*$,,g' /etc/system-release)" -- -2.14.3 +2.15.0 diff --git a/0110-Don-t-emit-Booting-.-message.patch b/0110-Don-t-emit-Booting-.-message.patch index f4d0679..323b051 100644 --- a/0110-Don-t-emit-Booting-.-message.patch +++ b/0110-Don-t-emit-Booting-.-message.patch @@ -1,7 +1,7 @@ From a72d4819fb7275cbf65b5de901c50d076bf861fd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 09:37:49 -0500 -Subject: [PATCH 110/198] Don't emit "Booting ..." message. +Subject: [PATCH 110/206] Don't emit "Booting ..." message. UI team still hates this stuff, so we're disabling it for RHEL 7. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index d2f64b05e..5e2f5283d 100644 +index d2f64b05e0a..5e2f5283d3d 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -838,12 +838,14 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) @@ -34,7 +34,7 @@ index d2f64b05e..5e2f5283d 100644 /* Callback invoked when a default menu entry executed because of a timeout diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c -index cdf3590a3..5785f67ee 100644 +index cdf3590a364..5785f67ee1c 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -1167,9 +1167,6 @@ run (struct screen *screen) @@ -48,5 +48,5 @@ index cdf3590a3..5785f67ee 100644 errs_before = grub_err_printed_errors; -- -2.14.3 +2.15.0 diff --git a/0111-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch b/0111-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch index ec3f88e..1d49bbc 100644 --- a/0111-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch +++ b/0111-Replace-a-lot-of-man-pages-with-slightly-nicer-ones.patch @@ -1,12 +1,12 @@ From 6412d775976361b52c0914f6e5e3b0a4b99cdba9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 4 Mar 2014 11:00:23 -0500 -Subject: [PATCH 111/198] Replace a lot of man pages with slightly nicer ones. +Subject: [PATCH 111/206] Replace a lot of man pages with slightly nicer ones. Replace a bunch of machine generated ones with ones that look nicer. --- - conf/Makefile.extra-dist | 1 - configure.ac | 23 ++++++ + conf/Makefile.extra-dist | 1 - docs/Makefile.am | 2 - docs/man/grub-bios-setup.h2m | 6 -- docs/man/grub-editenv.h2m | 5 -- @@ -121,20 +121,8 @@ Replace a bunch of machine generated ones with ones that look nicer. create mode 100644 util/grub-set-default.8 create mode 100644 util/grub-sparc64-setup.8 -diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index b16bd9253..39eb94bde 100644 ---- a/conf/Makefile.extra-dist -+++ b/conf/Makefile.extra-dist -@@ -11,7 +11,6 @@ EXTRA_DIST += unicode - EXTRA_DIST += util/import_gcry.py - EXTRA_DIST += util/import_unicode.py - --EXTRA_DIST += docs/man - EXTRA_DIST += docs/autoiso.cfg - EXTRA_DIST += docs/grub.cfg - EXTRA_DIST += docs/osdetect.cfg diff --git a/configure.ac b/configure.ac -index 9ae97f026..0cb971a92 100644 +index 9ae97f026ab..0cb971a92c5 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,29 @@ grub_TRANSFORM([grub-set-default]) @@ -167,8 +155,20 @@ index 9ae97f026..0cb971a92 100644 # Optimization flag. Allow user to override. if test "x$TARGET_CFLAGS" = x; then +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index b16bd925320..39eb94bded6 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -11,7 +11,6 @@ EXTRA_DIST += unicode + EXTRA_DIST += util/import_gcry.py + EXTRA_DIST += util/import_unicode.py + +-EXTRA_DIST += docs/man + EXTRA_DIST += docs/autoiso.cfg + EXTRA_DIST += docs/grub.cfg + EXTRA_DIST += docs/osdetect.cfg diff --git a/docs/Makefile.am b/docs/Makefile.am -index e396ba10f..0669729cc 100644 +index e396ba10f46..0669729cc57 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -5,5 +5,3 @@ info_TEXINFOS = grub.texi grub-dev.texi @@ -179,7 +179,7 @@ index e396ba10f..0669729cc 100644 - diff --git a/docs/man/grub-bios-setup.h2m b/docs/man/grub-bios-setup.h2m deleted file mode 100644 -index ac6ede362..000000000 +index ac6ede36296..00000000000 --- a/docs/man/grub-bios-setup.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -191,7 +191,7 @@ index ac6ede362..000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-editenv.h2m b/docs/man/grub-editenv.h2m deleted file mode 100644 -index 3859d3d4c..000000000 +index 3859d3d4c4f..00000000000 --- a/docs/man/grub-editenv.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -202,7 +202,7 @@ index 3859d3d4c..000000000 -.BR grub-set-default (8) diff --git a/docs/man/grub-emu.h2m b/docs/man/grub-emu.h2m deleted file mode 100644 -index ef1c00065..000000000 +index ef1c000656a..00000000000 --- a/docs/man/grub-emu.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -214,7 +214,7 @@ index ef1c00065..000000000 -rather than this program. diff --git a/docs/man/grub-file.h2m b/docs/man/grub-file.h2m deleted file mode 100644 -index e09bb4d31..000000000 +index e09bb4d3101..00000000000 --- a/docs/man/grub-file.h2m +++ /dev/null @@ -1,2 +0,0 @@ @@ -222,7 +222,7 @@ index e09bb4d31..000000000 -grub-file \- check file type diff --git a/docs/man/grub-fstest.h2m b/docs/man/grub-fstest.h2m deleted file mode 100644 -index 9676b159a..000000000 +index 9676b159afd..00000000000 --- a/docs/man/grub-fstest.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -232,7 +232,7 @@ index 9676b159a..000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-glue-efi.h2m b/docs/man/grub-glue-efi.h2m deleted file mode 100644 -index c1c6ded49..000000000 +index c1c6ded49ff..00000000000 --- a/docs/man/grub-glue-efi.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -242,7 +242,7 @@ index c1c6ded49..000000000 -grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format. diff --git a/docs/man/grub-install.h2m b/docs/man/grub-install.h2m deleted file mode 100644 -index 8cbbc87a0..000000000 +index 8cbbc87a0f2..00000000000 --- a/docs/man/grub-install.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -254,7 +254,7 @@ index 8cbbc87a0..000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-kbdcomp.h2m b/docs/man/grub-kbdcomp.h2m deleted file mode 100644 -index d81f9157e..000000000 +index d81f9157e01..00000000000 --- a/docs/man/grub-kbdcomp.h2m +++ /dev/null @@ -1,10 +0,0 @@ @@ -270,7 +270,7 @@ index d81f9157e..000000000 -.BR grub-mklayout (8) diff --git a/docs/man/grub-macbless.h2m b/docs/man/grub-macbless.h2m deleted file mode 100644 -index 0197c0087..000000000 +index 0197c0087d7..00000000000 --- a/docs/man/grub-macbless.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -280,7 +280,7 @@ index 0197c0087..000000000 -.BR grub-install (1) diff --git a/docs/man/grub-macho2img.h2m b/docs/man/grub-macho2img.h2m deleted file mode 100644 -index d79aaeed8..000000000 +index d79aaeed8f9..00000000000 --- a/docs/man/grub-macho2img.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -290,7 +290,7 @@ index d79aaeed8..000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-menulst2cfg.h2m b/docs/man/grub-menulst2cfg.h2m deleted file mode 100644 -index c2e0055ed..000000000 +index c2e0055ed7e..00000000000 --- a/docs/man/grub-menulst2cfg.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -300,7 +300,7 @@ index c2e0055ed..000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkconfig.h2m b/docs/man/grub-mkconfig.h2m deleted file mode 100644 -index 9b42f8130..000000000 +index 9b42f813010..00000000000 --- a/docs/man/grub-mkconfig.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -310,7 +310,7 @@ index 9b42f8130..000000000 -.BR grub-install (8) diff --git a/docs/man/grub-mkfont.h2m b/docs/man/grub-mkfont.h2m deleted file mode 100644 -index d46fe600e..000000000 +index d46fe600eca..00000000000 --- a/docs/man/grub-mkfont.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -320,7 +320,7 @@ index d46fe600e..000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkimage.h2m b/docs/man/grub-mkimage.h2m deleted file mode 100644 -index f0fbc2bb1..000000000 +index f0fbc2bb197..00000000000 --- a/docs/man/grub-mkimage.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -332,7 +332,7 @@ index f0fbc2bb1..000000000 -.BR grub-mknetdir (8) diff --git a/docs/man/grub-mklayout.h2m b/docs/man/grub-mklayout.h2m deleted file mode 100644 -index 1e43409c0..000000000 +index 1e43409c0ab..00000000000 --- a/docs/man/grub-mklayout.h2m +++ /dev/null @@ -1,10 +0,0 @@ @@ -348,7 +348,7 @@ index 1e43409c0..000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mknetdir.h2m b/docs/man/grub-mknetdir.h2m deleted file mode 100644 -index a2ef13ec1..000000000 +index a2ef13ec111..00000000000 --- a/docs/man/grub-mknetdir.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -358,7 +358,7 @@ index a2ef13ec1..000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mkpasswd-pbkdf2.h2m b/docs/man/grub-mkpasswd-pbkdf2.h2m deleted file mode 100644 -index 4d202f3da..000000000 +index 4d202f3da7e..00000000000 --- a/docs/man/grub-mkpasswd-pbkdf2.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -368,7 +368,7 @@ index 4d202f3da..000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkrelpath.h2m b/docs/man/grub-mkrelpath.h2m deleted file mode 100644 -index d01f3961e..000000000 +index d01f3961e3f..00000000000 --- a/docs/man/grub-mkrelpath.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -378,7 +378,7 @@ index d01f3961e..000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-mkrescue.h2m b/docs/man/grub-mkrescue.h2m deleted file mode 100644 -index a427f02e3..000000000 +index a427f02e3c6..00000000000 --- a/docs/man/grub-mkrescue.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -388,7 +388,7 @@ index a427f02e3..000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mkstandalone.h2m b/docs/man/grub-mkstandalone.h2m deleted file mode 100644 -index c77313978..000000000 +index c77313978ad..00000000000 --- a/docs/man/grub-mkstandalone.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -398,7 +398,7 @@ index c77313978..000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mount.h2m b/docs/man/grub-mount.h2m deleted file mode 100644 -index 8d168982d..000000000 +index 8d168982d72..00000000000 --- a/docs/man/grub-mount.h2m +++ /dev/null @@ -1,2 +0,0 @@ @@ -406,7 +406,7 @@ index 8d168982d..000000000 -grub-mount \- export GRUB filesystem with FUSE diff --git a/docs/man/grub-ofpathname.h2m b/docs/man/grub-ofpathname.h2m deleted file mode 100644 -index 74b43eea0..000000000 +index 74b43eea039..00000000000 --- a/docs/man/grub-ofpathname.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -416,7 +416,7 @@ index 74b43eea0..000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-pe2elf.h2m b/docs/man/grub-pe2elf.h2m deleted file mode 100644 -index 7ca29bd70..000000000 +index 7ca29bd703c..00000000000 --- a/docs/man/grub-pe2elf.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -426,7 +426,7 @@ index 7ca29bd70..000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-probe.h2m b/docs/man/grub-probe.h2m deleted file mode 100644 -index 6e1ffdcf9..000000000 +index 6e1ffdcf937..00000000000 --- a/docs/man/grub-probe.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -436,7 +436,7 @@ index 6e1ffdcf9..000000000 -.BR grub-fstest (1) diff --git a/docs/man/grub-reboot.h2m b/docs/man/grub-reboot.h2m deleted file mode 100644 -index e4acace65..000000000 +index e4acace65ce..00000000000 --- a/docs/man/grub-reboot.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -447,7 +447,7 @@ index e4acace65..000000000 -.BR grub-editenv (1) diff --git a/docs/man/grub-render-label.h2m b/docs/man/grub-render-label.h2m deleted file mode 100644 -index 50ae5247c..000000000 +index 50ae5247c05..00000000000 --- a/docs/man/grub-render-label.h2m +++ /dev/null @@ -1,3 +0,0 @@ @@ -456,7 +456,7 @@ index 50ae5247c..000000000 - diff --git a/docs/man/grub-script-check.h2m b/docs/man/grub-script-check.h2m deleted file mode 100644 -index 365368267..000000000 +index 3653682671a..00000000000 --- a/docs/man/grub-script-check.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -466,7 +466,7 @@ index 365368267..000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-set-default.h2m b/docs/man/grub-set-default.h2m deleted file mode 100644 -index 7945001c1..000000000 +index 7945001c154..00000000000 --- a/docs/man/grub-set-default.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -477,7 +477,7 @@ index 7945001c1..000000000 -.BR grub-editenv (1) diff --git a/docs/man/grub-sparc64-setup.h2m b/docs/man/grub-sparc64-setup.h2m deleted file mode 100644 -index 18f803a50..000000000 +index 18f803a50db..00000000000 --- a/docs/man/grub-sparc64-setup.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -489,7 +489,7 @@ index 18f803a50..000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-syslinux2cfg.h2m b/docs/man/grub-syslinux2cfg.h2m deleted file mode 100644 -index ad25c8ab7..000000000 +index ad25c8ab753..00000000000 --- a/docs/man/grub-syslinux2cfg.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -498,7 +498,7 @@ index ad25c8ab7..000000000 -[SEE ALSO] -.BR grub-menulst2cfg (8) diff --git a/gentpl.py b/gentpl.py -index da67965a4..bf8439fa7 100644 +index da67965a41a..bf8439fa743 100644 --- a/gentpl.py +++ b/gentpl.py @@ -802,10 +802,7 @@ def manpage(defn, adddeps): @@ -515,7 +515,7 @@ index da67965a4..bf8439fa7 100644 diff --git a/util/grub-bios-setup.8 b/util/grub-bios-setup.8 new file mode 100644 -index 000000000..56f582b3d +index 00000000000..56f582b3d75 --- /dev/null +++ b/util/grub-bios-setup.8 @@ -0,0 +1,54 @@ @@ -575,7 +575,7 @@ index 000000000..56f582b3d +.BR "info grub" diff --git a/util/grub-editenv.1 b/util/grub-editenv.1 new file mode 100644 -index 000000000..d28ba03ba +index 00000000000..d28ba03ba42 --- /dev/null +++ b/util/grub-editenv.1 @@ -0,0 +1,46 @@ @@ -627,7 +627,7 @@ index 000000000..d28ba03ba +.BR "info grub" diff --git a/util/grub-file.1 b/util/grub-file.1 new file mode 100644 -index 000000000..b29cb3278 +index 00000000000..b29cb327889 --- /dev/null +++ b/util/grub-file.1 @@ -0,0 +1,165 @@ @@ -798,7 +798,7 @@ index 000000000..b29cb3278 +.BR "info grub" diff --git a/util/grub-fstest.1 b/util/grub-fstest.1 new file mode 100644 -index 000000000..792fa7863 +index 00000000000..792fa78634c --- /dev/null +++ b/util/grub-fstest.1 @@ -0,0 +1,99 @@ @@ -903,7 +903,7 @@ index 000000000..792fa7863 +.BR "info grub" diff --git a/util/grub-glue-efi.1 b/util/grub-glue-efi.1 new file mode 100644 -index 000000000..72bd555d5 +index 00000000000..72bd555d577 --- /dev/null +++ b/util/grub-glue-efi.1 @@ -0,0 +1,31 @@ @@ -940,7 +940,7 @@ index 000000000..72bd555d5 +.BR "info grub" diff --git a/util/grub-install.8 b/util/grub-install.8 new file mode 100644 -index 000000000..76272a39d +index 00000000000..76272a39d2e --- /dev/null +++ b/util/grub-install.8 @@ -0,0 +1,129 @@ @@ -1075,7 +1075,7 @@ index 000000000..76272a39d +.BR "info grub" diff --git a/util/grub-kbdcomp.1 b/util/grub-kbdcomp.1 new file mode 100644 -index 000000000..0bb969a5b +index 00000000000..0bb969a5b43 --- /dev/null +++ b/util/grub-kbdcomp.1 @@ -0,0 +1,19 @@ @@ -1100,7 +1100,7 @@ index 000000000..0bb969a5b +.BR "info grub" diff --git a/util/grub-macbless.1 b/util/grub-macbless.1 new file mode 100644 -index 000000000..41a96186f +index 00000000000..41a96186f70 --- /dev/null +++ b/util/grub-macbless.1 @@ -0,0 +1,22 @@ @@ -1128,7 +1128,7 @@ index 000000000..41a96186f +.BR "info grub" diff --git a/util/grub-menulst2cfg.1 b/util/grub-menulst2cfg.1 new file mode 100644 -index 000000000..91e2ef871 +index 00000000000..91e2ef87113 --- /dev/null +++ b/util/grub-menulst2cfg.1 @@ -0,0 +1,12 @@ @@ -1146,7 +1146,7 @@ index 000000000..91e2ef871 +.BR "info grub" diff --git a/util/grub-mkconfig.8 b/util/grub-mkconfig.8 new file mode 100644 -index 000000000..a2d1f577b +index 00000000000..a2d1f577b9b --- /dev/null +++ b/util/grub-mkconfig.8 @@ -0,0 +1,17 @@ @@ -1169,7 +1169,7 @@ index 000000000..a2d1f577b +.BR "info grub" diff --git a/util/grub-mkfont.1 b/util/grub-mkfont.1 new file mode 100644 -index 000000000..349485798 +index 00000000000..3494857987d --- /dev/null +++ b/util/grub-mkfont.1 @@ -0,0 +1,87 @@ @@ -1262,7 +1262,7 @@ index 000000000..349485798 +.BR "info grub" diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 new file mode 100644 -index 000000000..4dea4f545 +index 00000000000..4dea4f54597 --- /dev/null +++ b/util/grub-mkimage.1 @@ -0,0 +1,95 @@ @@ -1363,7 +1363,7 @@ index 000000000..4dea4f545 +.BR "info grub" diff --git a/util/grub-mklayout.1 b/util/grub-mklayout.1 new file mode 100644 -index 000000000..d1bbc2ec5 +index 00000000000..d1bbc2ec515 --- /dev/null +++ b/util/grub-mklayout.1 @@ -0,0 +1,27 @@ @@ -1396,7 +1396,7 @@ index 000000000..d1bbc2ec5 +.BR "info grub" diff --git a/util/grub-mknetdir.1 b/util/grub-mknetdir.1 new file mode 100644 -index 000000000..fa7e8d4ef +index 00000000000..fa7e8d4ef0d --- /dev/null +++ b/util/grub-mknetdir.1 @@ -0,0 +1,12 @@ @@ -1414,7 +1414,7 @@ index 000000000..fa7e8d4ef +.BR "info grub" diff --git a/util/grub-mkpasswd-pbkdf2.1 b/util/grub-mkpasswd-pbkdf2.1 new file mode 100644 -index 000000000..73c437c15 +index 00000000000..73c437c15d8 --- /dev/null +++ b/util/grub-mkpasswd-pbkdf2.1 @@ -0,0 +1,27 @@ @@ -1447,7 +1447,7 @@ index 000000000..73c437c15 +.BR "info grub" diff --git a/util/grub-mkrelpath.1 b/util/grub-mkrelpath.1 new file mode 100644 -index 000000000..85f111362 +index 00000000000..85f1113621d --- /dev/null +++ b/util/grub-mkrelpath.1 @@ -0,0 +1,12 @@ @@ -1465,7 +1465,7 @@ index 000000000..85f111362 +.BR "info grub" diff --git a/util/grub-mkrescue.1 b/util/grub-mkrescue.1 new file mode 100644 -index 000000000..4ed9fc723 +index 00000000000..4ed9fc723fd --- /dev/null +++ b/util/grub-mkrescue.1 @@ -0,0 +1,123 @@ @@ -1594,7 +1594,7 @@ index 000000000..4ed9fc723 +.BR "info grub" diff --git a/util/grub-mkstandalone.1 b/util/grub-mkstandalone.1 new file mode 100644 -index 000000000..ba2d2bdf2 +index 00000000000..ba2d2bdf279 --- /dev/null +++ b/util/grub-mkstandalone.1 @@ -0,0 +1,100 @@ @@ -1700,7 +1700,7 @@ index 000000000..ba2d2bdf2 +.BR "info grub" diff --git a/util/grub-ofpathname.8 b/util/grub-ofpathname.8 new file mode 100644 -index 000000000..bf3743aeb +index 00000000000..bf3743aeba1 --- /dev/null +++ b/util/grub-ofpathname.8 @@ -0,0 +1,12 @@ @@ -1718,7 +1718,7 @@ index 000000000..bf3743aeb +.BR "info grub" diff --git a/util/grub-probe.8 b/util/grub-probe.8 new file mode 100644 -index 000000000..04e26c832 +index 00000000000..04e26c832bb --- /dev/null +++ b/util/grub-probe.8 @@ -0,0 +1,80 @@ @@ -1804,7 +1804,7 @@ index 000000000..04e26c832 +.BR "info grub" diff --git a/util/grub-reboot.8 b/util/grub-reboot.8 new file mode 100644 -index 000000000..faa5e4eec +index 00000000000..faa5e4eece2 --- /dev/null +++ b/util/grub-reboot.8 @@ -0,0 +1,21 @@ @@ -1831,7 +1831,7 @@ index 000000000..faa5e4eec +.BR "info grub" diff --git a/util/grub-render-label.1 b/util/grub-render-label.1 new file mode 100644 -index 000000000..4d51c8abf +index 00000000000..4d51c8abf01 --- /dev/null +++ b/util/grub-render-label.1 @@ -0,0 +1,51 @@ @@ -1888,7 +1888,7 @@ index 000000000..4d51c8abf +.BR "info grub" diff --git a/util/grub-script-check.1 b/util/grub-script-check.1 new file mode 100644 -index 000000000..0f1f625b0 +index 00000000000..0f1f625b05d --- /dev/null +++ b/util/grub-script-check.1 @@ -0,0 +1,21 @@ @@ -1915,7 +1915,7 @@ index 000000000..0f1f625b0 +.BR "info grub" diff --git a/util/grub-set-default.8 b/util/grub-set-default.8 new file mode 100644 -index 000000000..a96265a15 +index 00000000000..a96265a1509 --- /dev/null +++ b/util/grub-set-default.8 @@ -0,0 +1,21 @@ @@ -1942,7 +1942,7 @@ index 000000000..a96265a15 +.BR "info grub" diff --git a/util/grub-sparc64-setup.8 b/util/grub-sparc64-setup.8 new file mode 100644 -index 000000000..37ea2dd5e +index 00000000000..37ea2dd5eaa --- /dev/null +++ b/util/grub-sparc64-setup.8 @@ -0,0 +1,12 @@ @@ -1959,5 +1959,5 @@ index 000000000..37ea2dd5e +.SH SEE ALSO +.BR "info grub" -- -2.14.3 +2.15.0 diff --git a/0112-use-fw_path-prefix-when-fallback-searching-for-grub-.patch b/0112-use-fw_path-prefix-when-fallback-searching-for-grub-.patch index 039918e..5811d02 100644 --- a/0112-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +++ b/0112-use-fw_path-prefix-when-fallback-searching-for-grub-.patch @@ -1,7 +1,7 @@ From acf4cfa6d1691a9476b36949af7e296080c88d25 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 19 Feb 2014 15:58:43 -0500 -Subject: [PATCH 112/198] use fw_path prefix when fallback searching for grub +Subject: [PATCH 112/206] use fw_path prefix when fallback searching for grub config When PXE booting via UEFI firmware, grub was searching for grub.cfg @@ -18,7 +18,7 @@ Signed-off-by: Mark Salter 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 0ce59fdc3..a3713efcd 100644 +index 0ce59fdc3f0..a3713efcd90 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -343,7 +343,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -41,5 +41,5 @@ index 0ce59fdc3..a3713efcd 100644 { grub_size_t config_len; -- -2.14.3 +2.15.0 diff --git a/0113-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch b/0113-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch index d6b7357..15ade64 100644 --- a/0113-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +++ b/0113-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch @@ -1,7 +1,7 @@ From b7aa57a2f879d185888e4d47f77a1a30370973f9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 6 Mar 2014 11:51:33 -0500 -Subject: [PATCH 113/198] Try mac/guid/etc before grub.cfg on tftp config +Subject: [PATCH 113/206] Try mac/guid/etc before grub.cfg on tftp config files. Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index a3713efcd..7d9c4f09b 100644 +index a3713efcd90..7d9c4f09b9b 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -341,53 +341,59 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -60,26 +60,26 @@ index a3713efcd..7d9c4f09b 100644 + config_len = grub_strlen (prefix) + + sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); + config = grub_malloc (config_len); -+ -+ if (! config) -+ goto quit; - if (! config) - goto quit; -+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); ++ if (! config) ++ goto quit; - grub_snprintf (config, config_len, "%s/grub.cfg", prefix); -+ grub_net_search_configfile (config); ++ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); - if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) - grub_net_search_configfile (config); ++ grub_net_search_configfile (config); + +- grub_enter_normal_mode (config); +- grub_free (config); + grub_enter_normal_mode (config); + grub_free (config); + config = NULL; + } - -- grub_enter_normal_mode (config); -- grub_free (config); ++ + if (!config) + { + config = grub_xasprintf ("%s/grub.cfg", prefix); @@ -111,5 +111,5 @@ index a3713efcd..7d9c4f09b 100644 else grub_enter_normal_mode (argv[0]); -- -2.14.3 +2.15.0 diff --git a/0114-Fix-convert-function-to-support-NVMe-devices.patch b/0114-Fix-convert-function-to-support-NVMe-devices.patch index 100df73..123fda3 100644 --- a/0114-Fix-convert-function-to-support-NVMe-devices.patch +++ b/0114-Fix-convert-function-to-support-NVMe-devices.patch @@ -1,7 +1,7 @@ From 69946054baab92385b9f6518cc78e94810b40c48 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 11:34:00 -0500 -Subject: [PATCH 114/198] Fix convert function to support NVMe devices +Subject: [PATCH 114/206] Fix convert function to support NVMe devices This is adapted from the patch at https://bugzilla.redhat.com/show_bug.cgi?id=1019660 , which is against @@ -18,7 +18,7 @@ Signed-off-by: Peter Jones 1 file changed, 19 insertions(+) diff --git a/util/getroot.c b/util/getroot.c -index 847406fba..fa3460d6c 100644 +index 847406fbab0..fa3460d6cd8 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -153,6 +153,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) @@ -55,5 +55,5 @@ index 847406fba..fa3460d6c 100644 return grub_util_devmapper_part_to_disk (&st, is_part, os_dev); -- -2.14.3 +2.15.0 diff --git a/0115-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch b/0115-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch index 4640109..52b919f 100644 --- a/0115-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +++ b/0115-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch @@ -1,7 +1,7 @@ From f168a0803d8d35e431ef6888755f9b2622304846 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 10 Feb 2014 16:13:10 -0500 -Subject: [PATCH 115/198] Switch to use APM Mustang device tree, for hardware +Subject: [PATCH 115/206] Switch to use APM Mustang device tree, for hardware testing. Signed-off-by: David A. Marlin @@ -10,7 +10,7 @@ Signed-off-by: David A. Marlin 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 79a747ebd..462b461ff 100644 +index 79a747ebd4d..462b461ff49 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -232,8 +232,8 @@ while [ "x$list" != "x" ] ; do @@ -25,5 +25,5 @@ index 79a747ebd..462b461ff 100644 fi done -- -2.14.3 +2.15.0 diff --git a/0116-Use-the-default-device-tree-from-the-grub-default-fi.patch b/0116-Use-the-default-device-tree-from-the-grub-default-fi.patch index 1d37990..aecdde0 100644 --- a/0116-Use-the-default-device-tree-from-the-grub-default-fi.patch +++ b/0116-Use-the-default-device-tree-from-the-grub-default-fi.patch @@ -1,7 +1,7 @@ From 6ec36777aae0c4afd98f67f22d4d511b447dbb02 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 12 Feb 2014 14:54:04 -0500 -Subject: [PATCH 116/198] Use the default device tree from the grub default +Subject: [PATCH 116/206] Use the default device tree from the grub default file instead of hardcoding a value. @@ -13,7 +13,7 @@ Signed-off-by: David A. Marlin 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index c088b7054..9d595ac05 100644 +index c088b705442..9d595ac058a 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -235,7 +235,8 @@ export GRUB_DEFAULT \ @@ -27,7 +27,7 @@ index c088b7054..9d595ac05 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 462b461ff..a9692a0c2 100644 +index 462b461ff49..a9692a0c2a2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -232,8 +232,8 @@ while [ "x$list" != "x" ] ; do @@ -42,5 +42,5 @@ index 462b461ff..a9692a0c2 100644 fi done -- -2.14.3 +2.15.0 diff --git a/0117-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0117-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index e8599ae..d80b766 100644 --- a/0117-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0117-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,14 +1,14 @@ From debcbbacd18bfbbcbd5fd9dce947f2cbce09c916 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Sat, 15 Feb 2014 15:10:22 -0500 -Subject: [PATCH 117/198] reopen SNP protocol for exclusive use by grub +Subject: [PATCH 117/206] reopen SNP protocol for exclusive use by grub --- grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 5388f952b..ea0e0ca36 100644 +index 5388f952ba9..ea0e0ca360e 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -330,6 +330,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -42,5 +42,5 @@ index 5388f952b..ea0e0ca36 100644 } } -- -2.14.3 +2.15.0 diff --git a/0118-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0118-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 6a9f00a..f024073 100644 --- a/0118-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0118-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,7 +1,7 @@ From 88892eedb9beb9d8c295329fad87edb339e4e27c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Mar 2016 15:13:59 -0500 -Subject: [PATCH 118/198] Revert "reopen SNP protocol for exclusive use by +Subject: [PATCH 118/206] Revert "reopen SNP protocol for exclusive use by grub" This reverts commit a3f2c756ce34c9666bddef35e3b3b85ccecdcffc , which is @@ -17,7 +17,7 @@ Signed-off-by: Peter Jones 1 file changed, 16 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index ea0e0ca36..5388f952b 100644 +index ea0e0ca360e..5388f952ba9 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -330,7 +330,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -51,5 +51,5 @@ index ea0e0ca36..5388f952b 100644 } } -- -2.14.3 +2.15.0 diff --git a/0119-Add-grub_util_readlink.patch b/0119-Add-grub_util_readlink.patch index 5dfac40..fcc0946 100644 --- a/0119-Add-grub_util_readlink.patch +++ b/0119-Add-grub_util_readlink.patch @@ -1,7 +1,7 @@ From 9c1af9c0a44353f6b72691456a4a2883246b6346 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:01:03 -0400 -Subject: [PATCH 119/198] Add grub_util_readlink() +Subject: [PATCH 119/206] Add grub_util_readlink() Add grub_util_readlink(). This requires pulling in stat and readlink from gnulib, which pulls in stat and related headers, but after that the @@ -10,20 +10,20 @@ implementation is straightforward. Signed-off-by: Peter Jones Reviewed-by: Adam Jackson --- - grub-core/gnulib/Makefile.am | 177 +++++++- grub-core/gnulib/gettimeofday.c | 154 +++++++ - grub-core/gnulib/pathmax.h | 83 ++++ grub-core/gnulib/readlink.c | 74 ++++ grub-core/gnulib/stat.c | 138 +++++++ + grub-core/osdep/windows/hostdisk.c | 6 + + grub-core/gnulib/pathmax.h | 83 ++++ grub-core/gnulib/sys_stat.in.h | 732 ++++++++++++++++++++++++++++++++++ grub-core/gnulib/sys_time.in.h | 213 ++++++++++ grub-core/gnulib/sys_types.in.h | 2 + grub-core/gnulib/time.h | 586 +++++++++++++++++++++++++++ grub-core/gnulib/time.in.h | 274 +++++++++++++ - grub-core/osdep/windows/hostdisk.c | 6 + include/grub/osdep/hostfile_aros.h | 6 + include/grub/osdep/hostfile_unix.h | 6 + include/grub/osdep/hostfile_windows.h | 2 + + grub-core/gnulib/Makefile.am | 177 +++++++- m4/gettimeofday.m4 | 138 +++++++ m4/gnulib-cache.m4 | 3 +- m4/gnulib-comp.m4 | 49 +++ @@ -36,9 +36,9 @@ Reviewed-by: Adam Jackson m4/time_h.m4 | 118 ++++++ 24 files changed, 3295 insertions(+), 2 deletions(-) create mode 100644 grub-core/gnulib/gettimeofday.c - create mode 100644 grub-core/gnulib/pathmax.h create mode 100644 grub-core/gnulib/readlink.c create mode 100644 grub-core/gnulib/stat.c + create mode 100644 grub-core/gnulib/pathmax.h create mode 100644 grub-core/gnulib/sys_stat.in.h create mode 100644 grub-core/gnulib/sys_time.in.h create mode 100644 grub-core/gnulib/time.h @@ -52,239 +52,9 @@ Reviewed-by: Adam Jackson create mode 100644 m4/sys_time_h.m4 create mode 100644 m4/time_h.m4 -diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am -index 3444397fe..b7c5e60e1 100644 ---- a/grub-core/gnulib/Makefile.am -+++ b/grub-core/gnulib/Makefile.am -@@ -21,7 +21,7 @@ - # the same distribution terms as the rest of that program. - # - # Generated by gnulib-tool. --# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex -+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex - - AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects - -@@ -326,6 +326,15 @@ libgnu_a_SOURCES += gettext.h - - ## end gnulib module gettext-h - -+## begin gnulib module gettimeofday -+ -+ -+EXTRA_DIST += gettimeofday.c -+ -+EXTRA_libgnu_a_SOURCES += gettimeofday.c -+ -+## end gnulib module gettimeofday -+ - ## begin gnulib module havelib - - -@@ -596,6 +605,13 @@ EXTRA_libgnu_a_SOURCES += nl_langinfo.c - - ## end gnulib module nl_langinfo - -+## begin gnulib module pathmax -+ -+ -+EXTRA_DIST += pathmax.h -+ -+## end gnulib module pathmax -+ - ## begin gnulib module progname - - libgnu_a_SOURCES += progname.h progname.c -@@ -611,6 +627,15 @@ EXTRA_libgnu_a_SOURCES += rawmemchr.c - - ## end gnulib module rawmemchr - -+## begin gnulib module readlink -+ -+ -+EXTRA_DIST += readlink.c -+ -+EXTRA_libgnu_a_SOURCES += readlink.c -+ -+## end gnulib module readlink -+ - ## begin gnulib module realloc-posix - - -@@ -725,6 +750,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h - - ## end gnulib module snippet/warn-on-use - -+## begin gnulib module stat -+ -+ -+EXTRA_DIST += stat.c -+ -+EXTRA_libgnu_a_SOURCES += stat.c -+ -+## end gnulib module stat -+ - ## begin gnulib module stdalign - - BUILT_SOURCES += $(STDALIGN_H) -@@ -1280,6 +1314,102 @@ libgnu_a_SOURCES += strnlen1.h strnlen1.c - - ## end gnulib module strnlen1 - -+## begin gnulib module sys_stat -+ -+BUILT_SOURCES += sys/stat.h -+ -+# We need the following in order to create when the system -+# has one that is incomplete. -+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_at)$(MKDIR_P) sys -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ -+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ -+ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ -+ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -+ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -+ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ -+ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -+ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ -+ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -+ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -+ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ -+ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ -+ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ -+ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -+ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ -+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ -+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ -+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ -+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ -+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ -+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ -+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ -+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ -+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ -+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ -+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ -+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/sys_stat.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t -+MOSTLYCLEANDIRS += sys -+ -+EXTRA_DIST += sys_stat.in.h -+ -+## end gnulib module sys_stat -+ -+## begin gnulib module sys_time -+ -+BUILT_SOURCES += sys/time.h -+ -+# We need the following in order to create when the system -+# doesn't have one that works with the given compiler. -+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_at)$(MKDIR_P) sys -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -+ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ -+ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ -+ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -+ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/sys_time.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += sys/time.h sys/time.h-t -+ -+EXTRA_DIST += sys_time.in.h -+ -+## end gnulib module sys_time -+ - ## begin gnulib module sys_types - - BUILT_SOURCES += sys/types.h -@@ -1334,6 +1464,51 @@ EXTRA_DIST += sysexits.in.h - - ## end gnulib module sysexits - -+## begin gnulib module time -+ -+BUILT_SOURCES += time.h -+ -+# We need the following in order to create when the system -+# doesn't have one that works with the given compiler. -+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ -+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -+ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ -+ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ -+ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -+ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ -+ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ -+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ -+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ -+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/time.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += time.h time.h-t -+ -+EXTRA_DIST += time.in.h -+ -+## end gnulib module time -+ - ## begin gnulib module unistd - - BUILT_SOURCES += unistd.h diff --git a/grub-core/gnulib/gettimeofday.c b/grub-core/gnulib/gettimeofday.c new file mode 100644 -index 000000000..8b2058e8c +index 00000000000..8b2058e8c87 --- /dev/null +++ b/grub-core/gnulib/gettimeofday.c @@ -0,0 +1,154 @@ @@ -442,98 +212,9 @@ index 000000000..8b2058e8c + +#endif +} -diff --git a/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h -new file mode 100644 -index 000000000..33fc3553d ---- /dev/null -+++ b/grub-core/gnulib/pathmax.h -@@ -0,0 +1,83 @@ -+/* Define PATH_MAX somehow. Requires sys/types.h. -+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2014 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, 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 . */ -+ -+#ifndef _PATHMAX_H -+# define _PATHMAX_H -+ -+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename, -+ including the terminating NUL byte. -+ -+ PATH_MAX is not defined on systems which have no limit on filename length, -+ such as GNU/Hurd. -+ -+ This file does *not* define PATH_MAX always. Programs that use this file -+ can handle the GNU/Hurd case in several ways: -+ - Either with a package-wide handling, or with a per-file handling, -+ - Either through a -+ #ifdef PATH_MAX -+ or through a fallback like -+ #ifndef PATH_MAX -+ # define PATH_MAX 8192 -+ #endif -+ or through a fallback like -+ #ifndef PATH_MAX -+ # define PATH_MAX pathconf ("/", _PC_PATH_MAX) -+ #endif -+ */ -+ -+# include -+ -+# include -+ -+# ifndef _POSIX_PATH_MAX -+# define _POSIX_PATH_MAX 256 -+# endif -+ -+/* Don't include sys/param.h if it already has been. */ -+# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN -+# include -+# endif -+ -+# if !defined PATH_MAX && defined MAXPATHLEN -+# define PATH_MAX MAXPATHLEN -+# endif -+ -+# ifdef __hpux -+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename, -+ *not* including the terminating NUL byte, and is set to 1023. -+ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is -+ not defined at all any more. */ -+# undef PATH_MAX -+# define PATH_MAX 1024 -+# endif -+ -+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, -+ section "Maximum Path Length Limitation", -+ -+ explains that the maximum size of a filename, including the terminating -+ NUL byte, is 260 = 3 + 256 + 1. -+ This is the same value as -+ - FILENAME_MAX in , -+ - _MAX_PATH in , -+ - MAX_PATH in . -+ Undefine the original value, because mingw's gets it wrong. */ -+# undef PATH_MAX -+# define PATH_MAX 260 -+# endif -+ -+#endif /* _PATHMAX_H */ diff --git a/grub-core/gnulib/readlink.c b/grub-core/gnulib/readlink.c new file mode 100644 -index 000000000..4c4963951 +index 00000000000..4c496395176 --- /dev/null +++ b/grub-core/gnulib/readlink.c @@ -0,0 +1,74 @@ @@ -613,7 +294,7 @@ index 000000000..4c4963951 +#endif /* HAVE_READLINK */ diff --git a/grub-core/gnulib/stat.c b/grub-core/gnulib/stat.c new file mode 100644 -index 000000000..35f4b0b1a +index 00000000000..35f4b0b1a51 --- /dev/null +++ b/grub-core/gnulib/stat.c @@ -0,0 +1,138 @@ @@ -755,9 +436,115 @@ index 000000000..35f4b0b1a +#endif /* REPLACE_FUNC_STAT_DIR */ + return result; +} +diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c +index 85507af88e3..6f49df465d7 100644 +--- a/grub-core/osdep/windows/hostdisk.c ++++ b/grub-core/osdep/windows/hostdisk.c +@@ -353,6 +353,12 @@ grub_util_mkdir (const char *dir) + free (windows_name); + } + ++ssize_t ++grub_util_readlink (const char *name, char *buf, size_t bufsize) ++{ ++ return readlink(name, buf, bufsize); ++} ++ + int + grub_util_rename (const char *from, const char *to) + { +diff --git a/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h +new file mode 100644 +index 00000000000..33fc3553d75 +--- /dev/null ++++ b/grub-core/gnulib/pathmax.h +@@ -0,0 +1,83 @@ ++/* Define PATH_MAX somehow. Requires sys/types.h. ++ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2014 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, 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 . */ ++ ++#ifndef _PATHMAX_H ++# define _PATHMAX_H ++ ++/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename, ++ including the terminating NUL byte. ++ ++ PATH_MAX is not defined on systems which have no limit on filename length, ++ such as GNU/Hurd. ++ ++ This file does *not* define PATH_MAX always. Programs that use this file ++ can handle the GNU/Hurd case in several ways: ++ - Either with a package-wide handling, or with a per-file handling, ++ - Either through a ++ #ifdef PATH_MAX ++ or through a fallback like ++ #ifndef PATH_MAX ++ # define PATH_MAX 8192 ++ #endif ++ or through a fallback like ++ #ifndef PATH_MAX ++ # define PATH_MAX pathconf ("/", _PC_PATH_MAX) ++ #endif ++ */ ++ ++# include ++ ++# include ++ ++# ifndef _POSIX_PATH_MAX ++# define _POSIX_PATH_MAX 256 ++# endif ++ ++/* Don't include sys/param.h if it already has been. */ ++# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN ++# include ++# endif ++ ++# if !defined PATH_MAX && defined MAXPATHLEN ++# define PATH_MAX MAXPATHLEN ++# endif ++ ++# ifdef __hpux ++/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename, ++ *not* including the terminating NUL byte, and is set to 1023. ++ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is ++ not defined at all any more. */ ++# undef PATH_MAX ++# define PATH_MAX 1024 ++# endif ++ ++# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, ++ section "Maximum Path Length Limitation", ++ ++ explains that the maximum size of a filename, including the terminating ++ NUL byte, is 260 = 3 + 256 + 1. ++ This is the same value as ++ - FILENAME_MAX in , ++ - _MAX_PATH in , ++ - MAX_PATH in . ++ Undefine the original value, because mingw's gets it wrong. */ ++# undef PATH_MAX ++# define PATH_MAX 260 ++# endif ++ ++#endif /* _PATHMAX_H */ diff --git a/grub-core/gnulib/sys_stat.in.h b/grub-core/gnulib/sys_stat.in.h new file mode 100644 -index 000000000..b47a7ff0a +index 00000000000..b47a7ff0ae7 --- /dev/null +++ b/grub-core/gnulib/sys_stat.in.h @@ -0,0 +1,732 @@ @@ -1495,7 +1282,7 @@ index 000000000..b47a7ff0a +#endif diff --git a/grub-core/gnulib/sys_time.in.h b/grub-core/gnulib/sys_time.in.h new file mode 100644 -index 000000000..30057ad49 +index 00000000000..30057ad49fd --- /dev/null +++ b/grub-core/gnulib/sys_time.in.h @@ -0,0 +1,213 @@ @@ -1713,7 +1500,7 @@ index 000000000..30057ad49 +#endif /* _CYGWIN_SYS_TIME_H */ +#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ diff --git a/grub-core/gnulib/sys_types.in.h b/grub-core/gnulib/sys_types.in.h -index d7da35623..9520c0903 100644 +index d7da35623b1..9520c09030c 100644 --- a/grub-core/gnulib/sys_types.in.h +++ b/grub-core/gnulib/sys_types.in.h @@ -23,7 +23,9 @@ @@ -1728,7 +1515,7 @@ index d7da35623..9520c0903 100644 #define _@GUARD_PREFIX@_SYS_TYPES_H diff --git a/grub-core/gnulib/time.h b/grub-core/gnulib/time.h new file mode 100644 -index 000000000..b9203d556 +index 00000000000..b9203d5569a --- /dev/null +++ b/grub-core/gnulib/time.h @@ -0,0 +1,586 @@ @@ -2320,7 +2107,7 @@ index 000000000..b9203d556 +#endif diff --git a/grub-core/gnulib/time.in.h b/grub-core/gnulib/time.in.h new file mode 100644 -index 000000000..81abdf46e +index 00000000000..81abdf46e0b --- /dev/null +++ b/grub-core/gnulib/time.in.h @@ -0,0 +1,274 @@ @@ -2598,25 +2385,8 @@ index 000000000..81abdf46e +# endif + +#endif -diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c -index 85507af88..6f49df465 100644 ---- a/grub-core/osdep/windows/hostdisk.c -+++ b/grub-core/osdep/windows/hostdisk.c -@@ -353,6 +353,12 @@ grub_util_mkdir (const char *dir) - free (windows_name); - } - -+ssize_t -+grub_util_readlink (const char *name, char *buf, size_t bufsize) -+{ -+ return readlink(name, buf, bufsize); -+} -+ - int - grub_util_rename (const char *from, const char *to) - { diff --git a/include/grub/osdep/hostfile_aros.h b/include/grub/osdep/hostfile_aros.h -index a059c0fa4..161fbb7bd 100644 +index a059c0fa40a..161fbb7bdfd 100644 --- a/include/grub/osdep/hostfile_aros.h +++ b/include/grub/osdep/hostfile_aros.h @@ -68,6 +68,12 @@ grub_util_rename (const char *from, const char *to) @@ -2633,7 +2403,7 @@ index a059c0fa4..161fbb7bd 100644 struct grub_util_fd diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/hostfile_unix.h -index 9ffe46fa3..17cd3aa8b 100644 +index 9ffe46fa3ca..17cd3aa8b30 100644 --- a/include/grub/osdep/hostfile_unix.h +++ b/include/grub/osdep/hostfile_unix.h @@ -71,6 +71,12 @@ grub_util_rename (const char *from, const char *to) @@ -2650,7 +2420,7 @@ index 9ffe46fa3..17cd3aa8b 100644 #if defined (__NetBSD__) diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h -index bf6451b6d..8c92d0591 100644 +index bf6451b6db4..8c92d0591bb 100644 --- a/include/grub/osdep/hostfile_windows.h +++ b/include/grub/osdep/hostfile_windows.h @@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t; @@ -2662,9 +2432,239 @@ index bf6451b6d..8c92d0591 100644 int grub_util_unlink (const char *name); void +diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am +index 3444397fe37..b7c5e60e1c3 100644 +--- a/grub-core/gnulib/Makefile.am ++++ b/grub-core/gnulib/Makefile.am +@@ -21,7 +21,7 @@ + # the same distribution terms as the rest of that program. + # + # Generated by gnulib-tool. +-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex ++# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex + + AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects + +@@ -326,6 +326,15 @@ libgnu_a_SOURCES += gettext.h + + ## end gnulib module gettext-h + ++## begin gnulib module gettimeofday ++ ++ ++EXTRA_DIST += gettimeofday.c ++ ++EXTRA_libgnu_a_SOURCES += gettimeofday.c ++ ++## end gnulib module gettimeofday ++ + ## begin gnulib module havelib + + +@@ -596,6 +605,13 @@ EXTRA_libgnu_a_SOURCES += nl_langinfo.c + + ## end gnulib module nl_langinfo + ++## begin gnulib module pathmax ++ ++ ++EXTRA_DIST += pathmax.h ++ ++## end gnulib module pathmax ++ + ## begin gnulib module progname + + libgnu_a_SOURCES += progname.h progname.c +@@ -611,6 +627,15 @@ EXTRA_libgnu_a_SOURCES += rawmemchr.c + + ## end gnulib module rawmemchr + ++## begin gnulib module readlink ++ ++ ++EXTRA_DIST += readlink.c ++ ++EXTRA_libgnu_a_SOURCES += readlink.c ++ ++## end gnulib module readlink ++ + ## begin gnulib module realloc-posix + + +@@ -725,6 +750,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h + + ## end gnulib module snippet/warn-on-use + ++## begin gnulib module stat ++ ++ ++EXTRA_DIST += stat.c ++ ++EXTRA_libgnu_a_SOURCES += stat.c ++ ++## end gnulib module stat ++ + ## begin gnulib module stdalign + + BUILT_SOURCES += $(STDALIGN_H) +@@ -1280,6 +1314,102 @@ libgnu_a_SOURCES += strnlen1.h strnlen1.c + + ## end gnulib module strnlen1 + ++## begin gnulib module sys_stat ++ ++BUILT_SOURCES += sys/stat.h ++ ++# We need the following in order to create when the system ++# has one that is incomplete. ++sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_at)$(MKDIR_P) sys ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ ++ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ ++ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ ++ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ ++ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ ++ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ ++ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ ++ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ ++ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ ++ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ ++ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ ++ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ ++ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ ++ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ ++ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ ++ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ ++ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ ++ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ ++ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ ++ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ ++ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ ++ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ ++ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ ++ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ ++ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ ++ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ ++ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ ++ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ ++ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ ++ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ ++ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ ++ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ ++ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ ++ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ ++ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/sys_stat.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t ++MOSTLYCLEANDIRS += sys ++ ++EXTRA_DIST += sys_stat.in.h ++ ++## end gnulib module sys_stat ++ ++## begin gnulib module sys_time ++ ++BUILT_SOURCES += sys/time.h ++ ++# We need the following in order to create when the system ++# doesn't have one that works with the given compiler. ++sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_at)$(MKDIR_P) sys ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ ++ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ ++ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ ++ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ ++ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ ++ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ ++ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/sys_time.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += sys/time.h sys/time.h-t ++ ++EXTRA_DIST += sys_time.in.h ++ ++## end gnulib module sys_time ++ + ## begin gnulib module sys_types + + BUILT_SOURCES += sys/types.h +@@ -1334,6 +1464,51 @@ EXTRA_DIST += sysexits.in.h + + ## end gnulib module sysexits + ++## begin gnulib module time ++ ++BUILT_SOURCES += time.h ++ ++# We need the following in order to create when the system ++# doesn't have one that works with the given compiler. ++time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ ++ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ ++ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ ++ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ ++ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ ++ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ ++ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ ++ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ ++ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ ++ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ ++ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ ++ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ ++ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ ++ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ ++ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ ++ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ ++ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ ++ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/time.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += time.h time.h-t ++ ++EXTRA_DIST += time.in.h ++ ++## end gnulib module time ++ + ## begin gnulib module unistd + + BUILT_SOURCES += unistd.h diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 new file mode 100644 -index 000000000..1c2d66ee2 +index 00000000000..1c2d66ee261 --- /dev/null +++ b/m4/gettimeofday.m4 @@ -0,0 +1,138 @@ @@ -2807,7 +2807,7 @@ index 000000000..1c2d66ee2 + AC_CHECK_FUNCS([_ftime]) +]) diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 -index 408918440..ef2ec5bcc 100644 +index 408918440b6..ef2ec5bcce0 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ @@ -2828,7 +2828,7 @@ index 408918440..ef2ec5bcc 100644 ]) gl_AVOID([]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 -index 7a19f60d8..66fd0eda9 100644 +index 7a19f60d85e..66fd0eda901 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -60,10 +60,13 @@ AC_DEFUN([gl_EARLY], @@ -3035,7 +3035,7 @@ index 7a19f60d8..66fd0eda9 100644 m4/vasnprintf.m4 diff --git a/m4/largefile.m4 b/m4/largefile.m4 new file mode 100644 -index 000000000..a1b564ad9 +index 00000000000..a1b564ad9af --- /dev/null +++ b/m4/largefile.m4 @@ -0,0 +1,146 @@ @@ -3187,7 +3187,7 @@ index 000000000..a1b564ad9 +]) diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 new file mode 100644 -index 000000000..114f91f04 +index 00000000000..114f91f04b5 --- /dev/null +++ b/m4/pathmax.m4 @@ -0,0 +1,42 @@ @@ -3235,7 +3235,7 @@ index 000000000..114f91f04 +]) diff --git a/m4/readlink.m4 b/m4/readlink.m4 new file mode 100644 -index 000000000..f9ce868c2 +index 00000000000..f9ce868c2e4 --- /dev/null +++ b/m4/readlink.m4 @@ -0,0 +1,71 @@ @@ -3312,7 +3312,7 @@ index 000000000..f9ce868c2 +]) diff --git a/m4/stat.m4 b/m4/stat.m4 new file mode 100644 -index 000000000..1ae327b36 +index 00000000000..1ae327b3684 --- /dev/null +++ b/m4/stat.m4 @@ -0,0 +1,71 @@ @@ -3389,7 +3389,7 @@ index 000000000..1ae327b36 +AC_DEFUN([gl_PREREQ_STAT], [:]) diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 new file mode 100644 -index 000000000..eaa7642ba +index 00000000000..eaa7642ba31 --- /dev/null +++ b/m4/sys_stat_h.m4 @@ -0,0 +1,96 @@ @@ -3491,7 +3491,7 @@ index 000000000..eaa7642ba +]) diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 new file mode 100644 -index 000000000..5c79300f8 +index 00000000000..5c79300f8ec --- /dev/null +++ b/m4/sys_time_h.m4 @@ -0,0 +1,110 @@ @@ -3607,7 +3607,7 @@ index 000000000..5c79300f8 +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 new file mode 100644 -index 000000000..9852778f9 +index 00000000000..9852778f9a5 --- /dev/null +++ b/m4/time_h.m4 @@ -0,0 +1,118 @@ @@ -3730,5 +3730,5 @@ index 000000000..9852778f9 + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) +]) -- -2.14.3 +2.15.0 diff --git a/0120-Make-editenv-chase-symlinks-including-those-across-d.patch b/0120-Make-editenv-chase-symlinks-including-those-across-d.patch index a19f196..faee07b 100644 --- a/0120-Make-editenv-chase-symlinks-including-those-across-d.patch +++ b/0120-Make-editenv-chase-symlinks-including-those-across-d.patch @@ -1,7 +1,7 @@ From 5c54e71e4b4a3f8fbfedd5eca821238a7d80b491 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:38:00 -0400 -Subject: [PATCH 120/198] Make editenv chase symlinks including those across +Subject: [PATCH 120/206] Make editenv chase symlinks including those across devices. This lets us make /boot/grub2/grubenv a symlink to @@ -17,7 +17,7 @@ Reviewed-by: Adam Jackson 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Makefile.util.def b/Makefile.util.def -index 6d452da02..206110458 100644 +index 6d452da029f..20611045893 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -230,8 +230,17 @@ program = { @@ -39,7 +39,7 @@ index 6d452da02..206110458 100644 ldadd = libgrubgcry.a; ldadd = libgrubkern.a; diff --git a/util/editenv.c b/util/editenv.c -index c6f8d2298..d8d1dad6a 100644 +index c6f8d2298c3..d8d1dad6ab9 100644 --- a/util/editenv.c +++ b/util/editenv.c @@ -37,6 +37,7 @@ grub_util_create_envblk_file (const char *name) @@ -102,5 +102,5 @@ index c6f8d2298..d8d1dad6a 100644 + free (rename_target); } -- -2.14.3 +2.15.0 diff --git a/0121-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/0121-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch index e9a586b..822a806 100644 --- a/0121-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +++ b/0121-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch @@ -1,7 +1,7 @@ From 7ca8e2b9e23a3588654d53a8e84bb22743896f80 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 14:23:23 -0400 -Subject: [PATCH 121/198] Generate OS and CLASS in 10_linux from +Subject: [PATCH 121/206] Generate OS and CLASS in 10_linux from /etc/os-release This makes us use pretty names in the titles we generate in @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index a9692a0c2..c6627268c 100644 +index a9692a0c2a2..c6627268cca 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" @@ -29,5 +29,5 @@ index a9692a0c2..c6627268c 100644 OS="${GRUB_DISTRIBUTOR}" CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" -- -2.14.3 +2.15.0 diff --git a/0122-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/0122-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch index 71dc18c..357ec72 100644 --- a/0122-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +++ b/0122-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch @@ -1,7 +1,7 @@ From e84a66eb07c96db182d57f4d40ff7c607a0e5296 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 4 Sep 2014 15:52:08 -0400 -Subject: [PATCH 122/198] Minimize the sort ordering for .debug and -rescue- +Subject: [PATCH 122/206] Minimize the sort ordering for .debug and -rescue- kernels. Resolves: rhbz#1065360 @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index cf35e4174..10fabee5e 100644 +index cf35e417470..10fabee5e14 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -248,6 +248,14 @@ version_test_gt () @@ -30,5 +30,5 @@ index cf35e4174..10fabee5e 100644 version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" return "$?" -- -2.14.3 +2.15.0 diff --git a/0123-Load-arm-with-SB-enabled.patch b/0123-Load-arm-with-SB-enabled.patch index f4dd7b6..aac767b 100644 --- a/0123-Load-arm-with-SB-enabled.patch +++ b/0123-Load-arm-with-SB-enabled.patch @@ -1,7 +1,7 @@ -From 87206b6fc4fcb9ac5fb5778ec7c9fbb4ef1841b7 Mon Sep 17 00:00:00 2001 +From b68b3292d6a5aa057a39b8098bcd1299a210921c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 18 Sep 2014 11:26:14 -0400 -Subject: [PATCH 123/198] Load arm with SB enabled. +Subject: [PATCH 123/206] Load arm with SB enabled. Make sure we actually try to validate secure boot on this platform (even though we're not shipping it enabled by default.) @@ -11,17 +11,17 @@ kernel command line, because we can't call systab->bs->LoadImage() if SB is enabled. --- grub-core/Makefile.core.def | 3 + - grub-core/loader/arm64/linux.c | 116 ++++++++++++++++++++------------------ - grub-core/loader/efi/linux.c | 65 +++++++++++++++++++++ - grub-core/loader/i386/efi/linux.c | 39 +------------ + grub-core/loader/arm64/linux.c | 121 ++++++++++++++++++++------------------ + grub-core/loader/efi/linux.c | 65 ++++++++++++++++++++ + grub-core/loader/i386/efi/linux.c | 39 +----------- include/grub/arm64/linux.h | 7 +++ include/grub/efi/linux.h | 31 ++++++++++ - 6 files changed, 171 insertions(+), 90 deletions(-) + 6 files changed, 173 insertions(+), 93 deletions(-) create mode 100644 grub-core/loader/efi/linux.c create mode 100644 include/grub/efi/linux.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 7f3d5a2bf..5ae70204c 100644 +index 7f3d5a2bfe6..5ae70204cd2 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1709,6 +1709,8 @@ module = { @@ -42,7 +42,7 @@ index 7f3d5a2bf..5ae70204c 100644 enable = x86_64_efi; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 746edd104..03ff83563 100644 +index 746edd10415..33345d37534 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -28,6 +28,7 @@ @@ -71,41 +71,20 @@ index 746edd104..03ff83563 100644 void *fdt; -@@ -100,6 +103,25 @@ finalize_params_linux (void) +@@ -100,79 +103,73 @@ finalize_params_linux (void) if (grub_fdt_install() != GRUB_ERR_NONE) goto failure; -+ grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", -+ fdt); -+ -+ /* Convert command line to UCS-2 */ -+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ if (!loaded_image) -+ goto failure; -+ -+ loaded_image->load_options_size = len = -+ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); -+ loaded_image->load_options = -+ grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); -+ if (!loaded_image->load_options) -+ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters"); -+ -+ loaded_image->load_options_size = -+ 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, -+ (grub_uint8_t *) linux_args, len, NULL); -+ - return GRUB_ERR_NONE; - - failure: -@@ -107,72 +129,47 @@ failure: - return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); - } - +- return GRUB_ERR_NONE; +- +-failure: +- grub_fdt_unload(); +- return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); +-} +- -grub_err_t -grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) -+static void -+free_params (void) - { +-{ - grub_efi_memory_mapped_device_path_t *mempath; - grub_efi_handle_t image_handle; - grub_efi_boot_services_t *b; @@ -123,8 +102,7 @@ index 746edd104..03ff83563 100644 - mempath[0].memory_type = GRUB_EFI_LOADER_DATA; - mempath[0].start_address = addr; - mempath[0].end_address = addr + size; -+ grub_efi_loaded_image_t *loaded_image = NULL; - +- - mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; - mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; - mempath[1].header.length = sizeof (grub_efi_device_path_t); @@ -135,6 +113,50 @@ index 746edd104..03ff83563 100644 - (void *) addr, size, &image_handle); - if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); +- +- grub_dprintf ("linux", "linux command line: '%s'\n", args); ++ grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", ++ fdt); + + /* Convert command line to UCS-2 */ +- loaded_image = grub_efi_get_loaded_image (image_handle); ++ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (!loaded_image) ++ goto failure; ++ + loaded_image->load_options_size = len = +- (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); ++ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); + loaded_image->load_options = + grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); + if (!loaded_image->load_options) +- return grub_errno; ++ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters"); + + loaded_image->load_options_size = + 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, +- (grub_uint8_t *) args, len, NULL); ++ (grub_uint8_t *) linux_args, len, NULL); + +- grub_dprintf ("linux", "starting image %p\n", image_handle); +- status = b->start_image (image_handle, 0, NULL); ++ return GRUB_ERR_NONE; + +- /* When successful, not reached */ +- b->unload_image (image_handle); +- grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, +- GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); ++failure: ++ grub_fdt_unload(); ++ return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); ++} + +- return grub_errno; ++static void ++free_params (void) ++{ ++ grub_efi_loaded_image_t *loaded_image = NULL; ++ + loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); + if (loaded_image) + { @@ -146,40 +168,21 @@ index 746edd104..03ff83563 100644 + loaded_image->load_options_size = 0; + } +} - -- grub_dprintf ("linux", "linux command line: '%s'\n", args); ++ +grub_err_t +grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args) +{ + grub_err_t retval; - -- /* Convert command line to UCS-2 */ -- loaded_image = grub_efi_get_loaded_image (image_handle); -- loaded_image->load_options_size = len = -- (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); -- loaded_image->load_options = -- grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); -- if (!loaded_image->load_options) ++ + retval = finalize_params_linux (); + if (retval != GRUB_ERR_NONE) - return grub_errno; - -- loaded_image->load_options_size = -- 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, -- (grub_uint8_t *) args, len, NULL); -- -- grub_dprintf ("linux", "starting image %p\n", image_handle); -- status = b->start_image (image_handle, 0, NULL); ++ return grub_errno; ++ + grub_dprintf ("linux", "linux command line: '%s'\n", args); - -- /* When successful, not reached */ -- b->unload_image (image_handle); -- grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, -- GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); ++ + retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, + kernel_addr); - -- return grub_errno; ++ + /* Never reached... */ + free_params(); + return retval; @@ -224,7 +227,7 @@ index 746edd104..03ff83563 100644 if (!linux_args) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c new file mode 100644 -index 000000000..aea378adf +index 00000000000..aea378adf5c --- /dev/null +++ b/grub-core/loader/efi/linux.c @@ -0,0 +1,65 @@ @@ -294,7 +297,7 @@ index 000000000..aea378adf + return GRUB_ERR_BUG; +} diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index b79e6320b..e5b778577 100644 +index b79e6320ba9..e5b778577f9 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -26,6 +26,7 @@ @@ -361,7 +364,7 @@ index b79e6320b..e5b778577 100644 static grub_err_t diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index a981df5d1..0df384133 100644 +index a981df5d15f..0df38413338 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -20,6 +20,7 @@ @@ -386,7 +389,7 @@ index a981df5d1..0df384133 100644 #endif /* ! GRUB_LINUX_CPU_HEADER */ diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h new file mode 100644 -index 000000000..d9ede3677 +index 00000000000..d9ede36773b --- /dev/null +++ b/include/grub/efi/linux.h @@ -0,0 +1,31 @@ @@ -422,5 +425,5 @@ index 000000000..d9ede3677 + +#endif /* ! GRUB_EFI_LINUX_HEADER */ -- -2.14.3 +2.15.0 diff --git a/0124-Try-prefix-if-fw_path-doesn-t-work.patch b/0124-Try-prefix-if-fw_path-doesn-t-work.patch index ce9979e..4470f3c 100644 --- a/0124-Try-prefix-if-fw_path-doesn-t-work.patch +++ b/0124-Try-prefix-if-fw_path-doesn-t-work.patch @@ -1,19 +1,19 @@ -From 2d50086f8689da717502383fc3f29678493a054b Mon Sep 17 00:00:00 2001 +From fb91332cc8f381b7dea94fbc3db4d9e92a7959c1 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 3 Oct 2014 11:08:03 -0400 -Subject: [PATCH 124/198] Try $prefix if $fw_path doesn't work. +Subject: [PATCH 124/206] Try $prefix if $fw_path doesn't work. Related: rhbz#1148652 Signed-off-by: Peter Jones --- - grub-core/kern/ieee1275/init.c | 30 ++++++----- + grub-core/kern/ieee1275/init.c | 28 +++++----- grub-core/net/net.c | 2 +- - grub-core/normal/main.c | 118 ++++++++++++++++++++--------------------- + grub-core/normal/main.c | 120 ++++++++++++++++++++--------------------- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index e69c0133e..4dfa41a37 100644 +index e69c0133e69..4dfa41a37d5 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -138,23 +138,25 @@ grub_machine_get_bootlocation (char **device, char **path) @@ -35,11 +35,10 @@ index e69c0133e..4dfa41a37 100644 { - *lastslash = '\0'; - grub_translate_ieee1275_path (filename); -- ++ char *lastslash = grub_strrchr (filename, '\\'); + - *path = filename; - } -+ char *lastslash = grub_strrchr (filename, '\\'); -+ + /* Truncate at last directory. */ + if (lastslash) + { @@ -57,7 +56,7 @@ index e69c0133e..4dfa41a37 100644 } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 0769bf850..16d2ce06d 100644 +index 0769bf850d3..16d2ce06d5a 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1850,7 +1850,7 @@ grub_net_search_configfile (char *config) @@ -70,7 +69,7 @@ index 0769bf850..16d2ce06d 100644 static struct grub_preboot *fini_hnd; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 7d9c4f09b..b69f9e738 100644 +index 7d9c4f09b9b..b69f9e738fa 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config) @@ -131,10 +130,7 @@ index 7d9c4f09b..b69f9e738 100644 int argc, char *argv[]) { - if (argc == 0) -+ if (argc) -+ grub_enter_normal_mode (argv[0]); -+ else - { +- { - /* Guess the config filename. It is necessary to make CONFIG static, - so that it won't get broken by longjmp. */ - char *config; @@ -191,6 +187,12 @@ index 7d9c4f09b..b69f9e738 100644 - { - grub_enter_normal_mode (0); - } +- } +- else ++ if (argc) + grub_enter_normal_mode (argv[0]); ++ else ++ { + /* Guess the config filename. */ + grub_err_t err; + err = grub_try_normal ("fw_path"); @@ -198,14 +200,12 @@ index 7d9c4f09b..b69f9e738 100644 + err = grub_try_normal ("prefix"); + if (err == GRUB_ERR_FILE_NOT_FOUND) + grub_enter_normal_mode (0); - } -- else -- grub_enter_normal_mode (argv[0]); ++ } -quit: return 0; } -- -2.14.3 +2.15.0 diff --git a/0125-Update-info-with-grub.cfg-netboot-selection-order-11.patch b/0125-Update-info-with-grub.cfg-netboot-selection-order-11.patch index f430645..630958e 100644 --- a/0125-Update-info-with-grub.cfg-netboot-selection-order-11.patch +++ b/0125-Update-info-with-grub.cfg-netboot-selection-order-11.patch @@ -1,7 +1,7 @@ -From ce7e8db6a534b0b3653ec8a20bdd5550500706f4 Mon Sep 17 00:00:00 2001 +From ba1c8a307d0a3f2a606b3c3a6e1619504c47d3da Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 16 Mar 2015 16:34:51 -0400 -Subject: [PATCH 125/198] Update info with grub.cfg netboot selection order +Subject: [PATCH 125/206] Update info with grub.cfg netboot selection order (#1148650) Added documentation to the grub info page that specifies the order @@ -13,7 +13,7 @@ Resolves rhbz#1148650 1 file changed, 42 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index 6fdd2a041..15a90b26e 100644 +index 6fdd2a041f7..15a90b26e4d 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -2414,6 +2414,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 @@ -66,5 +66,5 @@ index 6fdd2a041..15a90b26e 100644 @samp{(tftp)} device. -- -2.14.3 +2.15.0 diff --git a/0126-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/0126-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch index 31bc5be..3df7e2f 100644 --- a/0126-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +++ b/0126-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch @@ -1,7 +1,7 @@ -From 3bafdc90cd92f95c0dbc373ae9f408d5f6883ec3 Mon Sep 17 00:00:00 2001 +From 786e54febcc536a1b8a5fa2fbe0828eb3c66d792 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 16 Mar 2015 14:14:19 -0400 -Subject: [PATCH 126/198] Use Distribution Package Sort for grub2-mkconfig +Subject: [PATCH 126/206] Use Distribution Package Sort for grub2-mkconfig (#1124074) Users reported that newly installed kernels on their systems installed @@ -11,58 +11,18 @@ use the rpm-sort library to sort kernels instead. Resolves rhbz#1124074 --- - .gitignore | 2 + - Makefile.util.def | 16 +++ configure.ac | 29 +++++ + Makefile.util.def | 16 +++ + util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ + .gitignore | 2 + util/grub-mkconfig_lib.in | 8 +- util/grub-rpm-sort.8 | 12 ++ - util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 347 insertions(+), 1 deletion(-) - create mode 100644 util/grub-rpm-sort.8 create mode 100644 util/grub-rpm-sort.c + create mode 100644 util/grub-rpm-sort.8 -diff --git a/.gitignore b/.gitignore -index d95fac578..1c8537129 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -101,6 +101,8 @@ grub-*.tar.* - /grub*-reboot.8 - /grub*-render-label - /grub*-render-label.1 -+/grub*-rpm-sort -+/grub*-rpm-sort.8 - /grub*-script-check - /grub*-script-check.1 - /grub*-set-default -diff --git a/Makefile.util.def b/Makefile.util.def -index 206110458..d846b81b5 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -684,6 +684,22 @@ program = { - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - }; - -+program = { -+ name = grub-rpm-sort; -+ mansection = 8; -+ installdir = sbin; -+ -+ common = grub-core/kern/emu/misc.c; -+ common = grub-core/kern/emu/argp_common.c; -+ common = grub-core/osdep/init.c; -+ common = util/misc.c; -+ common = util/grub-rpm-sort.c; -+ -+ ldadd = grub-core/gnulib/libgnu.a; -+ ldadd = libgrubkern.a; -+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; -+}; -+ - script = { - name = grub-mkconfig; - common = util/grub-mkconfig.in; diff --git a/configure.ac b/configure.ac -index 0cb971a92..49427cbf9 100644 +index 0cb971a92c5..49427cbf989 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -115,53 +75,36 @@ index 0cb971a92..49427cbf9 100644 LIBGEOM= if test x$host_kernel = xkfreebsd; then AC_CHECK_LIB([geom], [geom_gettree], [], -diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 10fabee5e..954844d2d 100644 ---- a/util/grub-mkconfig_lib.in -+++ b/util/grub-mkconfig_lib.in -@@ -213,6 +213,12 @@ version_sort () - esac - } +diff --git a/Makefile.util.def b/Makefile.util.def +index 20611045893..d846b81b5f9 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -684,6 +684,22 @@ program = { + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; -+if [ "x$RPMLIB" = x ]; then -+ kernel_sort=version_sort -+else -+ kernel_sort="${sbindir}/grub-rpm-sort" -+fi ++program = { ++ name = grub-rpm-sort; ++ mansection = 8; ++ installdir = sbin; + - version_test_numeric () - { - version_test_numeric_a="$1" -@@ -229,7 +235,7 @@ version_test_numeric () - version_test_numeric_a="$version_test_numeric_b" - version_test_numeric_b="$version_test_numeric_c" - fi -- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then -+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then - return 0 - else - return 1 -diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 -new file mode 100644 -index 000000000..8ce214884 ---- /dev/null -+++ b/util/grub-rpm-sort.8 -@@ -0,0 +1,12 @@ -+.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. ++ common = grub-core/kern/emu/misc.c; ++ common = grub-core/kern/emu/argp_common.c; ++ common = grub-core/osdep/init.c; ++ common = util/misc.c; ++ common = util/grub-rpm-sort.c; + -+.SH SYNOPSIS -+\fBgrub-rpm-sort\fR [OPTIONS]. ++ ldadd = grub-core/gnulib/libgnu.a; ++ ldadd = libgrubkern.a; ++ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; ++}; + -+.SH DESCRIPTION -+You should not normally run this program directly. Use grub-mkconfig instead. -+ -+.SH SEE ALSO -+.BR "info grub" + script = { + name = grub-mkconfig; + common = util/grub-mkconfig.in; diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c new file mode 100644 -index 000000000..f33bd1ed5 +index 00000000000..f33bd1ed568 --- /dev/null +++ b/util/grub-rpm-sort.c @@ -0,0 +1,281 @@ @@ -446,6 +389,63 @@ index 000000000..f33bd1ed5 + + return 0; +} +diff --git a/.gitignore b/.gitignore +index d95fac5789c..1c85371298c 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -101,6 +101,8 @@ grub-*.tar.* + /grub*-reboot.8 + /grub*-render-label + /grub*-render-label.1 ++/grub*-rpm-sort ++/grub*-rpm-sort.8 + /grub*-script-check + /grub*-script-check.1 + /grub*-set-default +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 10fabee5e14..954844d2d95 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -213,6 +213,12 @@ version_sort () + esac + } + ++if [ "x$RPMLIB" = x ]; then ++ kernel_sort=version_sort ++else ++ kernel_sort="${sbindir}/grub-rpm-sort" ++fi ++ + version_test_numeric () + { + version_test_numeric_a="$1" +@@ -229,7 +235,7 @@ version_test_numeric () + version_test_numeric_a="$version_test_numeric_b" + version_test_numeric_b="$version_test_numeric_c" + fi +- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then ++ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then + return 0 + else + return 1 +diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 +new file mode 100644 +index 00000000000..8ce21488448 +--- /dev/null ++++ b/util/grub-rpm-sort.8 +@@ -0,0 +1,12 @@ ++.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" ++.SH NAME ++\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. ++ ++.SH SYNOPSIS ++\fBgrub-rpm-sort\fR [OPTIONS]. ++ ++.SH DESCRIPTION ++You should not normally run this program directly. Use grub-mkconfig instead. ++ ++.SH SEE ALSO ++.BR "info grub" -- -2.14.3 +2.15.0 diff --git a/0127-Handle-rssd-storage-devices.patch b/0127-Handle-rssd-storage-devices.patch index 0993e71..db8b6b1 100644 --- a/0127-Handle-rssd-storage-devices.patch +++ b/0127-Handle-rssd-storage-devices.patch @@ -1,7 +1,7 @@ -From 8f42cdcaaffec149276d2a5a3faa2540432edc4c Mon Sep 17 00:00:00 2001 +From 1099d0d8767fa9487c5a18667b2142ab9248f882 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 Jun 2015 15:50:41 -0400 -Subject: [PATCH 127/198] Handle rssd storage devices. +Subject: [PATCH 127/206] Handle rssd storage devices. Resolves: rhbz#1087962 @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+) diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 90d92d3ad..6d9f4e5fa 100644 +index 90d92d3ad5c..6d9f4e5faa2 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -921,6 +921,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, @@ -35,5 +35,5 @@ index 90d92d3ad..6d9f4e5fa 100644 if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9') { -- -2.14.3 +2.15.0 diff --git a/0128-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch b/0128-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch index f8286f8..52929fe 100644 --- a/0128-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch +++ b/0128-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch @@ -1,7 +1,7 @@ -From 1daf969815f1487e02a78725e592b4d973641a4f Mon Sep 17 00:00:00 2001 +From 3602fba26df0d9fc04bae72d26d866ec9d1e24a6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 27 Oct 2014 09:22:55 -0400 -Subject: [PATCH 128/198] Try to emit linux16/initrd16 and linuxefi/initrdefi +Subject: [PATCH 128/206] Try to emit linux16/initrd16 and linuxefi/initrdefi in 30-os_prober. Resolves: rhbz#1108296 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 9b8f5968e..dc98eace9 100644 +index 9b8f5968e2d..dc98eace934 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -141,6 +141,28 @@ for OS in ${OSPROBED} ; do @@ -73,5 +73,5 @@ index 9b8f5968e..dc98eace9 100644 fi cat << EOF -- -2.14.3 +2.15.0 diff --git a/0129-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0129-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index 93fe76e..3005603 100644 --- a/0129-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0129-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,7 +1,7 @@ -From 114b6f132798b8819e899e3dc7988519dedc07e2 Mon Sep 17 00:00:00 2001 +From 1f85eacec7da97aa6dd6344d382d947631c991f9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH 129/198] Make grub2-mkconfig construct titles that look like +Subject: [PATCH 129/206] Make grub2-mkconfig construct titles that look like the ones we want elsewhere. Resolves: rhbz#1215839 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c6627268c..121524185 100644 +index c6627268cca..1215241859b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -68,6 +68,15 @@ case x"$GRUB_FS" in @@ -50,5 +50,5 @@ index c6627268c..121524185 100644 echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else -- -2.14.3 +2.15.0 diff --git a/0130-Add-friendly-grub2-password-config-tool-985962.patch b/0130-Add-friendly-grub2-password-config-tool-985962.patch index 104346f..f3f1045 100644 --- a/0130-Add-friendly-grub2-password-config-tool-985962.patch +++ b/0130-Add-friendly-grub2-password-config-tool-985962.patch @@ -1,7 +1,7 @@ -From b970cde9a609dce14c52145aaa61b87299f55086 Mon Sep 17 00:00:00 2001 +From 9cc251c72ee63c82565c917fa32301c593e6f099 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 25 Jun 2015 11:13:11 -0400 -Subject: [PATCH 130/198] Add friendly grub2 password config tool (#985962) +Subject: [PATCH 130/206] Add friendly grub2 password config tool (#985962) Provided a tool for users to reset the grub2 root user password without having to alter the grub.cfg. The hashed password now @@ -9,9 +9,9 @@ lives in a root-only-readable configuration file. Resolves: rhbz#985962 --- - .gitignore | 2 + - Makefile.util.def | 13 +++++ configure.ac | 1 + + Makefile.util.def | 13 +++++ + .gitignore | 2 + util/grub-mkconfig.in | 2 + util/grub-setpassword.8 | 28 +++++++++++ util/grub-setpassword.in | 123 +++++++++++++++++++++++++++++++++++++++++++++++ @@ -21,21 +21,20 @@ Resolves: rhbz#985962 create mode 100644 util/grub-setpassword.in create mode 100644 util/grub.d/01_users.in -diff --git a/.gitignore b/.gitignore -index 1c8537129..387e3554c 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -107,6 +107,8 @@ grub-*.tar.* - /grub*-script-check.1 - /grub*-set-default - /grub*-set-default.8 -+/grub*-setsetpassword -+/grub*-setsetpassword.8 - /grub*-shell - /grub*-shell-tester - /grub*-sparc64-setup +diff --git a/configure.ac b/configure.ac +index 49427cbf989..1960840048f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) + grub_TRANSFORM([grub-mkrescue]) + grub_TRANSFORM([grub-probe]) + grub_TRANSFORM([grub-reboot]) ++grub_TRANSFORM([grub-setpassword]) + grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) diff --git a/Makefile.util.def b/Makefile.util.def -index d846b81b5..226c46b2d 100644 +index d846b81b5f9..226c46b2d79 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -439,6 +439,12 @@ script = { @@ -65,20 +64,21 @@ index d846b81b5..226c46b2d 100644 script = { name = grub-mkconfig_lib; common = util/grub-mkconfig_lib.in; -diff --git a/configure.ac b/configure.ac -index 49427cbf9..196084004 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) - grub_TRANSFORM([grub-mkrescue]) - grub_TRANSFORM([grub-probe]) - grub_TRANSFORM([grub-reboot]) -+grub_TRANSFORM([grub-setpassword]) - grub_TRANSFORM([grub-rpm-sort]) - grub_TRANSFORM([grub-script-check]) - grub_TRANSFORM([grub-set-default]) +diff --git a/.gitignore b/.gitignore +index 1c85371298c..387e3554cd5 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -107,6 +107,8 @@ grub-*.tar.* + /grub*-script-check.1 + /grub*-set-default + /grub*-set-default.8 ++/grub*-setsetpassword ++/grub*-setsetpassword.8 + /grub*-shell + /grub*-shell-tester + /grub*-sparc64-setup diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 9d595ac05..fb8724708 100644 +index 9d595ac058a..fb8724708b5 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -263,6 +263,8 @@ for i in "${grub_mkconfig_dir}"/* ; do @@ -92,7 +92,7 @@ index 9d595ac05..fb8724708 100644 echo diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 new file mode 100644 -index 000000000..49200a848 +index 00000000000..49200a848b7 --- /dev/null +++ b/util/grub-setpassword.8 @@ -0,0 +1,28 @@ @@ -126,7 +126,7 @@ index 000000000..49200a848 +.BR "info grub2-mkpasswd-pbkdf2" diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in new file mode 100644 -index 000000000..dd76f00fc +index 00000000000..dd76f00fc0e --- /dev/null +++ b/util/grub-setpassword.in @@ -0,0 +1,123 @@ @@ -255,7 +255,7 @@ index 000000000..dd76f00fc +echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg" diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in new file mode 100644 -index 000000000..db2f44bfb +index 00000000000..db2f44bfb78 --- /dev/null +++ b/util/grub.d/01_users.in @@ -0,0 +1,11 @@ @@ -271,5 +271,5 @@ index 000000000..db2f44bfb +fi +EOF -- -2.14.3 +2.15.0 diff --git a/0131-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/0131-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index 48d26f4..2abdc4b 100644 --- a/0131-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/0131-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,18 +1,18 @@ -From 28c26e2c86d4b1218004d9e73ba3350704548e32 Mon Sep 17 00:00:00 2001 +From 039291e02021dc5c48a32a2c971475fbc6ac3fda Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH 131/198] Make grub2-mkconfig construct titles that look like +Subject: [PATCH 131/206] Make grub2-mkconfig construct titles that look like the ones we want elsewhere. Resolves: rhbz#1215839 Signed-off-by: Peter Jones --- - util/grub.d/10_linux.in | 34 +++++++++++++++++++++++----------- - 1 file changed, 23 insertions(+), 11 deletions(-) + util/grub.d/10_linux.in | 32 ++++++++++++++++++++++---------- + 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 121524185..584ad1f46 100644 +index 1215241859b..584ad1f4639 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -70,11 +70,28 @@ esac @@ -21,14 +21,13 @@ index 121524185..584ad1f46 100644 { - local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})" - local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})" -- -- local titlestr="${OS_NAME} (%s) ${OS_VERS}" -- echo -n ${titlestr} + local title_type + local version + local OS_NAME + local OS_VERS -+ + +- local titlestr="${OS_NAME} (%s) ${OS_VERS}" +- echo -n ${titlestr} + title_type=$1 && shift + version=$1 && shift + @@ -64,5 +63,5 @@ index 121524185..584ad1f46 100644 replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" -- -2.14.3 +2.15.0 diff --git a/0132-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch b/0132-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch index 295896e..4d26f99 100644 --- a/0132-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch +++ b/0132-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch @@ -1,7 +1,7 @@ -From 000e91150ac5831e54e0cd1176c113f5358a7876 Mon Sep 17 00:00:00 2001 +From edefa278bdaefe29877307ab40cc8c8497e5794c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Aug 2015 11:46:42 -0400 -Subject: [PATCH 132/198] Try to make sure configure.ac and grub-rpm-sort play +Subject: [PATCH 132/206] Try to make sure configure.ac and grub-rpm-sort play nice. Apparently the test for whether to use grub-rpm-sort and also the @@ -16,7 +16,7 @@ Signed-off-by: Peter Jones 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index 196084004..3c4b9a19b 100644 +index 1960840048f..3c4b9a19b10 100644 --- a/configure.ac +++ b/configure.ac @@ -1795,7 +1795,7 @@ AC_SUBST([LIBDEVMAPPER]) @@ -29,7 +29,7 @@ index 196084004..3c4b9a19b 100644 fi diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 954844d2d..9c410eae4 100644 +index 954844d2d95..9c410eae493 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -33,6 +33,9 @@ fi @@ -47,15 +47,15 @@ index 954844d2d..9c410eae4 100644 } -if [ "x$RPMLIB" = x ]; then -- kernel_sort=version_sort +if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then + kernel_sort="$grub_rpm_sort" - else ++else + kernel_sort=version_sort +-else - kernel_sort="${sbindir}/grub-rpm-sort" -+ kernel_sort=version_sort fi version_test_numeric () -- -2.14.3 +2.15.0 diff --git a/0133-tcp-add-window-scaling-support.patch b/0133-tcp-add-window-scaling-support.patch index 237a1a8..ce68b83 100644 --- a/0133-tcp-add-window-scaling-support.patch +++ b/0133-tcp-add-window-scaling-support.patch @@ -1,7 +1,7 @@ -From e6aef714ded4e1b93464368eae39f7354e0053e6 Mon Sep 17 00:00:00 2001 +From 414415beb12da752ac9458635d0ec8f34a7ee2fb Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:57:55 -0700 -Subject: [PATCH 133/198] tcp: add window scaling support +Subject: [PATCH 133/206] tcp: add window scaling support Sometimes we have to provision boxes across regions, such as California to Sweden. The http server has a 10 minute timeout, so if we can't get our 250mb @@ -17,7 +17,7 @@ Signed-off-by: Josef Bacik 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c -index e8ad34b84..7d4b82262 100644 +index e8ad34b84d4..7d4b822626d 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -106,6 +106,18 @@ struct tcphdr @@ -86,5 +86,5 @@ index e8ad34b84..7d4b82262 100644 tcp_socket_register (socket); -- -2.14.3 +2.15.0 diff --git a/0134-efinet-retransmit-if-our-device-is-busy.patch b/0134-efinet-retransmit-if-our-device-is-busy.patch index 6903880..e4a9768 100644 --- a/0134-efinet-retransmit-if-our-device-is-busy.patch +++ b/0134-efinet-retransmit-if-our-device-is-busy.patch @@ -1,7 +1,7 @@ -From 44d4ff84eddb7cc679b8bfa6799824df6d43d413 Mon Sep 17 00:00:00 2001 +From f0d62522c10f25e2e9fc9bcd51bc0dbf14b6d9c7 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 31 Aug 2015 13:34:35 -0400 -Subject: [PATCH 134/198] efinet: retransmit if our device is busy +Subject: [PATCH 134/206] efinet: retransmit if our device is busy When I fixed the txbuf handling I ripped out the retransmission code since it was flooding our network when we had the buggy behavior. Turns out this was too @@ -16,7 +16,7 @@ Signed-off-by: Josef Bacik 1 file changed, 10 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 5388f952b..3f112438a 100644 +index 5388f952ba9..3f112438a93 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -38,6 +38,7 @@ send_card_buffer (struct grub_net_card *dev, @@ -44,5 +44,5 @@ index 5388f952b..3f112438a 100644 return grub_error (GRUB_ERR_TIMEOUT, N_("couldn't send network packet")); -- -2.14.3 +2.15.0 diff --git a/0135-Be-more-aggro-about-actually-using-the-configured-ne.patch b/0135-Be-more-aggro-about-actually-using-the-configured-ne.patch index 320cea5..f446918 100644 --- a/0135-Be-more-aggro-about-actually-using-the-configured-ne.patch +++ b/0135-Be-more-aggro-about-actually-using-the-configured-ne.patch @@ -1,7 +1,7 @@ -From 457789395b36baa8348b4594f9dc9fc2e8c5ef6c Mon Sep 17 00:00:00 2001 +From 8448d685b7748afe147be063cbd5fe0beb8bfec5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 11 Sep 2015 17:30:49 -0400 -Subject: [PATCH 135/198] Be more aggro about actually using the *configured* +Subject: [PATCH 135/206] Be more aggro about actually using the *configured* network device. Right now we use any SNP device with the same mac+IP block, but when @@ -18,7 +18,7 @@ Signed-off-by: Peter Jones 2 files changed, 102 insertions(+), 26 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 3f112438a..a3ce4c67c 100644 +index 3f112438a93..a3ce4c67cce 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -239,46 +239,85 @@ grub_efinet_get_device_handle (struct grub_net_card *card) @@ -39,7 +39,8 @@ index 3f112438a..a3ce4c67c 100644 - int i = 0; + grub_efi_device_path_t *pdp = NULL, *pp = NULL, *pc = NULL; + int ret = 0; -+ + +- /* Find handles which support the disk io interface. */ + if (preferred) + { + grub_efi_device_path_t *pdpc; @@ -49,8 +50,7 @@ index 3f112438a..a3ce4c67c 100644 + grub_print_error (); + return -1; + } - -- /* Find handles which support the disk io interface. */ ++ + for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (pdpc); + pdpc = GRUB_EFI_NEXT_DEVICE_PATH (pdpc)) + { @@ -205,7 +205,7 @@ index 3f112438a..a3ce4c67c 100644 if (! cdp) continue; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index c7c9f0e1d..97b9aa7a4 100644 +index c7c9f0e1db1..97b9aa7a4d7 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -622,6 +622,10 @@ typedef struct grub_efi_device_path grub_efi_device_path_t; @@ -220,5 +220,5 @@ index c7c9f0e1d..97b9aa7a4 100644 #define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype) #define GRUB_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length) -- -2.14.3 +2.15.0 diff --git a/0136-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch b/0136-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch index 00651e6..55bf64f 100644 --- a/0136-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +++ b/0136-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch @@ -1,7 +1,7 @@ -From cc02f809a13a9efa0f3c6295f7dd0ea29cc030b9 Mon Sep 17 00:00:00 2001 +From c760d9ce51010c408c9cca513c5f307e9f94912a Mon Sep 17 00:00:00 2001 From: RHEL Ninjas Date: Fri, 25 Sep 2015 16:24:23 +0900 -Subject: [PATCH 136/198] efinet: add filter for the first exclusive reopen of +Subject: [PATCH 136/206] efinet: add filter for the first exclusive reopen of SNP --- @@ -9,7 +9,7 @@ Subject: [PATCH 136/198] efinet: add filter for the first exclusive reopen of 1 file changed, 39 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index a3ce4c67c..b870d3f19 100644 +index a3ce4c67cce..b870d3f1938 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -465,6 +465,45 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -59,5 +59,5 @@ index a3ce4c67c..b870d3f19 100644 } } -- -2.14.3 +2.15.0 diff --git a/0137-Fix-security-issue-when-reading-username-and-passwor.patch b/0137-Fix-security-issue-when-reading-username-and-passwor.patch index 585fd2d..d7df548 100644 --- a/0137-Fix-security-issue-when-reading-username-and-passwor.patch +++ b/0137-Fix-security-issue-when-reading-username-and-passwor.patch @@ -1,7 +1,7 @@ -From 1f03d841b2872f5118fc7cbde39f0f19021d16ae Mon Sep 17 00:00:00 2001 +From 4ebcd25c8f7860c83a99cc420f63611437acf9f1 Mon Sep 17 00:00:00 2001 From: Hector Marco-Gisbert Date: Fri, 13 Nov 2015 16:21:09 +0100 -Subject: [PATCH 137/198] Fix security issue when reading username and password +Subject: [PATCH 137/206] Fix security issue when reading username and password This patch fixes two integer underflows at: * grub-core/lib/crypto.c @@ -17,7 +17,7 @@ Signed-off-by: Ismael Ripoll-Ripoll 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c -index ca334d5a4..e6c78d16d 100644 +index ca334d5a40e..e6c78d16d39 100644 --- a/grub-core/lib/crypto.c +++ b/grub-core/lib/crypto.c @@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned buf_size) @@ -30,7 +30,7 @@ index ca334d5a4..e6c78d16d 100644 if (cur_len) cur_len--; diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c -index 6be678c0d..c35ce9724 100644 +index 6be678c0de1..c35ce972473 100644 --- a/grub-core/normal/auth.c +++ b/grub-core/normal/auth.c @@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size) @@ -43,5 +43,5 @@ index 6be678c0d..c35ce9724 100644 if (cur_len) { -- -2.14.3 +2.15.0 diff --git a/0138-Warn-if-grub-password-will-not-be-read-1290803.patch b/0138-Warn-if-grub-password-will-not-be-read-1290803.patch index 21e62b4..11f4797 100644 --- a/0138-Warn-if-grub-password-will-not-be-read-1290803.patch +++ b/0138-Warn-if-grub-password-will-not-be-read-1290803.patch @@ -1,7 +1,7 @@ -From d2367e799a35076aa94b940ee04c88df616f9278 Mon Sep 17 00:00:00 2001 +From 591aa70d3437b3db7fe56975fe1b54b9431a21cd Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 22 Feb 2016 15:30:05 -0500 -Subject: [PATCH 138/198] Warn if grub password will not be read (#1290803) +Subject: [PATCH 138/206] Warn if grub password will not be read (#1290803) It is possible for a system to have never run grub-mkconfig and add the section that reads the user.cfg file which contains a user set GRUB @@ -14,7 +14,7 @@ Resolves: rhbz#1290803 1 file changed, 5 insertions(+) diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index dd76f00fc..fb9d3a3b6 100644 +index dd76f00fc0e..fb9d3a3b6f9 100644 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -121,3 +121,8 @@ fi @@ -27,5 +27,5 @@ index dd76f00fc..fb9d3a3b6 100644 + echo "Update your configuration with @grub_mkconfig@ to support this feature." +fi -- -2.14.3 +2.15.0 diff --git a/0139-Clean-up-grub-setpassword-documentation-1290799.patch b/0139-Clean-up-grub-setpassword-documentation-1290799.patch index 71b73ca..234b977 100644 --- a/0139-Clean-up-grub-setpassword-documentation-1290799.patch +++ b/0139-Clean-up-grub-setpassword-documentation-1290799.patch @@ -1,7 +1,7 @@ -From 2166377a018bc26bc565fecf76d31057a3533603 Mon Sep 17 00:00:00 2001 +From 44db37cb0cf9d8156717bea09407d28d85517f7e Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Tue, 26 Jan 2016 10:28:35 -0500 -Subject: [PATCH 139/198] Clean up grub-setpassword documentation (#1290799) +Subject: [PATCH 139/206] Clean up grub-setpassword documentation (#1290799) The output for --help had some errors. Corrected those and polished the text to be a little easier to follow. Carried verbage over to man page @@ -14,7 +14,7 @@ Resolves: rhbz#1290799 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 -index 49200a848..dc91dd669 100644 +index 49200a848b7..dc91dd6697b 100644 --- a/util/grub-setpassword.8 +++ b/util/grub-setpassword.8 @@ -19,7 +19,7 @@ Display program usage and exit. @@ -27,7 +27,7 @@ index 49200a848..dc91dd669 100644 .SH SEE ALSO diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index fb9d3a3b6..c8c0fa419 100644 +index fb9d3a3b6f9..c8c0fa4199d 100644 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -16,15 +16,14 @@ grub_mkpasswd="${bindir}/@grub_mkpasswd_pbkdf2@" @@ -54,5 +54,5 @@ index fb9d3a3b6..c8c0fa419 100644 Report bugs at https://bugzilla.redhat.com. EOF -- -2.14.3 +2.15.0 diff --git a/0140-Fix-locale-issue-in-grub-setpassword-1294243.patch b/0140-Fix-locale-issue-in-grub-setpassword-1294243.patch index 4a8f972..3878df0 100644 --- a/0140-Fix-locale-issue-in-grub-setpassword-1294243.patch +++ b/0140-Fix-locale-issue-in-grub-setpassword-1294243.patch @@ -1,7 +1,7 @@ -From 27f304a75c966a1daad262d34c84c7de0c5dab69 Mon Sep 17 00:00:00 2001 +From 124d4da3a6e4e747ab958614cf81c6c71753d36b Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Fri, 29 Jan 2016 16:56:11 -0500 -Subject: [PATCH 140/198] Fix locale issue in grub-setpassword (#1294243) +Subject: [PATCH 140/206] Fix locale issue in grub-setpassword (#1294243) A shell substitution was expecting non-translated output to grab the hashed password and put it in the user.cfg file. Modified code to force @@ -13,7 +13,7 @@ Resolves: rhbz#1294243 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index c8c0fa419..d7924af51 100644 +index c8c0fa4199d..d7924af5192 100644 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -104,7 +104,7 @@ getpass() { @@ -26,5 +26,5 @@ index c8c0fa419..d7924af51 100644 sed -e "s/PBKDF2 hash of your password is //" } -- -2.14.3 +2.15.0 diff --git a/0141-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch b/0141-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch index 43c7dcb..221d733 100644 --- a/0141-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch +++ b/0141-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch @@ -1,7 +1,7 @@ -From cd5e17c01c996bcf446e16978e37569aa0d889dd Mon Sep 17 00:00:00 2001 +From a2777060620735d6b59cf04e9ee866a205f06091 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Fri, 22 Jan 2016 13:32:30 +0100 -Subject: [PATCH 141/198] efiemu: Handle persistent RAM and unknown possible +Subject: [PATCH 141/206] efiemu: Handle persistent RAM and unknown possible future additions. (cherry picked from commit ae3b83a4d4df75a01198a2fed7542391e7c449e0) @@ -12,7 +12,7 @@ Resolves: rhbz#1288608 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c -index 52a032f7b..92e7df7e5 100644 +index 52a032f7b2e..92e7df7e501 100644 --- a/grub-core/efiemu/mm.c +++ b/grub-core/efiemu/mm.c @@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, @@ -27,5 +27,5 @@ index 52a032f7b..92e7df7e5 100644 GRUB_EFI_PERSISTENT_MEMORY); default: -- -2.14.3 +2.15.0 diff --git a/0142-efiemu-Fix-compilation-failure.patch b/0142-efiemu-Fix-compilation-failure.patch index 5e68214..a0d839d 100644 --- a/0142-efiemu-Fix-compilation-failure.patch +++ b/0142-efiemu-Fix-compilation-failure.patch @@ -1,7 +1,7 @@ -From 54e9e666d32c0a18a7cc529cda86686462f04151 Mon Sep 17 00:00:00 2001 +From cff986aeb1735ff5d9f4f0021faf2beda10b9dae Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 14:10:30 +0100 -Subject: [PATCH 142/198] efiemu: Fix compilation failure +Subject: [PATCH 142/206] efiemu: Fix compilation failure (cherry picked from commit b6a03dfd327489d53ee07c6d7d593b99c7b7cb62) @@ -11,7 +11,7 @@ Resolves: rhbz#1288608 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c -index 92e7df7e5..52a032f7b 100644 +index 92e7df7e501..52a032f7b2e 100644 --- a/grub-core/efiemu/mm.c +++ b/grub-core/efiemu/mm.c @@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, @@ -26,5 +26,5 @@ index 92e7df7e5..52a032f7b 100644 GRUB_EFI_PERSISTENT_MEMORY); default: -- -2.14.3 +2.15.0 diff --git a/0143-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/0143-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index a20e12b..6478f61 100644 --- a/0143-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/0143-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,7 +1,7 @@ -From e5df22a8207a4b09c7bc89a7ac92719a529c2a63 Mon Sep 17 00:00:00 2001 +From 5a20f597edbd69907a61a361fa8aff918b2c6864 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 7 Apr 2016 10:58:06 -0400 -Subject: [PATCH 143/198] Revert "reopen SNP protocol for exclusive use by +Subject: [PATCH 143/206] Revert "reopen SNP protocol for exclusive use by grub" I *think* this should have been replaced by upstream's @@ -15,7 +15,7 @@ This reverts commit 147daeab22db793978f952b6f0d832919a1b0081. 1 file changed, 39 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index b870d3f19..a3ce4c67c 100644 +index b870d3f1938..a3ce4c67cce 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -465,45 +465,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -65,5 +65,5 @@ index b870d3f19..a3ce4c67c 100644 } } -- -2.14.3 +2.15.0 diff --git a/0144-Add-a-url-parser.patch b/0144-Add-a-url-parser.patch index 13537da..3296e4e 100644 --- a/0144-Add-a-url-parser.patch +++ b/0144-Add-a-url-parser.patch @@ -1,7 +1,7 @@ -From 283d44e07b5c02cd87a0eec5cdd596306a9c1b41 Mon Sep 17 00:00:00 2001 +From 956b3cd5f9669a0cdbf4607973e12540d09ccc18 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 16:18:44 -0400 -Subject: [PATCH 144/198] Add a url parser. +Subject: [PATCH 144/206] Add a url parser. This patch adds a url parser that can parse http, https, tftp, and tftps urls, and is easily extensible to handle more types. @@ -20,7 +20,7 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/net/url.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 5ae70204c..4857a1e5f 100644 +index 5ae70204cd2..4857a1e5f61 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -2199,6 +2199,7 @@ module = { @@ -32,7 +32,7 @@ index 5ae70204c..4857a1e5f 100644 module = { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 8344526be..f1fab7000 100644 +index 8344526be7f..f1fab700048 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -296,6 +296,19 @@ grub_strrchr (const char *s, int c) @@ -57,7 +57,7 @@ index 8344526be..f1fab7000 100644 { diff --git a/grub-core/net/url.c b/grub-core/net/url.c new file mode 100644 -index 000000000..146858284 +index 00000000000..146858284cd --- /dev/null +++ b/grub-core/net/url.c @@ -0,0 +1,861 @@ @@ -923,7 +923,7 @@ index 000000000..146858284 +} +#endif diff --git a/include/grub/misc.h b/include/grub/misc.h -index 062081437..4737da1ea 100644 +index 06208143779..4737da1eaa9 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -85,6 +85,7 @@ int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); @@ -987,7 +987,7 @@ index 062081437..4737da1ea 100644 { diff --git a/include/grub/net/url.h b/include/grub/net/url.h new file mode 100644 -index 000000000..a215fa27d +index 00000000000..a215fa27d0a --- /dev/null +++ b/include/grub/net/url.h @@ -0,0 +1,28 @@ @@ -1020,5 +1020,5 @@ index 000000000..a215fa27d + +#endif /* GRUB_URL_HEADER */ -- -2.14.3 +2.15.0 diff --git a/0145-efinet-and-bootp-add-support-for-dhcpv6.patch b/0145-efinet-and-bootp-add-support-for-dhcpv6.patch index 122e92b..67dbfb7 100644 --- a/0145-efinet-and-bootp-add-support-for-dhcpv6.patch +++ b/0145-efinet-and-bootp-add-support-for-dhcpv6.patch @@ -1,7 +1,7 @@ -From 89b9b60f3bf638786a686eb86344a73523168034 Mon Sep 17 00:00:00 2001 +From 7456c9e2715a2e272a9e3d5fb2ae7e14c2edf3f6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 8 Jun 2016 21:03:37 -0400 -Subject: [PATCH 145/198] efinet and bootp: add support for dhcpv6 +Subject: [PATCH 145/206] efinet and bootp: add support for dhcpv6 Signed-off-by: Peter Jones --- @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 6 files changed, 480 insertions(+), 14 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index f03eeab2f..da3e45446 100644 +index f03eeab2fb4..da3e454466b 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -23,6 +23,7 @@ @@ -206,7 +206,7 @@ index f03eeab2f..da3e45446 100644 grub_net_process_dhcp (struct grub_net_buff *nb, struct grub_net_card *card) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index a3ce4c67c..329024b6f 100644 +index a3ce4c67cce..329024b6f2c 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -18,11 +18,15 @@ @@ -319,7 +319,7 @@ index a3ce4c67c..329024b6f 100644 } } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 16d2ce06d..4be228d95 100644 +index 16d2ce06d5a..4be228d9576 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -955,6 +955,78 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa @@ -402,7 +402,7 @@ index 16d2ce06d..4be228d95 100644 grub_err_t grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter, diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 7d90bf66e..1157524fc 100644 +index 7d90bf66e76..1157524fc50 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -379,19 +379,23 @@ tftp_open (struct grub_file *file, const char *filename) @@ -430,7 +430,7 @@ index 7d90bf66e..1157524fc 100644 grub_free (data); return grub_errno; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 97b9aa7a4..02488ec35 100644 +index 97b9aa7a4d7..02488ec35ae 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -572,10 +572,16 @@ typedef void *grub_efi_handle_t; @@ -585,7 +585,7 @@ index 97b9aa7a4..02488ec35 100644 typedef struct grub_efi_pxe diff --git a/include/grub/net.h b/include/grub/net.h -index 50d62ab0c..f8f3ec13a 100644 +index 50d62ab0c8c..f8f3ec13acc 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -442,6 +442,51 @@ struct grub_net_bootp_packet @@ -663,5 +663,5 @@ index 50d62ab0c..f8f3ec13a 100644 grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf, int mask); -- -2.14.3 +2.15.0 diff --git a/0146-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch b/0146-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch index 6358372..0103089 100644 --- a/0146-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +++ b/0146-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch @@ -1,7 +1,7 @@ -From 38b9ded25e7f0b2b0265759bbf3a69e07df50eb9 Mon Sep 17 00:00:00 2001 +From 37208e75eac8c1f17598d75b4c340e3af735d23c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 23 Jun 2016 11:01:39 -0400 -Subject: [PATCH 146/198] Add grub-get-kernel-settings and use it in 10_linux +Subject: [PATCH 146/206] Add grub-get-kernel-settings and use it in 10_linux This patch adds grub-get-kernel-settings, which reads the system kernel installation configuration from /etc/sysconfig/kernel, and outputs @@ -11,9 +11,9 @@ debug stanzas. Resolves: rhbz#1226325 --- - .gitignore | 2 + - Makefile.util.def | 7 +++ configure.ac | 2 + + Makefile.util.def | 7 +++ + .gitignore | 2 + util/bash-completion.d/grub-completion.bash.in | 22 ++++++++ util/grub-get-kernel-settings.3 | 20 +++++++ util/grub-get-kernel-settings.in | 78 ++++++++++++++++++++++++++ @@ -23,39 +23,8 @@ Resolves: rhbz#1226325 create mode 100644 util/grub-get-kernel-settings.3 create mode 100644 util/grub-get-kernel-settings.in -diff --git a/.gitignore b/.gitignore -index 387e3554c..9f258735a 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -64,6 +64,8 @@ grub-*.tar.* - /grub*-fs-tester - /grub*-fstest - /grub*-fstest.1 -+/grub*-get-kernel-settings -+/grub*-get-kernel-settings.3 - /grub*-glue-efi - /grub*-glue-efi.1 - /grub*-install -diff --git a/Makefile.util.def b/Makefile.util.def -index 226c46b2d..ed27351eb 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -713,6 +713,13 @@ script = { - installdir = sbin; - }; - -+script = { -+ name = grub-get-kernel-settings; -+ common = util/grub-get-kernel-settings.in; -+ mansection = 3; -+ installdir = sbin; -+}; -+ - script = { - name = grub-set-default; - common = util/grub-set-default.in; diff --git a/configure.ac b/configure.ac -index 3c4b9a19b..40be70019 100644 +index 3c4b9a19b10..40be70019e2 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ grub_TRANSFORM([grub-install]) @@ -74,8 +43,39 @@ index 3c4b9a19b..40be70019 100644 grub_TRANSFORM([grub-glue-efi.3]) grub_TRANSFORM([grub-install.1]) grub_TRANSFORM([grub-kbdcomp.3]) +diff --git a/Makefile.util.def b/Makefile.util.def +index 226c46b2d79..ed27351eb47 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -713,6 +713,13 @@ script = { + installdir = sbin; + }; + ++script = { ++ name = grub-get-kernel-settings; ++ common = util/grub-get-kernel-settings.in; ++ mansection = 3; ++ installdir = sbin; ++}; ++ + script = { + name = grub-set-default; + common = util/grub-set-default.in; +diff --git a/.gitignore b/.gitignore +index 387e3554cd5..9f258735aaa 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -64,6 +64,8 @@ grub-*.tar.* + /grub*-fs-tester + /grub*-fstest + /grub*-fstest.1 ++/grub*-get-kernel-settings ++/grub*-get-kernel-settings.3 + /grub*-glue-efi + /grub*-glue-efi.1 + /grub*-install diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in -index 44bf135b9..5c4acd496 100644 +index 44bf135b9f8..5c4acd496d4 100644 --- a/util/bash-completion.d/grub-completion.bash.in +++ b/util/bash-completion.d/grub-completion.bash.in @@ -264,6 +264,28 @@ have ${__grub_sparc64_setup_program} && \ @@ -109,7 +109,7 @@ index 44bf135b9..5c4acd496 100644 # diff --git a/util/grub-get-kernel-settings.3 b/util/grub-get-kernel-settings.3 new file mode 100644 -index 000000000..ba33330e2 +index 00000000000..ba33330e28d --- /dev/null +++ b/util/grub-get-kernel-settings.3 @@ -0,0 +1,20 @@ @@ -135,7 +135,7 @@ index 000000000..ba33330e2 +.BR "info grub" diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in new file mode 100644 -index 000000000..120462198 +index 00000000000..12046219878 --- /dev/null +++ b/util/grub-get-kernel-settings.in @@ -0,0 +1,78 @@ @@ -218,7 +218,7 @@ index 000000000..120462198 + echo export GRUB_LINUX_DEBUG_TITLE_POSTFIX +fi diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index fb8724708..e32de5ef3 100644 +index fb8724708b5..e32de5ef361 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -45,6 +45,7 @@ grub_probe="${sbindir}/@grub_probe@" @@ -239,7 +239,7 @@ index fb8724708..e32de5ef3 100644 GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" fi diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 584ad1f46..c9bf223f2 100644 +index 584ad1f4639..c9bf223f273 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -101,7 +101,8 @@ linux_entry () @@ -299,5 +299,5 @@ index 584ad1f46..c9bf223f2 100644 fi -- -2.14.3 +2.15.0 diff --git a/0147-Normalize-slashes-in-tftp-paths.patch b/0147-Normalize-slashes-in-tftp-paths.patch index 9d63df5..a2b142b 100644 --- a/0147-Normalize-slashes-in-tftp-paths.patch +++ b/0147-Normalize-slashes-in-tftp-paths.patch @@ -1,7 +1,7 @@ -From 17fc1314e398d7ab2f3ae5a6d1114543653e8a91 Mon Sep 17 00:00:00 2001 +From ff268e842592a60d07e4ea39e8e7bae0c8d22611 Mon Sep 17 00:00:00 2001 From: Lenny Szubowicz Date: Mon, 29 Aug 2016 11:04:48 -0400 -Subject: [PATCH 147/198] Normalize slashes in tftp paths. +Subject: [PATCH 147/206] Normalize slashes in tftp paths. Some tftp servers do not handle multiple consecutive slashes correctly; this patch avoids sending tftp requests with non-normalized paths. @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 1157524fc..5ca0a96a6 100644 +index 1157524fc50..5ca0a96a6f6 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -300,6 +300,25 @@ destroy_pq (tftp_data_t data) @@ -54,5 +54,5 @@ index 1157524fc..5ca0a96a6 100644 rrq += grub_strlen (filename) + 1; -- -2.14.3 +2.15.0 diff --git a/0148-Fix-malformed-tftp-packets.patch b/0148-Fix-malformed-tftp-packets.patch index eb70fad..e8b0c84 100644 --- a/0148-Fix-malformed-tftp-packets.patch +++ b/0148-Fix-malformed-tftp-packets.patch @@ -1,7 +1,7 @@ -From 94758538586b3fb2602d41c5ccc0b58769a09933 Mon Sep 17 00:00:00 2001 +From 700684eaa76046ceaca607877c897c50c7fbddb5 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Tue, 7 Mar 2017 18:26:17 -0500 -Subject: [PATCH 148/198] Fix malformed tftp packets +Subject: [PATCH 148/206] Fix malformed tftp packets 0088-Normalize-slashes-in-tftp-paths.patch collapses multiple contiguous slashes in a filename into one slash in the tftp packet filename field. @@ -16,7 +16,7 @@ Signed-off-by: Mark Salter 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 5ca0a96a6..dcd824943 100644 +index 5ca0a96a6f6..dcd82494309 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -360,8 +360,8 @@ tftp_open (struct grub_file *file, const char *filename) @@ -31,5 +31,5 @@ index 5ca0a96a6..dcd824943 100644 grub_strcpy (rrq, "octet"); rrqlen += grub_strlen ("octet") + 1; -- -2.14.3 +2.15.0 diff --git a/0149-Fix-race-in-EFI-validation.patch b/0149-Fix-race-in-EFI-validation.patch index 862108a..8039f94 100644 --- a/0149-Fix-race-in-EFI-validation.patch +++ b/0149-Fix-race-in-EFI-validation.patch @@ -1,14 +1,14 @@ -From bb2ea94b6dcccec798e8728c51d53786f2fe0d2c Mon Sep 17 00:00:00 2001 +From 1b21ff557074e5c2ecbabce06921e03986c09553 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 14 Jul 2015 16:58:51 -0700 -Subject: [PATCH 149/198] Fix race in EFI validation +Subject: [PATCH 149/206] Fix race in EFI validation --- grub-core/loader/i386/efi/linux.c | 44 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index e5b778577..7ccf32d9d 100644 +index e5b778577f9..7ccf32d9d45 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -154,7 +154,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -93,5 +93,5 @@ index e5b778577..7ccf32d9d 100644 { grub_dl_unref (my_mod); -- -2.14.3 +2.15.0 diff --git a/0150-bz1374141-fix-incorrect-mask-for-ppc64.patch b/0150-bz1374141-fix-incorrect-mask-for-ppc64.patch index 2dd5b56..568a886 100644 --- a/0150-bz1374141-fix-incorrect-mask-for-ppc64.patch +++ b/0150-bz1374141-fix-incorrect-mask-for-ppc64.patch @@ -1,7 +1,7 @@ -From 09a5e37fe9bbe1b7cf7fe0a1211e06de555b0b54 Mon Sep 17 00:00:00 2001 +From 210bb34a3b86403b3109c77e4f4db26b4e6cee95 Mon Sep 17 00:00:00 2001 From: Masahiro Matsuya Date: Sat, 29 Oct 2016 08:35:26 +0900 -Subject: [PATCH 150/198] bz1374141 fix incorrect mask for ppc64 +Subject: [PATCH 150/206] bz1374141 fix incorrect mask for ppc64 The netmask configured in firmware is not respected on ppc64 (big endian). When 255.255.252.0 is set as netmask in firmware, the following is the value of bootpath string in grub_ieee1275_parse_bootpath(). @@ -30,7 +30,7 @@ The count of zero with __builtin_clz can be 22. (clz counts the number of one bi 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index 002446be1..3df75357a 100644 +index 002446be1c3..3df75357a70 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -220,8 +220,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, @@ -44,5 +44,5 @@ index 002446be1..3df75357a 100644 if (gateway_addr.ipv4 != 0) -- -2.14.3 +2.15.0 diff --git a/0151-Use-device-part-of-chainloader-target-if-present.patch b/0151-Use-device-part-of-chainloader-target-if-present.patch index 8b8cef8..b26121b 100644 --- a/0151-Use-device-part-of-chainloader-target-if-present.patch +++ b/0151-Use-device-part-of-chainloader-target-if-present.patch @@ -1,7 +1,7 @@ -From 79da61bd99b4cd4c817eeb022bd9f7d3e1d38258 Mon Sep 17 00:00:00 2001 +From a7ff45890757a0edbd80fadb0e182d65d980d781 Mon Sep 17 00:00:00 2001 From: Raymund Will Date: Fri, 10 Apr 2015 01:45:02 -0400 -Subject: [PATCH 151/198] Use device part of chainloader target, if present. +Subject: [PATCH 151/206] Use device part of chainloader target, if present. Otherwise chainloading is restricted to '$root', which might not even be readable by EFI! @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index adc856366..14ce6ddd7 100644 +index adc85636633..14ce6ddd7ad 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -223,8 +223,11 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), @@ -33,5 +33,5 @@ index adc856366..14ce6ddd7 100644 goto fail; -- -2.14.3 +2.15.0 diff --git a/0152-Add-secureboot-support-on-efi-chainloader.patch b/0152-Add-secureboot-support-on-efi-chainloader.patch index 367b961..26bda00 100644 --- a/0152-Add-secureboot-support-on-efi-chainloader.patch +++ b/0152-Add-secureboot-support-on-efi-chainloader.patch @@ -1,7 +1,7 @@ -From cffa3c44d259122720382c8d2c08ff3e57b00de4 Mon Sep 17 00:00:00 2001 +From 8bd6b4f718d84a51b845eb403fe8c95fedfde853 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 13:04:37 -0400 -Subject: [PATCH 152/198] Add secureboot support on efi chainloader +Subject: [PATCH 152/206] Add secureboot support on efi chainloader Expand the chainloader to be able to verify the image by means of shim lock protocol. The PE/COFF image is loaded and relocated by the @@ -22,7 +22,7 @@ Signed-off-by: Peter Jones 2 files changed, 595 insertions(+), 37 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 14ce6ddd7..87a91e16f 100644 +index 14ce6ddd7ad..87a91e16f17 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -32,6 +32,8 @@ @@ -758,7 +758,7 @@ index 14ce6ddd7..87a91e16f 100644 return grub_errno; diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index 7d44732d2..6e24dae2c 100644 +index 7d44732d2c3..6e24dae2cb6 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -214,7 +214,11 @@ struct grub_pe64_optional_header @@ -796,5 +796,5 @@ index 7d44732d2..6e24dae2c 100644 { grub_uint32_t page_rva; -- -2.14.3 +2.15.0 diff --git a/0153-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch b/0153-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch index 07cce9d..69edeaf 100644 --- a/0153-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch +++ b/0153-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch @@ -1,7 +1,7 @@ -From a59984e248881a8c47d0c6035ce3dc062fa2113f Mon Sep 17 00:00:00 2001 +From de9e4f818527846f4a9cbfeb3d0bb3c7a64aae5c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 16:09:25 -0400 -Subject: [PATCH 153/198] Make any of the loaders that link in efi mode honor +Subject: [PATCH 153/206] Make any of the loaders that link in efi mode honor secure boot. And in this case "honor" means "even if somebody does link this in, they @@ -9,7 +9,6 @@ won't register commands if SB is enabled." Signed-off-by: Peter Jones --- - grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 1 + grub-core/commands/iorw.c | 7 +++++ grub-core/commands/memrw.c | 7 +++++ @@ -28,6 +27,7 @@ Signed-off-by: Peter Jones include/grub/mips/linux.h | 0 include/grub/powerpc/linux.h | 0 include/grub/sparc64/linux.h | 0 + grub-core/Makefile.am | 1 + 19 files changed, 146 insertions(+), 29 deletions(-) create mode 100644 grub-core/kern/efi/sb.c create mode 100644 include/grub/efi/sb.h @@ -36,20 +36,8 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/powerpc/linux.h create mode 100644 include/grub/sparc64/linux.h -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 104513847..f7b4d29b0 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -71,6 +71,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 4857a1e5f..75a7ab344 100644 +index 4857a1e5f61..75a7ab3441d 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -196,6 +196,7 @@ kernel = { @@ -61,7 +49,7 @@ index 4857a1e5f..75a7ab344 100644 x86 = kern/i386/tsc.c; x86 = kern/i386/tsc_pit.c; diff --git a/grub-core/commands/iorw.c b/grub-core/commands/iorw.c -index a0c164e54..41a7f3f04 100644 +index a0c164e54f0..41a7f3f0466 100644 --- a/grub-core/commands/iorw.c +++ b/grub-core/commands/iorw.c @@ -23,6 +23,7 @@ @@ -93,7 +81,7 @@ index a0c164e54..41a7f3f04 100644 grub_unregister_extcmd (cmd_read_word); grub_unregister_extcmd (cmd_read_dword); diff --git a/grub-core/commands/memrw.c b/grub-core/commands/memrw.c -index 98769eadb..088cbe9e2 100644 +index 98769eadb34..088cbe9e2bc 100644 --- a/grub-core/commands/memrw.c +++ b/grub-core/commands/memrw.c @@ -22,6 +22,7 @@ @@ -125,7 +113,7 @@ index 98769eadb..088cbe9e2 100644 grub_unregister_extcmd (cmd_read_word); grub_unregister_extcmd (cmd_read_dword); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 2588b481e..684ca93f8 100644 +index 2588b481e76..684ca93f8f4 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -269,34 +269,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -165,7 +153,7 @@ index 2588b481e..684ca93f8 100644 /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c new file mode 100644 -index 000000000..a41b6c5b8 +index 00000000000..a41b6c5b851 --- /dev/null +++ b/grub-core/kern/efi/sb.c @@ -0,0 +1,58 @@ @@ -228,7 +216,7 @@ index 000000000..a41b6c5b8 +#endif +} diff --git a/grub-core/loader/efi/appleloader.c b/grub-core/loader/efi/appleloader.c -index 74888c463..69c2a10d3 100644 +index 74888c463ba..69c2a10d351 100644 --- a/grub-core/loader/efi/appleloader.c +++ b/grub-core/loader/efi/appleloader.c @@ -24,6 +24,7 @@ @@ -259,7 +247,7 @@ index 74888c463..69c2a10d3 100644 grub_unregister_command (cmd); } diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 87a91e16f..aee8e6bec 100644 +index 87a91e16f17..aee8e6becf6 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -34,6 +34,7 @@ @@ -271,7 +259,7 @@ index 87a91e16f..aee8e6bec 100644 #include #include diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c -index 7f96515da..87709aa23 100644 +index 7f96515da65..87709aa23e8 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -38,6 +38,7 @@ @@ -303,7 +291,7 @@ index 7f96515da..87709aa23 100644 grub_unregister_extcmd (cmd_openbsd); grub_unregister_extcmd (cmd_netbsd); diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 083f9417c..b2438547d 100644 +index 083f9417cb6..b2438547dd0 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -35,6 +35,7 @@ @@ -335,7 +323,7 @@ index 083f9417c..b2438547d 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index a293b17aa..91283157e 100644 +index a293b17aa10..91283157e30 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -35,6 +35,7 @@ @@ -367,7 +355,7 @@ index a293b17aa..91283157e 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index bd9d5b3e6..fb044a60c 100644 +index bd9d5b3e698..fb044a60c79 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c @@ -42,6 +42,7 @@ @@ -399,7 +387,7 @@ index bd9d5b3e6..fb044a60c 100644 grub_unregister_command (cmd_module); } diff --git a/grub-core/loader/xnu.c b/grub-core/loader/xnu.c -index c9885b1bc..df8dfdb4b 100644 +index c9885b1bcd7..df8dfdb4ba0 100644 --- a/grub-core/loader/xnu.c +++ b/grub-core/loader/xnu.c @@ -33,6 +33,7 @@ @@ -431,7 +419,7 @@ index c9885b1bc..df8dfdb4b 100644 grub_unregister_command (cmd_resume); #endif diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index bb3ab7dfd..91e29ce66 100644 +index bb3ab7dfdeb..91e29ce66f1 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -83,7 +83,6 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, @@ -444,7 +432,7 @@ index bb3ab7dfd..91e29ce66 100644 const grub_efi_device_path_t *dp2); diff --git a/include/grub/efi/sb.h b/include/grub/efi/sb.h new file mode 100644 -index 000000000..9629fbb0f +index 00000000000..9629fbb0f9e --- /dev/null +++ b/include/grub/efi/sb.h @@ -0,0 +1,29 @@ @@ -479,16 +467,28 @@ index 000000000..9629fbb0f +#endif /* ! GRUB_EFI_SB_HEADER */ diff --git a/include/grub/ia64/linux.h b/include/grub/ia64/linux.h new file mode 100644 -index 000000000..e69de29bb +index 00000000000..e69de29bb2d diff --git a/include/grub/mips/linux.h b/include/grub/mips/linux.h new file mode 100644 -index 000000000..e69de29bb +index 00000000000..e69de29bb2d diff --git a/include/grub/powerpc/linux.h b/include/grub/powerpc/linux.h new file mode 100644 -index 000000000..e69de29bb +index 00000000000..e69de29bb2d diff --git a/include/grub/sparc64/linux.h b/include/grub/sparc64/linux.h new file mode 100644 -index 000000000..e69de29bb +index 00000000000..e69de29bb2d +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index 10451384720..f7b4d29b0b3 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -71,6 +71,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h -- -2.14.3 +2.15.0 diff --git a/0154-Make-grub_fatal-also-backtrace.patch b/0154-Make-grub_fatal-also-backtrace.patch index 63a50c1..009358e 100644 --- a/0154-Make-grub_fatal-also-backtrace.patch +++ b/0154-Make-grub_fatal-also-backtrace.patch @@ -1,7 +1,7 @@ -From 37e08ec93e219ece7547b3d4bdbd594eb691fe1a Mon Sep 17 00:00:00 2001 +From 40796ff76628edf757056788564200957f9e3fbc Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 27 Jan 2016 09:22:42 -0500 -Subject: [PATCH 154/198] Make grub_fatal() also backtrace. +Subject: [PATCH 154/206] Make grub_fatal() also backtrace. --- grub-core/Makefile.core.def | 3 ++ @@ -13,7 +13,7 @@ Subject: [PATCH 154/198] Make grub_fatal() also backtrace. create mode 100644 grub-core/lib/arm64/backtrace.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 75a7ab344..3a5d450f3 100644 +index 75a7ab3441d..3a5d450f3d0 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -175,6 +175,9 @@ kernel = { @@ -27,7 +27,7 @@ index 75a7ab344..3a5d450f3 100644 i386_xen = kern/i386/dl.c; diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index f1fab7000..5ce89a40c 100644 +index f1fab700048..5ce89a40c68 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -24,6 +24,7 @@ @@ -55,7 +55,7 @@ index f1fab7000..5ce89a40c 100644 #endif diff --git a/grub-core/lib/arm64/backtrace.c b/grub-core/lib/arm64/backtrace.c new file mode 100644 -index 000000000..1079b5380 +index 00000000000..1079b5380e1 --- /dev/null +++ b/grub-core/lib/arm64/backtrace.c @@ -0,0 +1,62 @@ @@ -122,7 +122,7 @@ index 000000000..1079b5380 +} + diff --git a/grub-core/lib/backtrace.c b/grub-core/lib/backtrace.c -index 825a8800e..c0ad6ab8b 100644 +index 825a8800e25..c0ad6ab8be1 100644 --- a/grub-core/lib/backtrace.c +++ b/grub-core/lib/backtrace.c @@ -29,6 +29,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -142,7 +142,7 @@ index 825a8800e..c0ad6ab8b 100644 } diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c -index c3e03c727..c67273db3 100644 +index c3e03c7275c..c67273db3ae 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -15,11 +15,23 @@ @@ -171,5 +171,5 @@ index c3e03c727..c67273db3 100644 #include #include -- -2.14.3 +2.15.0 diff --git a/0155-Rework-linux-command.patch b/0155-Rework-linux-command.patch index be04b0a..77b5fef 100644 --- a/0155-Rework-linux-command.patch +++ b/0155-Rework-linux-command.patch @@ -1,7 +1,7 @@ -From b7c180177336f1979385e02651ba41f7ee79fefc Mon Sep 17 00:00:00 2001 +From 7bdb69cdbb54a400837f098d8cdf1a0cdd23f6ca Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:12:39 -0700 -Subject: [PATCH 155/198] Rework linux command +Subject: [PATCH 155/206] Rework linux command We want a single buffer that contains the entire kernel image in order to perform a TPM measurement. Allocate one and copy the entire kernel into it @@ -11,7 +11,7 @@ before pulling out the individual blocks later on. 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index b2438547d..e4b8342f5 100644 +index b2438547dd0..e4b8342f5d0 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -681,12 +681,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -103,5 +103,5 @@ index b2438547d..e4b8342f5 100644 grub_file_close (file); -- -2.14.3 +2.15.0 diff --git a/0156-Rework-linux16-command.patch b/0156-Rework-linux16-command.patch index 6359ee5..af422c2 100644 --- a/0156-Rework-linux16-command.patch +++ b/0156-Rework-linux16-command.patch @@ -1,7 +1,7 @@ -From 60e7a1d746e39f10808a1cbd2c4928624026fbf1 Mon Sep 17 00:00:00 2001 +From 4b7dc10875d95fde420bf62b75ed86d37bb1b172 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:20:58 -0700 -Subject: [PATCH 156/198] Rework linux16 command +Subject: [PATCH 156/206] Rework linux16 command We want a single buffer that contains the entire kernel image in order to perform a TPM measurement. Allocate one and copy the entire kernel int it @@ -11,7 +11,7 @@ before pulling out the individual blocks later on. 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 91283157e..b864e5403 100644 +index 91283157e30..b864e540333 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -124,13 +124,14 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -97,5 +97,5 @@ index 91283157e..b864e5403 100644 grub_file_close (file); -- -2.14.3 +2.15.0 diff --git a/0157-Make-grub-editenv-build-again.patch b/0157-Make-grub-editenv-build-again.patch index 0e7cbee..c168cb4 100644 --- a/0157-Make-grub-editenv-build-again.patch +++ b/0157-Make-grub-editenv-build-again.patch @@ -1,7 +1,7 @@ -From 587b65a7c706440b5e8592922d36173cb77e6b6e Mon Sep 17 00:00:00 2001 +From 7b698517977e63271f2692e623263de3fe57a8c8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Mar 2016 16:29:13 -0500 -Subject: [PATCH 157/198] Make grub-editenv build again. +Subject: [PATCH 157/206] Make grub-editenv build again. 36212460d3565b18439a3a8130b28e6c97702c6a split how some of the mkimage utility functions are defined, and they wind up being linked into @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/Makefile.util.def b/Makefile.util.def -index ed27351eb..38cdf4ccc 100644 +index ed27351eb47..38cdf4ccc09 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -236,6 +236,8 @@ program = { @@ -26,5 +26,5 @@ index ed27351eb..38cdf4ccc 100644 common = util/config.c; common = util/resolve.c; -- -2.14.3 +2.15.0 diff --git a/0158-Fix-up-some-man-pages-rpmdiff-noticed.patch b/0158-Fix-up-some-man-pages-rpmdiff-noticed.patch index 2a4f71a..987f676 100644 --- a/0158-Fix-up-some-man-pages-rpmdiff-noticed.patch +++ b/0158-Fix-up-some-man-pages-rpmdiff-noticed.patch @@ -1,7 +1,7 @@ -From c3d456a824ccf8c728cae4f50254239bafaf50a1 Mon Sep 17 00:00:00 2001 +From 908d355bba83df8000b313681e2e0ccdd7b8d1c2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 23 Sep 2014 09:58:49 -0400 -Subject: [PATCH 158/198] Fix up some man pages rpmdiff noticed. +Subject: [PATCH 158/206] Fix up some man pages rpmdiff noticed. --- configure.ac | 2 ++ @@ -13,7 +13,7 @@ Subject: [PATCH 158/198] Fix up some man pages rpmdiff noticed. create mode 100644 util/grub-syslinux2cfg.1 diff --git a/configure.ac b/configure.ac -index 40be70019..ae371a97d 100644 +index 40be70019e2..ae371a97d30 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ grub_TRANSFORM([grub-get-kernel-settings.3]) @@ -34,7 +34,7 @@ index 40be70019..ae371a97d 100644 if test "x$TARGET_CFLAGS" = x; then diff --git a/util/grub-macbless.8 b/util/grub-macbless.8 new file mode 100644 -index 000000000..ae842f3a6 +index 00000000000..ae842f3a606 --- /dev/null +++ b/util/grub-macbless.8 @@ -0,0 +1,26 @@ @@ -65,7 +65,7 @@ index 000000000..ae842f3a6 +.SH SEE ALSO +.BR "info grub" diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 -index 4dea4f545..0eaaafe50 100644 +index 4dea4f54597..0eaaafe505b 100644 --- a/util/grub-mkimage.1 +++ b/util/grub-mkimage.1 @@ -17,7 +17,7 @@ @@ -79,7 +79,7 @@ index 4dea4f545..0eaaafe50 100644 .TP diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1 new file mode 100644 -index 000000000..853094827 +index 00000000000..85309482718 --- /dev/null +++ b/util/grub-syslinux2cfg.1 @@ -0,0 +1,65 @@ @@ -149,5 +149,5 @@ index 000000000..853094827 +.SH SEE ALSO +.BR "info grub" -- -2.14.3 +2.15.0 diff --git a/0159-Re-work-some-intricacies-of-PE-loading.patch b/0159-Re-work-some-intricacies-of-PE-loading.patch index a4c3713..8898f69 100644 --- a/0159-Re-work-some-intricacies-of-PE-loading.patch +++ b/0159-Re-work-some-intricacies-of-PE-loading.patch @@ -1,7 +1,7 @@ -From 982d11a87ce05b6e4305b03a29945843311007d0 Mon Sep 17 00:00:00 2001 +From 4ce01aac79b9a2858e243626d1aec43c8ab39c1d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jun 2016 12:22:29 -0400 -Subject: [PATCH 159/198] Re-work some intricacies of PE loading. +Subject: [PATCH 159/206] Re-work some intricacies of PE loading. The PE spec is not a well written document, and awesomely every place where there's an ambiguous way to read something, Windows' bootmgfw.efi @@ -12,7 +12,7 @@ takes a different read than either of them. 2 files changed, 152 insertions(+), 36 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index aee8e6bec..4b77a7d5a 100644 +index aee8e6becf6..4b77a7d5adb 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -301,7 +301,7 @@ image_is_64_bit (grub_pe_header_t *pe_hdr) @@ -293,7 +293,7 @@ index aee8e6bec..4b77a7d5a 100644 efi_call_1 (b->free_pool, buffer); diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index 6e24dae2c..c03cc599f 100644 +index 6e24dae2cb6..c03cc599f63 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -229,12 +229,18 @@ struct grub_pe32_section_table @@ -349,5 +349,5 @@ index 6e24dae2c..c03cc599f 100644 struct grub_pe32_header -- -2.14.3 +2.15.0 diff --git a/0160-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch b/0160-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch index 89d404b..eb14709 100644 --- a/0160-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch +++ b/0160-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch @@ -1,7 +1,7 @@ -From 91943cb164e03979132310784ad802ea9dc3bbd9 Mon Sep 17 00:00:00 2001 +From 56562c289db5c67b9705feca4e8e61200b04d48b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 10 Jun 2016 14:06:15 -0400 -Subject: [PATCH 160/198] Rework even more of efi chainload so non-sb cases +Subject: [PATCH 160/206] Rework even more of efi chainload so non-sb cases work right. This ensures that if shim protocol is not loaded, or is loaded but shim @@ -44,14 +44,14 @@ Signed-off-by: Peter Jones --- grub-core/kern/efi/sb.c | 14 +++-- grub-core/loader/arm64/linux.c | 4 +- - grub-core/loader/efi/chainloader.c | 122 ++++++++++++++++++++++--------------- + grub-core/loader/efi/chainloader.c | 124 ++++++++++++++++++++++--------------- grub-core/loader/efi/linux.c | 13 ++-- grub-core/loader/i386/efi/linux.c | 10 ++- include/grub/efi/linux.h | 2 +- - 6 files changed, 102 insertions(+), 63 deletions(-) + 6 files changed, 103 insertions(+), 64 deletions(-) diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c -index a41b6c5b8..d74778b0c 100644 +index a41b6c5b851..d74778b0cac 100644 --- a/grub-core/kern/efi/sb.c +++ b/grub-core/kern/efi/sb.c @@ -36,14 +36,20 @@ grub_efi_secure_boot (void) @@ -80,10 +80,10 @@ index a41b6c5b8..d74778b0c 100644 if (*secure_boot && !*setup_mode) ret = 1; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 03ff83563..34f34e65a 100644 +index 33345d37534..ad39a301527 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c -@@ -248,6 +248,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -247,6 +247,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_file_t file = 0; struct grub_arm64_linux_kernel_header lh; struct grub_arm64_linux_pe_header *pe; @@ -91,7 +91,7 @@ index 03ff83563..34f34e65a 100644 grub_dl_ref (my_mod); -@@ -292,7 +293,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -291,7 +292,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); @@ -102,7 +102,7 @@ index 03ff83563..34f34e65a 100644 grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); goto fail; diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 4b77a7d5a..b977c7b55 100644 +index 4b77a7d5adb..b977c7b5573 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -182,7 +182,6 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) @@ -143,7 +143,7 @@ index 4b77a7d5a..b977c7b55 100644 if (adjust == 0) return GRUB_EFI_SUCCESS; -@@ -514,17 +512,24 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -514,18 +512,25 @@ handle_image (void *data, grub_efi_uint32_t datasize) grub_uint32_t section_alignment; grub_uint32_t buffer_size; int found_entry_point = 0; @@ -152,26 +152,28 @@ index 4b77a7d5a..b977c7b55 100644 b = grub_efi_system_table->boot_services; - if (read_header (data, datasize, &context)) +- { +- grub_dprintf ("chain", "Succeed to read header\n"); +- } +- else + rc = read_header (data, datasize, &context); + if (rc < 0) { -- grub_dprintf ("chain", "Succeed to read header\n"); -+ grub_dprintf ("chain", "Failed to read header\n"); -+ goto error_exit; -+ } + grub_dprintf ("chain", "Failed to read header\n"); + goto error_exit; + } + else if (rc == 0) + { + grub_dprintf ("chain", "Secure Boot is not enabled\n"); + return 0; - } - else - { -- grub_dprintf ("chain", "Failed to read header\n"); -- goto error_exit; ++ } ++ else ++ { + grub_dprintf ("chain", "Header read without error\n"); - } ++ } /* + * The spec says, uselessly, of SectionAlignment: @@ -547,7 +552,7 @@ handle_image (void *data, grub_efi_uint32_t datasize) section_alignment = 4096; @@ -296,7 +298,10 @@ index 4b77a7d5a..b977c7b55 100644 - - goto fail; - } -- ++ grub_load_and_start_image(boot_image); ++ grub_file_close (file); ++ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); + - /* LoadImage does not set a device handler when the image is - loaded from memory, so it is necessary to set it explicitly here. - This is a mess. */ @@ -307,10 +312,7 @@ index 4b77a7d5a..b977c7b55 100644 - goto fail; - } - loaded_image->device_handle = dev_handle; -+ grub_load_and_start_image(boot_image); -+ grub_file_close (file); -+ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); - +- - if (cmdline) - { - loaded_image->load_options = cmdline; @@ -331,7 +333,7 @@ index 4b77a7d5a..b977c7b55 100644 grub_device_close (dev); diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index aea378adf..8890bdf05 100644 +index aea378adf5c..8890bdf059a 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -33,21 +33,24 @@ struct grub_efi_shim_lock @@ -365,7 +367,7 @@ index aea378adf..8890bdf05 100644 typedef void (*handover_func) (void *, grub_efi_system_table_t *, void *); diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 7ccf32d9d..82f75b7f3 100644 +index 7ccf32d9d45..82f75b7f3ab 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -155,6 +155,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -397,7 +399,7 @@ index 7ccf32d9d..82f75b7f3 100644 goto fail; } diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h -index d9ede3677..0033d9305 100644 +index d9ede36773b..0033d9305a9 100644 --- a/include/grub/efi/linux.h +++ b/include/grub/efi/linux.h @@ -22,7 +22,7 @@ @@ -410,5 +412,5 @@ index d9ede3677..0033d9305 100644 grub_err_t EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, -- -2.14.3 +2.15.0 diff --git a/0161-linuxefi-fix-double-free-on-verification-failure.patch b/0161-linuxefi-fix-double-free-on-verification-failure.patch index c3ec3b2..acdcba1 100644 --- a/0161-linuxefi-fix-double-free-on-verification-failure.patch +++ b/0161-linuxefi-fix-double-free-on-verification-failure.patch @@ -1,7 +1,7 @@ -From 0e8eb89517d9621b2595f7d2b152f711309600ee Mon Sep 17 00:00:00 2001 +From 10ea5c02de8a66720847b46e98fe14e3f7d19199 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 09:50:25 -0400 -Subject: [PATCH 161/198] linuxefi: fix double free on verification failure. +Subject: [PATCH 161/206] linuxefi: fix double free on verification failure. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 82f75b7f3..010bf982d 100644 +index 82f75b7f3ab..010bf982d80 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -191,7 +191,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -21,5 +21,5 @@ index 82f75b7f3..010bf982d 100644 } -- -2.14.3 +2.15.0 diff --git a/0162-fix-machine-type-test-in-30_os-prober.in.patch b/0162-fix-machine-type-test-in-30_os-prober.in.patch index 1ae6f17..7c60fd2 100644 --- a/0162-fix-machine-type-test-in-30_os-prober.in.patch +++ b/0162-fix-machine-type-test-in-30_os-prober.in.patch @@ -1,7 +1,7 @@ -From 5661d4a67e4b13da0dc375946f07a56bb577e0f4 Mon Sep 17 00:00:00 2001 +From dd66269a4bdece11f6ea1744da6b1a36b5acb663 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 11 Jul 2016 13:36:45 -0400 -Subject: [PATCH 162/198] fix machine type test in 30_os-prober.in +Subject: [PATCH 162/206] fix machine type test in 30_os-prober.in Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index dc98eace9..e40274fc0 100644 +index dc98eace934..e40274fc0f4 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -144,6 +144,7 @@ for OS in ${OSPROBED} ; do @@ -21,5 +21,5 @@ index dc98eace9..e40274fc0 100644 i?86|x86_64) sixteenbit="16" -- -2.14.3 +2.15.0 diff --git a/0163-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch b/0163-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch index a96effd..ea9b51a 100644 --- a/0163-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch +++ b/0163-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch @@ -1,7 +1,7 @@ -From a8b65c0ac1e2ddd001e8b837c798f1b135f2a522 Mon Sep 17 00:00:00 2001 +From 1543d9204f0bd32c3c06da2b55c7d531a88a0c95 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 21 Nov 2016 15:34:00 +0100 -Subject: [PATCH 163/198] efi/chainloader: fix wrong sanity check in +Subject: [PATCH 163/206] efi/chainloader: fix wrong sanity check in relocate_coff() In relocate_coff(), the relocation entries are parsed from the original @@ -22,7 +22,7 @@ Tested-by: Juan Orti 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index b977c7b55..d5ab21d09 100644 +index b977c7b5573..d5ab21d09c3 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -401,7 +401,7 @@ relocate_coff (pe_coff_loader_image_context_t *context, @@ -35,5 +35,5 @@ index b977c7b55..d5ab21d09 100644 grub_error (GRUB_ERR_BAD_ARGUMENT, "Reloc entry %d overflows binary", n); -- -2.14.3 +2.15.0 diff --git a/0164-efi-chainloader-truncate-overlong-relocation-section.patch b/0164-efi-chainloader-truncate-overlong-relocation-section.patch index 39de070..4218508 100644 --- a/0164-efi-chainloader-truncate-overlong-relocation-section.patch +++ b/0164-efi-chainloader-truncate-overlong-relocation-section.patch @@ -1,7 +1,7 @@ -From a503341b2bb28a86d940305fb91e3c3827e15f0f Mon Sep 17 00:00:00 2001 +From ffcf6eb1050f80efee9df9dd7e2377f7379d0f9a Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 23 Nov 2016 06:27:09 +0100 -Subject: [PATCH 164/198] efi/chainloader: truncate overlong relocation section +Subject: [PATCH 164/206] efi/chainloader: truncate overlong relocation section The UEFI Windows 7 boot loader ("EFI/Microsoft/Boot/bootmgfw.efi", SHA1 31b410e029bba87d2068c65a80b88882f9f8ea25) has inconsistent headers. @@ -63,7 +63,7 @@ Signed-off-by: Laszlo Ersek 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index d5ab21d09..7826e794a 100644 +index d5ab21d09c3..7826e794ad9 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -596,7 +596,7 @@ handle_image (void *data, grub_efi_uint32_t datasize) @@ -109,5 +109,5 @@ index d5ab21d09..7826e794a 100644 grub_dprintf ("chain", " section is not reloc section?\n"); grub_dprintf ("chain", " rds: 0x%08x, vs: %08x\n", -- -2.14.3 +2.15.0 diff --git a/0165-linuxefi-minor-cleanups.patch b/0165-linuxefi-minor-cleanups.patch index 6795bbb..176e32c 100644 --- a/0165-linuxefi-minor-cleanups.patch +++ b/0165-linuxefi-minor-cleanups.patch @@ -1,7 +1,7 @@ -From 2d1e45c97ab97cc924769095521664192e8196ed Mon Sep 17 00:00:00 2001 +From 242d81d7af4fa50070cc7bd44b9f38a25248080b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:31:52 -0500 -Subject: [PATCH 165/198] linuxefi: minor cleanups +Subject: [PATCH 165/206] linuxefi: minor cleanups Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 010bf982d..8b5a817b9 100644 +index 010bf982d80..8b5a817b9d1 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -61,13 +61,18 @@ grub_linuxefi_unload (void) @@ -85,5 +85,5 @@ index 010bf982d..8b5a817b9 100644 return grub_errno; } -- -2.14.3 +2.15.0 diff --git a/0166-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch b/0166-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch index 143c6a3..24a8eba 100644 --- a/0166-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch +++ b/0166-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch @@ -1,19 +1,19 @@ -From 7f34f8d670e4dccf341de5acf388cfa79c7361fd Mon Sep 17 00:00:00 2001 +From 6fe073f4eed1a287314e7581b955a39d069b5d35 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:18:54 -0500 -Subject: [PATCH 166/198] Handle multi-arch (64-on-32) boot in linuxefi loader. +Subject: [PATCH 166/206] Handle multi-arch (64-on-32) boot in linuxefi loader. Allow booting 64-bit kernels on 32-bit EFI on x86. Signed-off-by: Peter Jones --- - grub-core/loader/efi/linux.c | 9 ++- - grub-core/loader/i386/efi/linux.c | 114 +++++++++++++++++++++++++++----------- + grub-core/loader/efi/linux.c | 9 +++- + grub-core/loader/i386/efi/linux.c | 110 +++++++++++++++++++++++++++----------- include/grub/i386/linux.h | 7 ++- - 3 files changed, 95 insertions(+), 35 deletions(-) + 3 files changed, 93 insertions(+), 33 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index 8890bdf05..2a7024134 100644 +index 8890bdf059a..2a7024134da 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -56,12 +56,17 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) @@ -37,7 +37,7 @@ index 8890bdf05..2a7024134 100644 return GRUB_ERR_BUG; diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 8b5a817b9..bed5919ca 100644 +index 8b5a817b9d1..bed5919cab3 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -44,14 +44,10 @@ static char *linux_cmdline; @@ -103,14 +103,12 @@ index 8b5a817b9..bed5919ca 100644 } - grub_memset (params, 0, 16384); -- -- grub_memcpy (&lh, kernel, sizeof (lh)); -- -- if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + grub_dprintf ("linuxefi", "params = %p\n", (unsigned long) params); -+ + +- grub_memcpy (&lh, kernel, sizeof (lh)); + grub_memset (params, 0, sizeof(*params)); -+ + +- if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + setup_header_end_offset = *((grub_uint8_t *)kernel + 0x201); + grub_dprintf ("linuxefi", "copying %d bytes from %p to %p\n", + MIN(0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1, @@ -152,8 +150,6 @@ index 8b5a817b9..bed5919ca 100644 goto fail; } -- linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, -- BYTES_TO_PAGES(lh.cmdline_size + 1)); +#if defined(__x86_64__) || defined(__aarch64__) + grub_dprintf ("linuxefi", "checking lh->xloadflags\n"); + if (!(lh->xloadflags & LINUX_XLF_KERNEL_64)) @@ -172,9 +168,11 @@ index 8b5a817b9..bed5919ca 100644 + goto fail; + } +#endif - ++ + grub_dprintf ("linuxefi", "setting up cmdline\n"); -+ linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, + linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, +- BYTES_TO_PAGES(lh.cmdline_size + 1)); +- + BYTES_TO_PAGES(lh->cmdline_size + 1)); if (!linux_cmdline) { @@ -234,15 +232,15 @@ index 8b5a817b9..bed5919ca 100644 - params->type_of_loader = 0x21; + grub_dprintf ("linuxefi", "setting lh->type_of_loader\n"); + lh->type_of_loader = 0x6; - -- fail: ++ + grub_dprintf ("linuxefi", "setting lh->ext_loader_{type,ver}\n"); + params->ext_loader_type = 0; + params->ext_loader_ver = 2; + grub_dprintf("linuxefi", "kernel_mem: %p handover_offset: %08x\n", + kernel_mem, handover_offset); -+ fail: + fail: +- if (file) grub_file_close (file); @@ -256,7 +254,7 @@ index 8b5a817b9..bed5919ca 100644 if (kernel_mem && !loaded) grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem, diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index fc36bdaf3..110ecf806 100644 +index fc36bdaf367..110ecf806fb 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -130,7 +130,12 @@ struct linux_kernel_header @@ -274,5 +272,5 @@ index fc36bdaf3..110ecf806 100644 grub_uint32_t hardware_subarch; grub_uint64_t hardware_subarch_data; -- -2.14.3 +2.15.0 diff --git a/0167-Fix-up-linux-params-usage.patch b/0167-Fix-up-linux-params-usage.patch index 1244c53..9ea52ff 100644 --- a/0167-Fix-up-linux-params-usage.patch +++ b/0167-Fix-up-linux-params-usage.patch @@ -1,7 +1,7 @@ -From 45a648d1dc7a63cbff180848ca6ab6e26365de11 Mon Sep 17 00:00:00 2001 +From b90a1afe2d3af828cccd291cb09b8cda2fc581dc Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 May 2017 14:16:07 -0400 -Subject: [PATCH 167/198] Fix up linux params usage... +Subject: [PATCH 167/206] Fix up linux params usage... Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index e4b8342f5..c9e89310b 100644 +index e4b8342f5d0..c9e89310bdd 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -39,5 +39,5 @@ index e4b8342f5..c9e89310b 100644 linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; -- -2.14.3 +2.15.0 diff --git a/0168-Make-exit-take-a-return-code.patch b/0168-Make-exit-take-a-return-code.patch index c094147..d6bbfb8 100644 --- a/0168-Make-exit-take-a-return-code.patch +++ b/0168-Make-exit-take-a-return-code.patch @@ -1,7 +1,7 @@ -From 71af399a49085b805028f1faadda16b503ce46a0 Mon Sep 17 00:00:00 2001 +From 65473fe6fe5bc08a874eb433c3da3e7181250822 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 26 Feb 2014 21:49:12 -0500 -Subject: [PATCH 168/198] Make "exit" take a return code. +Subject: [PATCH 168/206] Make "exit" take a return code. This adds "exit" with a return code. With this patch, any "exit" command /may/ include a return code, and on platforms that support @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 2 files changed, 15 insertions(+) diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c -index 55ea5a11c..7e47ec812 100644 +index 55ea5a11ccd..7e47ec81263 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -72,6 +72,12 @@ grub_exit (int retval __attribute__((unused))) @@ -32,7 +32,7 @@ index 55ea5a11c..7e47ec812 100644 grub_machine_init (void) { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 5ce89a40c..04371ac49 100644 +index 5ce89a40c68..04371ac49f2 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1120,6 +1120,15 @@ grub_abort (void) @@ -52,5 +52,5 @@ index 5ce89a40c..04371ac49 100644 grub_fatal (const char *fmt, ...) { -- -2.14.3 +2.15.0 diff --git a/0169-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch b/0169-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch index 7c9568b..6d11c9b 100644 --- a/0169-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch +++ b/0169-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch @@ -1,7 +1,7 @@ -From 6246598c06a27ca40a6101e39fb788d1a02976d7 Mon Sep 17 00:00:00 2001 +From a90a7d236fcfa01bd09e34fdec5782c6509c6578 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Mon, 17 Apr 2017 08:44:29 -0400 -Subject: [PATCH 169/198] arm64: make sure fdt has #address-cells and +Subject: [PATCH 169/206] arm64: make sure fdt has #address-cells and #size-cells properties Recent upstream changes to kexec-tools relies on #address-cells @@ -14,7 +14,7 @@ make sure they exist. 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 34f34e65a..530c4ba2d 100644 +index ad39a301527..59ff9cc05b4 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -79,7 +79,21 @@ finalize_params_linux (void) @@ -41,5 +41,5 @@ index 34f34e65a..530c4ba2d 100644 if (node < 1) goto failure; -- -2.14.3 +2.15.0 diff --git a/0170-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch b/0170-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch index eda242c..59c2098 100644 --- a/0170-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch +++ b/0170-Add-some-grub_dprintf-in-the-secure-boot-verify-code.patch @@ -1,7 +1,7 @@ -From c293c4a99ef27e210014b4c87f0330df40571a4c Mon Sep 17 00:00:00 2001 +From 5c94dbb64c3ffa6394be00cd185e111151fbe6f1 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 9 May 2016 14:15:17 -0400 -Subject: [PATCH 170/198] Add some grub_dprintf() in the secure boot verify +Subject: [PATCH 170/206] Add some grub_dprintf() in the secure boot verify code. Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index 2a7024134..7fe7201a3 100644 +index 2a7024134da..7fe7201a388 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -43,12 +43,22 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) @@ -40,5 +40,5 @@ index 2a7024134..7fe7201a3 100644 return -1; } -- -2.14.3 +2.15.0 diff --git a/0171-Make-our-info-pages-say-grub2-where-appropriate.patch b/0171-Make-our-info-pages-say-grub2-where-appropriate.patch index 887e760..c2ba248 100644 --- a/0171-Make-our-info-pages-say-grub2-where-appropriate.patch +++ b/0171-Make-our-info-pages-say-grub2-where-appropriate.patch @@ -1,7 +1,7 @@ -From 12e056f068df6a17ddee61959a3d5da409366a91 Mon Sep 17 00:00:00 2001 +From 53bdb9166fd78f0c703292529a1b674b2c5a58c7 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 6 May 2016 18:43:08 -0400 -Subject: [PATCH 171/198] Make our info pages say "grub2" where appropriate. +Subject: [PATCH 171/206] Make our info pages say "grub2" where appropriate. This needs to be hooked up to --program-transform=, but I haven't had time. @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 2 files changed, 161 insertions(+), 161 deletions(-) diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi -index a9f4de631..3ce827ab7 100644 +index a9f4de6318c..3ce827ab726 100644 --- a/docs/grub-dev.texi +++ b/docs/grub-dev.texi @@ -1,7 +1,7 @@ @@ -35,7 +35,7 @@ index a9f4de631..3ce827ab7 100644 @setchapternewpage odd diff --git a/docs/grub.texi b/docs/grub.texi -index 15a90b26e..f28c4cd52 100644 +index 15a90b26e4d..f28c4cd5247 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1,7 +1,7 @@ @@ -1012,5 +1012,5 @@ index 15a90b26e..f28c4cd52 100644 @table @option @item --help -- -2.14.3 +2.15.0 diff --git a/0172-print-more-debug-info-in-our-module-loader.patch b/0172-print-more-debug-info-in-our-module-loader.patch index 0b0c1fb..9e58733 100644 --- a/0172-print-more-debug-info-in-our-module-loader.patch +++ b/0172-print-more-debug-info-in-our-module-loader.patch @@ -1,7 +1,7 @@ -From 10d3df4413dde0edf41ba1adeba50ef62577d967 Mon Sep 17 00:00:00 2001 +From ecb06a3cb18f13882faeef81011396fac5594d71 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 May 2017 11:19:40 -0400 -Subject: [PATCH 172/198] print more debug info in our module loader. +Subject: [PATCH 172/206] print more debug info in our module loader. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 684ca93f8..1f3ac5e1d 100644 +index 684ca93f8f4..1f3ac5e1d08 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -304,13 +304,23 @@ grub_efi_modules_addr (void) @@ -40,5 +40,5 @@ index 684ca93f8..1f3ac5e1d 100644 } -- -2.14.3 +2.15.0 diff --git a/0173-macos-just-build-chainloader-entries-don-t-try-any-x.patch b/0173-macos-just-build-chainloader-entries-don-t-try-any-x.patch index 81f0796..82b5f19 100644 --- a/0173-macos-just-build-chainloader-entries-don-t-try-any-x.patch +++ b/0173-macos-just-build-chainloader-entries-don-t-try-any-x.patch @@ -1,7 +1,7 @@ -From f92f6c050e5c1bfc3146dd674dc37ac12cbb1c76 Mon Sep 17 00:00:00 2001 +From d58a3e5545c0a3245fdd9a05b6696c619d98fe84 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 24 May 2017 12:42:32 -0400 -Subject: [PATCH 173/198] macos: just build chainloader entries, don't try any +Subject: [PATCH 173/206] macos: just build chainloader entries, don't try any xnu xnu. Since our bugs tell us that the xnu boot entries really just don't work @@ -21,7 +21,7 @@ Signed-off-by: Peter Jones 1 file changed, 18 insertions(+), 60 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index e40274fc0..d979de198 100644 +index e40274fc0f4..d979de1982a 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -42,68 +42,25 @@ if [ -z "${OSPROBED}" ] ; then @@ -124,5 +124,5 @@ index e40274fc0..d979de198 100644 hurd) onstr="$(gettext_printf "(on %s)" "${DEVICE}")" -- -2.14.3 +2.15.0 diff --git a/0174-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch b/0174-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch index c825be9..bf52507 100644 --- a/0174-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch +++ b/0174-grub2-btrfs-Add-ability-to-boot-from-subvolumes.patch @@ -1,7 +1,7 @@ -From 1a7e8fd6eaff05a32889e48e9fae6f9c80219a04 Mon Sep 17 00:00:00 2001 +From 1b996230e31c4f854c42d71a1697a063a6a06808 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 18 Dec 2013 09:57:04 +0000 -Subject: [PATCH 174/198] grub2/btrfs: Add ability to boot from subvolumes +Subject: [PATCH 174/206] grub2/btrfs: Add ability to boot from subvolumes This patch adds the ability to specify a different root on a btrfs filesystem too boot from other than the default one. @@ -19,12 +19,12 @@ variable and loading the config file from the subvolume. Signed-off-by: Jeff Mahoney --- - grub-core/fs/btrfs.c | 548 +++++++++++++++++++++++++++++++++++++++++++++++++-- + grub-core/fs/btrfs.c | 552 +++++++++++++++++++++++++++++++++++++++++++++++++-- include/grub/btrfs.h | 1 + - 2 files changed, 531 insertions(+), 18 deletions(-) + 2 files changed, 533 insertions(+), 20 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4849c1ceb..38facf3cb 100644 +index 4849c1ceb65..38facf3cb8b 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -29,6 +29,9 @@ @@ -314,40 +314,45 @@ index 4849c1ceb..38facf3cb 100644 } continue; } -@@ -1673,6 +1867,20 @@ grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len) +@@ -1673,18 +1867,10 @@ grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len) data->tree, file->offset, buf, len); } +-static grub_err_t +-grub_btrfs_uuid (grub_device_t device, char **uuid) +static char * +btrfs_unparse_uuid(struct grub_btrfs_data *data) -+{ + { +- struct grub_btrfs_data *data; +- +- *uuid = NULL; +- +- data = grub_btrfs_mount (device); +- if (!data) +- return grub_errno; +- +- *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + return grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", -+ grub_be_to_cpu16 (data->sblock.uuid[0]), -+ grub_be_to_cpu16 (data->sblock.uuid[1]), -+ grub_be_to_cpu16 (data->sblock.uuid[2]), -+ grub_be_to_cpu16 (data->sblock.uuid[3]), -+ grub_be_to_cpu16 (data->sblock.uuid[4]), -+ grub_be_to_cpu16 (data->sblock.uuid[5]), -+ grub_be_to_cpu16 (data->sblock.uuid[6]), -+ grub_be_to_cpu16 (data->sblock.uuid[7])); + grub_be_to_cpu16 (data->sblock.uuid[0]), + grub_be_to_cpu16 (data->sblock.uuid[1]), + grub_be_to_cpu16 (data->sblock.uuid[2]), +@@ -1693,6 +1879,20 @@ grub_btrfs_uuid (grub_device_t device, char **uuid) + grub_be_to_cpu16 (data->sblock.uuid[5]), + grub_be_to_cpu16 (data->sblock.uuid[6]), + grub_be_to_cpu16 (data->sblock.uuid[7])); +} + - static grub_err_t - grub_btrfs_uuid (grub_device_t device, char **uuid) - { -@@ -1684,15 +1892,7 @@ grub_btrfs_uuid (grub_device_t device, char **uuid) - if (!data) - return grub_errno; - -- *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x", -- grub_be_to_cpu16 (data->sblock.uuid[0]), -- grub_be_to_cpu16 (data->sblock.uuid[1]), -- grub_be_to_cpu16 (data->sblock.uuid[2]), -- grub_be_to_cpu16 (data->sblock.uuid[3]), -- grub_be_to_cpu16 (data->sblock.uuid[4]), -- grub_be_to_cpu16 (data->sblock.uuid[5]), -- grub_be_to_cpu16 (data->sblock.uuid[6]), -- grub_be_to_cpu16 (data->sblock.uuid[7])); ++static grub_err_t ++grub_btrfs_uuid (grub_device_t device, char **uuid) ++{ ++ struct grub_btrfs_data *data; ++ ++ *uuid = NULL; ++ ++ data = grub_btrfs_mount (device); ++ if (!data) ++ return grub_errno; ++ + *uuid = btrfs_unparse_uuid(data); grub_btrfs_unmount (data); @@ -685,7 +690,7 @@ index 4849c1ceb..38facf3cb 100644 + +// vim: si et sw=2: diff --git a/include/grub/btrfs.h b/include/grub/btrfs.h -index 9d93fb6c1..234ad9767 100644 +index 9d93fb6c182..234ad976771 100644 --- a/include/grub/btrfs.h +++ b/include/grub/btrfs.h @@ -29,6 +29,7 @@ enum @@ -697,5 +702,5 @@ index 9d93fb6c1..234ad9767 100644 }; -- -2.14.3 +2.15.0 diff --git a/0175-export-btrfs_subvol-and-btrfs_subvolid.patch b/0175-export-btrfs_subvol-and-btrfs_subvolid.patch index 6e0edd8..d6e7d47 100644 --- a/0175-export-btrfs_subvol-and-btrfs_subvolid.patch +++ b/0175-export-btrfs_subvol-and-btrfs_subvolid.patch @@ -1,7 +1,7 @@ -From e32ed89b520f2cbe6303ba78242cb1c645ab8cb6 Mon Sep 17 00:00:00 2001 +From 4d9c208da7d1bd1a88cdb814bd3fb226349aa4dc Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Wed, 18 Dec 2013 09:57:04 +0000 -Subject: [PATCH 175/198] export btrfs_subvol and btrfs_subvolid +Subject: [PATCH 175/206] export btrfs_subvol and btrfs_subvolid We should export btrfs_subvol and btrfs_subvolid to have both visible to subsidiary configuration files loaded using configfile. @@ -12,7 +12,7 @@ Signed-off-by: Michael Chang 1 file changed, 2 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 38facf3cb..396296166 100644 +index 38facf3cb8b..3962961666e 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2273,6 +2273,8 @@ GRUB_MOD_INIT (btrfs) @@ -25,5 +25,5 @@ index 38facf3cb..396296166 100644 GRUB_MOD_FINI (btrfs) -- -2.14.3 +2.15.0 diff --git a/0176-grub2-btrfs-03-follow_default.patch b/0176-grub2-btrfs-03-follow_default.patch index dc1e498..ee09d42 100644 --- a/0176-grub2-btrfs-03-follow_default.patch +++ b/0176-grub2-btrfs-03-follow_default.patch @@ -1,14 +1,14 @@ -From 6c59dbc93e8757b6b79d93e3e3cd97a506778682 Mon Sep 17 00:00:00 2001 +From 9dbffec98eb6aaf3c020d32f4e50c0a478f76c4c Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 -Subject: [PATCH 176/198] grub2-btrfs-03-follow_default +Subject: [PATCH 176/206] grub2-btrfs-03-follow_default --- grub-core/fs/btrfs.c | 107 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 396296166..2c462584e 100644 +index 3962961666e..2c462584e91 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -920,6 +920,7 @@ grub_btrfs_mount (grub_device_t dev) @@ -195,5 +195,5 @@ index 396296166..2c462584e 100644 GRUB_MOD_FINI (btrfs) -- -2.14.3 +2.15.0 diff --git a/0177-grub2-btrfs-04-grub2-install.patch b/0177-grub2-btrfs-04-grub2-install.patch index f16a4b1..c23ce2c 100644 --- a/0177-grub2-btrfs-04-grub2-install.patch +++ b/0177-grub2-btrfs-04-grub2-install.patch @@ -1,19 +1,19 @@ -From fab60e6bf20b1759145eab3056846dfba3610a62 Mon Sep 17 00:00:00 2001 +From 3c9245b695f3abcab701dfb4dee9a04a49a5ec8d Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 -Subject: [PATCH 177/198] grub2-btrfs-04-grub2-install +Subject: [PATCH 177/206] grub2-btrfs-04-grub2-install --- grub-core/osdep/linux/getroot.c | 7 +++++++ grub-core/osdep/unix/config.c | 17 +++++++++++++++-- - include/grub/emu/config.h | 1 + util/config.c | 10 ++++++++++ util/grub-install.c | 15 +++++++++++++++ util/grub-mkrelpath.c | 6 ++++++ + include/grub/emu/config.h | 1 + 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 6d9f4e5fa..5d50dd6f8 100644 +index 6d9f4e5faa2..5d50dd6f8dc 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -376,6 +376,7 @@ get_btrfs_fs_prefix (const char *mount_path) @@ -38,7 +38,7 @@ index 6d9f4e5fa..5d50dd6f8 100644 else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0) { diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c -index 65effa9f3..b637c58ef 100644 +index 65effa9f3a7..b637c58efb7 100644 --- a/grub-core/osdep/unix/config.c +++ b/grub-core/osdep/unix/config.c @@ -82,6 +82,19 @@ grub_util_load_config (struct grub_util_config *cfg) @@ -72,20 +72,8 @@ index 65effa9f3..b637c58ef 100644 argv[2] = script; argv[3] = '\0'; -diff --git a/include/grub/emu/config.h b/include/grub/emu/config.h -index 875d5896c..c9a7e5f4a 100644 ---- a/include/grub/emu/config.h -+++ b/include/grub/emu/config.h -@@ -37,6 +37,7 @@ struct grub_util_config - { - int is_cryptodisk_enabled; - char *grub_distributor; -+ int is_suse_btrfs_snapshot_enabled; - }; - - void diff --git a/util/config.c b/util/config.c -index ebcdd8f5e..f044a880a 100644 +index ebcdd8f5e22..f044a880a76 100644 --- a/util/config.c +++ b/util/config.c @@ -42,6 +42,16 @@ grub_util_parse_config (FILE *f, struct grub_util_config *cfg, int simple) @@ -106,7 +94,7 @@ index ebcdd8f5e..f044a880a 100644 sizeof ("GRUB_DISTRIBUTOR=") - 1) == 0) { diff --git a/util/grub-install.c b/util/grub-install.c -index 75e3e5ba6..036fe1822 100644 +index 75e3e5ba6f0..036fe1822e0 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -816,6 +816,8 @@ fill_core_services (const char *core_services) @@ -146,7 +134,7 @@ index 75e3e5ba6..036fe1822 100644 char *install_drive = NULL; diff --git a/util/grub-mkrelpath.c b/util/grub-mkrelpath.c -index 47a241a39..5db7a9a7d 100644 +index 47a241a391b..5db7a9a7d97 100644 --- a/util/grub-mkrelpath.c +++ b/util/grub-mkrelpath.c @@ -40,9 +40,12 @@ struct arguments @@ -172,6 +160,18 @@ index 47a241a39..5db7a9a7d 100644 case ARGP_KEY_ARG: if (state->arg_num == 0) arguments->pathname = xstrdup (arg); +diff --git a/include/grub/emu/config.h b/include/grub/emu/config.h +index 875d5896ce1..c9a7e5f4ade 100644 +--- a/include/grub/emu/config.h ++++ b/include/grub/emu/config.h +@@ -37,6 +37,7 @@ struct grub_util_config + { + int is_cryptodisk_enabled; + char *grub_distributor; ++ int is_suse_btrfs_snapshot_enabled; + }; + + void -- -2.14.3 +2.15.0 diff --git a/0178-grub2-btrfs-05-grub2-mkconfig.patch b/0178-grub2-btrfs-05-grub2-mkconfig.patch index 46a9ce2..2c22a0b 100644 --- a/0178-grub2-btrfs-05-grub2-mkconfig.patch +++ b/0178-grub2-btrfs-05-grub2-mkconfig.patch @@ -1,7 +1,7 @@ -From 54f7769a22e9f82a9c894746e61d86f33d226218 Mon Sep 17 00:00:00 2001 +From 2d588223e2beb9af35ed05e57d19563f9aaf19ac Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 21 Aug 2014 03:39:11 +0000 -Subject: [PATCH 178/198] grub2-btrfs-05-grub2-mkconfig +Subject: [PATCH 178/206] grub2-btrfs-05-grub2-mkconfig --- util/grub-mkconfig.in | 3 ++- @@ -12,7 +12,7 @@ Subject: [PATCH 178/198] grub2-btrfs-05-grub2-mkconfig 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index e32de5ef3..3b0bfe403 100644 +index e32de5ef361..3b0bfe40308 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -239,7 +239,8 @@ export GRUB_DEFAULT \ @@ -26,7 +26,7 @@ index e32de5ef3..3b0bfe403 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 9c410eae4..2fb4f4f81 100644 +index 9c410eae493..2fb4f4f8143 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -52,7 +52,11 @@ grub_warn () @@ -42,7 +42,7 @@ index 9c410eae4..2fb4f4f81 100644 is_path_readable_by_grub () diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 858b526c9..e2a533001 100644 +index 858b526c925..e2a53300126 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -27,6 +27,14 @@ export TEXTDOMAINDIR="@localedir@" @@ -88,7 +88,7 @@ index 858b526c9..e2a533001 100644 +EOF +fi diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c9bf223f2..7e78ad336 100644 +index c9bf223f273..7e78ad33636 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -56,10 +56,14 @@ fi @@ -107,7 +107,7 @@ index c9bf223f2..7e78ad336 100644 xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 54f1ec8a2..462f8e1f8 100644 +index 54f1ec8a2fd..462f8e1f819 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -63,10 +63,14 @@ fi @@ -126,5 +126,5 @@ index 54f1ec8a2..462f8e1f8 100644 xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` -- -2.14.3 +2.15.0 diff --git a/0179-grub2-btrfs-06-subvol-mount.patch b/0179-grub2-btrfs-06-subvol-mount.patch index ba6a364..a0e4bc2 100644 --- a/0179-grub2-btrfs-06-subvol-mount.patch +++ b/0179-grub2-btrfs-06-subvol-mount.patch @@ -1,17 +1,17 @@ -From a27ef49601c7c4c58dc23663df1e0c1c960481af Mon Sep 17 00:00:00 2001 +From 75976884b9382d2445e328d354dad7c78a502d16 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 22 May 2015 11:45:25 +0000 -Subject: [PATCH 179/198] grub2-btrfs-06-subvol-mount +Subject: [PATCH 179/206] grub2-btrfs-06-subvol-mount --- grub-core/fs/btrfs.c | 195 +++++++++++++++++++++++++++++++++++++++- grub-core/osdep/linux/getroot.c | 148 +++++++++++++++++++++++++++++- - include/grub/emu/getroot.h | 5 ++ util/grub-install.c | 49 ++++++++++ + include/grub/emu/getroot.h | 5 ++ 4 files changed, 392 insertions(+), 5 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 2c462584e..d111147e8 100644 +index 2c462584e91..d111147e836 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -32,6 +32,7 @@ @@ -277,7 +277,7 @@ index 2c462584e..d111147e8 100644 grub_cmd_btrfs_list_subvols, 0, "[-p|-n] [-o var] DEVICE", diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 5d50dd6f8..4c5a13022 100644 +index 5d50dd6f8dc..4c5a13022dc 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -107,6 +107,14 @@ struct btrfs_ioctl_search_key @@ -459,24 +459,8 @@ index 5d50dd6f8..4c5a13022 100644 char * grub_make_system_path_relative_to_its_root_os (const char *path) { -diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h -index 73fa2d34a..9c642ae3f 100644 ---- a/include/grub/emu/getroot.h -+++ b/include/grub/emu/getroot.h -@@ -53,6 +53,11 @@ char ** - grub_find_root_devices_from_mountinfo (const char *dir, char **relroot); - #endif - -+#ifdef __linux__ -+char * -+grub_util_get_btrfs_subvol (const char *path, char **mount_path); -+#endif -+ - /* Devmapper functions provided by getroot_devmapper.c. */ - void - grub_util_pull_devmapper (const char *os_dev); diff --git a/util/grub-install.c b/util/grub-install.c -index 036fe1822..cd84a72b9 100644 +index 036fe1822e0..cd84a72b97b 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1534,6 +1534,55 @@ main (int argc, char *argv[]) @@ -535,6 +519,22 @@ index 036fe1822..cd84a72b9 100644 char mkimage_target[200]; const char *core_name = NULL; +diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h +index 73fa2d34abb..9c642ae3fe3 100644 +--- a/include/grub/emu/getroot.h ++++ b/include/grub/emu/getroot.h +@@ -53,6 +53,11 @@ char ** + grub_find_root_devices_from_mountinfo (const char *dir, char **relroot); + #endif + ++#ifdef __linux__ ++char * ++grub_util_get_btrfs_subvol (const char *path, char **mount_path); ++#endif ++ + /* Devmapper functions provided by getroot_devmapper.c. */ + void + grub_util_pull_devmapper (const char *os_dev); -- -2.14.3 +2.15.0 diff --git a/0180-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch b/0180-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch index 6d44057..bc52fd6 100644 --- a/0180-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch +++ b/0180-No-more-Bootable-Snapshot-submenu-in-grub.cfg.patch @@ -1,7 +1,7 @@ -From 24ffe7f751ba5ca1fcaef235f104c385091af25f Mon Sep 17 00:00:00 2001 +From 01f78b61c49b62aeb5cd27f3cbc479d4177ccf7d Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sat, 18 Jul 2015 15:38:08 +0000 -Subject: [PATCH 180/198] No more "Bootable Snapshot" submenu in grub.cfg. +Subject: [PATCH 180/206] No more "Bootable Snapshot" submenu in grub.cfg. This breaks grubby (run on kernel upgrades) because grubby just does a search for "menuentry". @@ -10,7 +10,7 @@ does a search for "menuentry". 1 file changed, 12 deletions(-) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index e2a533001..8a16fea34 100644 +index e2a53300126..8a16fea347e 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -366,15 +366,3 @@ fi @@ -30,5 +30,5 @@ index e2a533001..8a16fea34 100644 -EOF -fi -- -2.14.3 +2.15.0 diff --git a/0181-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch b/0181-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch index 03ae159..7cd45ee 100644 --- a/0181-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch +++ b/0181-Fallback-to-old-subvol-name-scheme-to-support-old-sn.patch @@ -1,7 +1,7 @@ -From 7cfb7a4b2d8c90ef6aa17c32b059eb2c5ed45b3d Mon Sep 17 00:00:00 2001 +From 47d4b57eb561b27af62427721a7e1fdef55129f0 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 21 Jun 2016 16:44:17 +0000 -Subject: [PATCH 181/198] Fallback to old subvol name scheme to support old +Subject: [PATCH 181/206] Fallback to old subvol name scheme to support old snapshot config Ref: bsc#953538 @@ -10,7 +10,7 @@ Ref: bsc#953538 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index d111147e8..a5c000805 100644 +index d111147e836..a5c000805a7 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -924,11 +924,41 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path) @@ -57,5 +57,5 @@ index d111147e8..a5c000805 100644 if (btrfs_default_subvolid) return lookup_root_by_id(data, btrfs_default_subvolid); -- -2.14.3 +2.15.0 diff --git a/0182-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch b/0182-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch index baa00d4..5a9e4ce 100644 --- a/0182-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch +++ b/0182-Grub-not-working-correctly-with-btrfs-snapshots-bsc-.patch @@ -1,7 +1,7 @@ -From c7fb2b491daae42caa1395d724b956f6f2f892af Mon Sep 17 00:00:00 2001 +From 0155b776ecb917863e1f8d842ff39cdaf56e9131 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 11 May 2017 08:56:57 +0000 -Subject: [PATCH 182/198] Grub not working correctly with btrfs snapshots +Subject: [PATCH 182/206] Grub not working correctly with btrfs snapshots (bsc#1026511) --- @@ -9,7 +9,7 @@ Subject: [PATCH 182/198] Grub not working correctly with btrfs snapshots 1 file changed, 238 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index a5c000805..3cd947219 100644 +index a5c000805a7..3cd9472197c 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -2446,6 +2446,238 @@ out: @@ -272,5 +272,5 @@ index a5c000805..3cd947219 100644 subvol_set_env); grub_register_variable_hook ("btrfs_subvolid", subvolid_get_env, -- -2.14.3 +2.15.0 diff --git a/0183-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch b/0183-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch index 6820852..7312ce2 100644 --- a/0183-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch +++ b/0183-Add-grub_efi_allocate_pool-and-grub_efi_free_pool-wr.patch @@ -1,7 +1,7 @@ -From ac370b7bd9060c8e2aaaf91c2099ca89b8b65f14 Mon Sep 17 00:00:00 2001 +From 448e9bedfc0b3047ba0ef584c3f1ecffb986ea62 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 09:59:56 -0400 -Subject: [PATCH 183/198] Add grub_efi_allocate_pool() and grub_efi_free_pool() +Subject: [PATCH 183/206] Add grub_efi_allocate_pool() and grub_efi_free_pool() wrappers. Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 91e29ce66..68326d96f 100644 +index 91e29ce66f1..68326d96f5a 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -24,6 +24,10 @@ @@ -71,5 +71,5 @@ index 91e29ce66..68326d96f 100644 struct grub_net_card; -- -2.14.3 +2.15.0 diff --git a/0184-Use-grub_efi_.-memory-helpers-where-reasonable.patch b/0184-Use-grub_efi_.-memory-helpers-where-reasonable.patch index f25a358..e527daa 100644 --- a/0184-Use-grub_efi_.-memory-helpers-where-reasonable.patch +++ b/0184-Use-grub_efi_.-memory-helpers-where-reasonable.patch @@ -1,7 +1,7 @@ -From 81550ebac8fea549c1bbc149688be17ce195bc08 Mon Sep 17 00:00:00 2001 +From 5d867f35242d3a4efd97bf6466309ab3172794ff Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 10:06:38 -0400 -Subject: [PATCH 184/198] Use grub_efi_...() memory helpers where reasonable. +Subject: [PATCH 184/206] Use grub_efi_...() memory helpers where reasonable. This uses grub_efi_allocate_pool(), grub_efi_free_pool(), and grub_efi_free_pages() instead of open-coded efi_call_N() calls, so we @@ -13,7 +13,7 @@ Signed-off-by: Peter Jones 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 7826e794a..d2557b38d 100644 +index 7826e794ad9..d2557b38dce 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -65,7 +65,7 @@ grub_chainloader_unload (void) @@ -105,5 +105,5 @@ index 7826e794a..d2557b38d 100644 if (cmdline) grub_free (cmdline); -- -2.14.3 +2.15.0 diff --git a/0185-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch b/0185-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch index ba5df43..a3cdcba 100644 --- a/0185-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch +++ b/0185-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch @@ -1,7 +1,7 @@ -From ab3ef81acf4ee5cdf7a1e21db794cdb2e71c49a5 Mon Sep 17 00:00:00 2001 +From c7b270e4214ef01f84c56411b388162f40f15b59 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 1 Jun 2017 10:07:50 -0400 -Subject: [PATCH 185/198] Add PRIxGRUB_EFI_STATUS and use it. +Subject: [PATCH 185/206] Add PRIxGRUB_EFI_STATUS and use it. This avoids syntax checkers getting confused about if it's llx or lx. @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index d2557b38d..2c62faa29 100644 +index d2557b38dce..2c62faa2943 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -783,7 +783,8 @@ handle_image (void *data, grub_efi_uint32_t datasize) @@ -26,7 +26,7 @@ index d2557b38d..2c62faa29 100644 efi_status = grub_efi_free_pool (buffer); diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 02488ec35..ddc5ecfb0 100644 +index 02488ec35ae..ddc5ecfb03d 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -527,6 +527,14 @@ typedef grub_uint8_t grub_efi_char8_t; @@ -45,5 +45,5 @@ index 02488ec35..ddc5ecfb0 100644 #define GRUB_EFI_ERROR_CODE(value) \ ((((grub_efi_status_t) 1) << (sizeof (grub_efi_status_t) * 8 - 1)) | (value)) -- -2.14.3 +2.15.0 diff --git a/0186-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch b/0186-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch index a781cdf..2ea6332 100644 --- a/0186-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch +++ b/0186-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch @@ -1,7 +1,7 @@ -From 8bda2ce6ce3a91a0d84b0489679522add72780ef Mon Sep 17 00:00:00 2001 +From 9430a7f210803daaef67f9dd113a4217292e42da Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:42:57 -0400 -Subject: [PATCH 186/198] Don't use dynamic sized arrays since we don't build +Subject: [PATCH 186/206] Don't use dynamic sized arrays since we don't build with -std=c99 --- @@ -9,7 +9,7 @@ Subject: [PATCH 186/198] Don't use dynamic sized arrays since we don't build 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 4be228d95..fa3e29126 100644 +index 4be228d9576..fa3e2912643 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1853,14 +1853,25 @@ grub_net_search_configfile (char *config) @@ -42,5 +42,5 @@ index 4be228d95..fa3e29126 100644 { grub_strcpy (suffix, client_uuid); -- -2.14.3 +2.15.0 diff --git a/0187-don-t-ignore-const.patch b/0187-don-t-ignore-const.patch index 070f8e9..65aa155 100644 --- a/0187-don-t-ignore-const.patch +++ b/0187-don-t-ignore-const.patch @@ -1,14 +1,14 @@ -From 47309830cd0c84bbb565004bd06d5aef3c9c0f57 Mon Sep 17 00:00:00 2001 +From 99eebaec7e4c79bae548385de3892af23c28c6ca Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:43:22 -0400 -Subject: [PATCH 187/198] don't ignore const +Subject: [PATCH 187/206] don't ignore const --- grub-core/net/tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index dcd824943..f90071353 100644 +index dcd82494309..f90071353ad 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -307,7 +307,7 @@ static void @@ -21,5 +21,5 @@ index dcd824943..f90071353 100644 while (*src != '\0') { -- -2.14.3 +2.15.0 diff --git a/0188-don-t-use-int-for-efi-status.patch b/0188-don-t-use-int-for-efi-status.patch index 4a3514e..9b65887 100644 --- a/0188-don-t-use-int-for-efi-status.patch +++ b/0188-don-t-use-int-for-efi-status.patch @@ -1,14 +1,14 @@ -From 1e16b840df6b6d1cfb3429fbac8440b507ff07a6 Mon Sep 17 00:00:00 2001 +From fad5bdf5359d1f3e2ad962cc3fe0e15d26a3df6a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:44:59 -0400 -Subject: [PATCH 188/198] don't use int for efi status +Subject: [PATCH 188/206] don't use int for efi status --- grub-core/kern/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 1f3ac5e1d..2b60a6e27 100644 +index 1f3ac5e1d08..2b60a6e27ea 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -157,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) @@ -21,5 +21,5 @@ index 1f3ac5e1d..2b60a6e27 100644 if (retval == 0) rc = GRUB_EFI_SUCCESS; -- -2.14.3 +2.15.0 diff --git a/0189-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch b/0189-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch index 8e6aece..001dfd9 100644 --- a/0189-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch +++ b/0189-make-GRUB_MOD_INIT-declare-its-function-prototypes.patch @@ -1,14 +1,14 @@ -From 9e5389a4074b38ef9d27177b40092fca515b2d2b Mon Sep 17 00:00:00 2001 +From cc0a1afb1d30df68168c48968fb13134d897d561 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:46:23 -0400 -Subject: [PATCH 189/198] make GRUB_MOD_INIT() declare its function prototypes. +Subject: [PATCH 189/206] make GRUB_MOD_INIT() declare its function prototypes. --- include/grub/dl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/grub/dl.h b/include/grub/dl.h -index 2bca56ce0..b1ed3c333 100644 +index 2bca56ce0e8..b1ed3c33317 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -54,6 +54,7 @@ grub_mod_fini (void) @@ -28,5 +28,5 @@ index 2bca56ce0..b1ed3c333 100644 grub_##name##_fini (void) { grub_mod_fini (); } \ static void \ -- -2.14.3 +2.15.0 diff --git a/0190-Clean-up-some-errors-in-the-linuxefi-loader.patch b/0190-Clean-up-some-errors-in-the-linuxefi-loader.patch index 6a80da7..8565027 100644 --- a/0190-Clean-up-some-errors-in-the-linuxefi-loader.patch +++ b/0190-Clean-up-some-errors-in-the-linuxefi-loader.patch @@ -1,7 +1,7 @@ -From 1351ba7ec388e9449b209c76fad61e6b9792044e Mon Sep 17 00:00:00 2001 +From 819eceb4c94e8463f4d2edb381a04bf0020d68a9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 24 May 2017 15:58:18 -0400 -Subject: [PATCH 190/198] Clean up some errors in the linuxefi loader +Subject: [PATCH 190/206] Clean up some errors in the linuxefi loader Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index bed5919ca..6db5d0bf3 100644 +index bed5919cab3..6db5d0bf3a0 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -161,8 +161,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -65,5 +65,5 @@ index bed5919ca..6db5d0bf3 100644 linux_cmdline, BYTES_TO_PAGES(lh->cmdline_size + 1)); -- -2.14.3 +2.15.0 diff --git a/0191-editenv-handle-relative-symlinks.patch b/0191-editenv-handle-relative-symlinks.patch index fefaa39..4fd872b 100644 --- a/0191-editenv-handle-relative-symlinks.patch +++ b/0191-editenv-handle-relative-symlinks.patch @@ -1,7 +1,7 @@ -From 9141af91bed0d27afa0f87ed6ac5965bed6f791a Mon Sep 17 00:00:00 2001 +From 4233b690a911f16f6da04cd8f3fffbe114c369b9 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 14 Aug 2017 14:37:20 -0400 -Subject: [PATCH 191/198] editenv: handle relative symlinks +Subject: [PATCH 191/206] editenv: handle relative symlinks Handle symlinks with targets relative to the containing dir. This ensures that the rename operation does not depend on the cwd. @@ -14,7 +14,7 @@ Signed-off-by: Jonathan Lebon 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/util/editenv.c b/util/editenv.c -index d8d1dad6a..41bc7cb1c 100644 +index d8d1dad6ab9..41bc7cb1c9a 100644 --- a/util/editenv.c +++ b/util/editenv.c @@ -28,6 +28,7 @@ @@ -49,5 +49,5 @@ index d8d1dad6a..41bc7cb1c 100644 int rc = grub_util_rename (namenew, rename_target); -- -2.14.3 +2.15.0 diff --git a/0192-Make-libgrub.pp-depend-on-config-util.h.patch b/0192-Make-libgrub.pp-depend-on-config-util.h.patch index eb789c1..053ec0f 100644 --- a/0192-Make-libgrub.pp-depend-on-config-util.h.patch +++ b/0192-Make-libgrub.pp-depend-on-config-util.h.patch @@ -1,7 +1,7 @@ -From 210eb8d06d2b1db324ef0e158000c4590035fea3 Mon Sep 17 00:00:00 2001 +From 8a140f441ad2b3901757ce5500d043cd45d04c23 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 23 Aug 2017 10:37:27 -0400 -Subject: [PATCH 192/198] Make libgrub.pp depend on config-util.h +Subject: [PATCH 192/206] Make libgrub.pp depend on config-util.h If you build with "make -j48" a lot, sometimes you see: @@ -31,7 +31,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am -index 7795baeb6..c7b0e6a9c 100644 +index 7795baeb654..c7b0e6a9c46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,7 +37,7 @@ grub_script.yy.c: grub_script.yy.h @@ -44,5 +44,5 @@ index 7795baeb6..c7b0e6a9c 100644 -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) CLEANFILES += libgrub.pp -- -2.14.3 +2.15.0 diff --git a/0193-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch b/0193-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch index 3232070..17b1d8d 100644 --- a/0193-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch +++ b/0193-Don-t-guess-boot-efi-as-HFS-on-ppc-machines-in-grub-.patch @@ -1,7 +1,7 @@ -From d47f8b7d1d9bf708cfd989d20cc0fd87ba72c058 Mon Sep 17 00:00:00 2001 +From 89ed2838bec91a26f6797702e637e48737c4fb0f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 20 Apr 2017 13:29:06 -0400 -Subject: [PATCH 193/198] Don't guess /boot/efi/ as HFS+ on ppc machines in +Subject: [PATCH 193/206] Don't guess /boot/efi/ as HFS+ on ppc machines in grub-install This should never be trying this, and since we've consolidated the @@ -16,7 +16,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/util/grub-install.c b/util/grub-install.c -index cd84a72b9..48f2abc3e 100644 +index cd84a72b97b..48f2abc3ea5 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1159,18 +1159,8 @@ main (int argc, char *argv[]) @@ -40,5 +40,5 @@ index cd84a72b9..48f2abc3e 100644 { free (d); -- -2.14.3 +2.15.0 diff --git a/0194-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch b/0194-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch index 5fd55b4..5a91c41 100644 --- a/0194-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch +++ b/0194-Fix-util-grub.d-20_linux_xen.in-Add-xen_boot-command.patch @@ -1,7 +1,7 @@ -From 40e6d913ad65d357a13205d3392f613ac52508c2 Mon Sep 17 00:00:00 2001 +From a39fb79b9424d5390b3940676ed441199c419048 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 28 Aug 2017 13:51:14 -0400 -Subject: [PATCH 194/198] Fix util/grub.d/20_linux_xen.in: Add xen_boot command +Subject: [PATCH 194/206] Fix util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 Commit d33045ce7ffcb7c1e4a60c14d5ca64b36e3c5abe introduced @@ -36,7 +36,7 @@ Signed-off-by: Konrad Rzeszutek Wilk 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 462f8e1f8..9b1bd7169 100644 +index 462f8e1f819..9b1bd716965 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -210,13 +210,12 @@ while [ "x${xen_list}" != "x" ] ; do @@ -58,5 +58,5 @@ index 462f8e1f8..9b1bd7169 100644 while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` -- -2.14.3 +2.15.0 diff --git a/0195-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch b/0195-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch index d5ac442..c806e56 100644 --- a/0195-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch +++ b/0195-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch @@ -1,7 +1,7 @@ -From ac0fa764dfdd5e45ccda6f91c6e136e84e284c4a Mon Sep 17 00:00:00 2001 +From 940c62edc168e3b7715b04a30c0bd8a1a423c5e1 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 28 Aug 2017 13:59:12 -0400 -Subject: [PATCH 195/198] Use grub-file to figure out whether multiboot2 should +Subject: [PATCH 195/206] Use grub-file to figure out whether multiboot2 should be used for Xen.gz The multiboot2 is much more preferable than multiboot. Especiall @@ -14,7 +14,7 @@ Signed-off-by: Konrad Rzeszutek Wilk 1 file changed, 4 insertions(+) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 9b1bd7169..fae1ffe94 100644 +index 9b1bd716965..fae1ffe9494 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -216,6 +216,10 @@ while [ "x${xen_list}" != "x" ] ; do @@ -29,5 +29,5 @@ index 9b1bd7169..fae1ffe94 100644 while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` -- -2.14.3 +2.15.0 diff --git a/0196-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch b/0196-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch index 8a63c9c..d032a77 100644 --- a/0196-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch +++ b/0196-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch @@ -1,7 +1,7 @@ -From b0260d2f586390b19294f5b98194c9e78a33ccad Mon Sep 17 00:00:00 2001 +From 58884ecfeb0304a0495e0f312b5f5b878ec9c94c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 19 Oct 2017 11:29:11 -0400 -Subject: [PATCH 196/198] 20_linux_xen: load xen or multiboot{,2} modules as +Subject: [PATCH 196/206] 20_linux_xen: load xen or multiboot{,2} modules as needed. Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 3 insertions(+) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index fae1ffe94..fc53bd542 100644 +index fae1ffe9494..fc53bd54231 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -126,6 +126,8 @@ linux_entry () @@ -31,5 +31,5 @@ index fae1ffe94..fc53bd542 100644 EOF fi -- -2.14.3 +2.15.0 diff --git a/0197-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch b/0197-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch index 06448a5..efa1360 100644 --- a/0197-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch +++ b/0197-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch @@ -1,7 +1,7 @@ -From 5b1b2603175923e8d1eac701308d220ac39ad8c7 Mon Sep 17 00:00:00 2001 +From 5ccff1d133f501355b03fb756f859ccde07b5e5c Mon Sep 17 00:00:00 2001 From: "David E. Box" Date: Fri, 15 Sep 2017 15:37:05 -0700 -Subject: [PATCH 197/198] tsc: Change default tsc calibration method to pmtimer +Subject: [PATCH 197/206] tsc: Change default tsc calibration method to pmtimer on EFI systems On efi systems, make pmtimer based tsc calibration the default over the @@ -15,7 +15,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c -index 2e85289d8..f266eb131 100644 +index 2e85289d848..f266eb13185 100644 --- a/grub-core/kern/i386/tsc.c +++ b/grub-core/kern/i386/tsc.c @@ -68,7 +68,7 @@ grub_tsc_init (void) @@ -28,5 +28,5 @@ index 2e85289d8..f266eb131 100644 (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); #else -- -2.14.3 +2.15.0 diff --git a/0198-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch b/0198-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch index dda5727..bb5fc4e 100644 --- a/0198-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch +++ b/0198-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch @@ -1,7 +1,7 @@ -From 8df97294d653219ad03ac031c01b723ed7f6556d Mon Sep 17 00:00:00 2001 +From af98540752f32d95b565f856b15b4655b04e5cfc Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 7 Nov 2017 17:12:17 -0500 -Subject: [PATCH 198/198] Make pmtimer tsc calibration not take 51 seconds to +Subject: [PATCH 198/206] Make pmtimer tsc calibration not take 51 seconds to fail. On my laptop running at 2.4GHz, if I run a VM where tsc calibration @@ -10,7 +10,7 @@ to do so (as measured with the stopwatch on my phone), with a tsc delta of 0x1cd1c85300, or around 125 billion cycles. If instead of trying to wait for 5-200ms to show up on the pmtimer, we try -to wait for 5-200us, it decides it's broken in ~0x7998f9e TSCs, aka ~2 +to wait for 5-200us, it decides it's broken in ~0x2626aa0 TSCs, aka ~2.4 million cycles, or more or less instantly. Additionally, this reading the pmtimer was returning 0xffffffff anyway, @@ -18,55 +18,130 @@ and that's obviously an invalid return. I've added a check for that and 0 so we don't bother waiting for the test if what we're seeing is dead pins with no response at all. +If "debug" is includes "pmtimer", you will see one of the following +three outcomes. If pmtimer gives all 0 or all 1 bits, you will see: + +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 1 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 2 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 3 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 4 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 5 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 6 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 7 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 8 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 9 +kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 10 +kern/i386/tsc_pmtimer.c:78: timer is broken; giving up. + +This outcome was tested using qemu+kvm with UEFI (OVMF) firmware and +these options: -machine pc-q35-2.10 -cpu Broadwell-noTSX + +If pmtimer gives any other bit patterns but is not actually marching +forward fast enough to use for clock calibration, you will see: + +kern/i386/tsc_pmtimer.c:121: pmtimer delta is 0x0 (1904 iterations) +kern/i386/tsc_pmtimer.c:124: tsc delta is implausible: 0x2626aa0 + +This outcome was tested using grub compiled with GRUB_PMTIMER_IGNORE_BAD_READS +defined (so as not to trip the bad read test) using qemu+kvm with UEFI +(OVMF) firmware, and these options: -machine pc-q35-2.10 -cpu Broadwell-noTSX + +If pmtimer actually works, you'll see something like: + +kern/i386/tsc_pmtimer.c:121: pmtimer delta is 0x0 (1904 iterations) +kern/i386/tsc_pmtimer.c:124: tsc delta is implausible: 0x2626aa0 + +This outcome was tested using qemu+kvm with UEFI (OVMF) firmware, and +these options: -machine pc-i440fx-2.4 -cpu Broadwell-noTSX + +I've also tested this outcome on a real Intel Xeon E3-1275v3 on an Intel +Server Board S1200V3RPS using the SDV.RP.B8 "Release" build here: +https://firmware.intel.com/sites/default/files/UEFIDevKit_S1200RP_vB8.zip + Signed-off-by: Peter Jones --- - grub-core/kern/i386/tsc_pmtimer.c | 43 ++++++++++++++++++++++++++++++--------- - 1 file changed, 33 insertions(+), 10 deletions(-) + grub-core/kern/i386/tsc_pmtimer.c | 109 +++++++++++++++++++++++++++++++------- + 1 file changed, 89 insertions(+), 20 deletions(-) diff --git a/grub-core/kern/i386/tsc_pmtimer.c b/grub-core/kern/i386/tsc_pmtimer.c -index c9c361699..609402b83 100644 +index c9c36169978..ca15c3aacd7 100644 --- a/grub-core/kern/i386/tsc_pmtimer.c +++ b/grub-core/kern/i386/tsc_pmtimer.c -@@ -38,30 +38,53 @@ grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, +@@ -28,40 +28,101 @@ + #include + #include + ++/* ++ * Define GRUB_PMTIMER_IGNORE_BAD_READS if you're trying to test a timer that's ++ * present but doesn't keep time well. ++ */ ++// #define GRUB_PMTIMER_IGNORE_BAD_READS ++ + grub_uint64_t + grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, + grub_uint16_t num_pm_ticks) + { + grub_uint32_t start; +- grub_uint32_t last; +- grub_uint32_t cur, end; ++ grub_uint64_t cur, end; grub_uint64_t start_tsc; grub_uint64_t end_tsc; - int num_iter = 0; +- int num_iter = 0; ++ unsigned int num_iter = 0; ++#ifndef GRUB_PMTIMER_IGNORE_BAD_READS + int bad_reads = 0; ++#endif - start = grub_inl (pmtimer) & 0xffffff; -+ start = grub_inl (pmtimer) & 0x3fff; - last = start; +- last = start; ++ /* ++ * Some timers are 24-bit and some are 32-bit, but it doesn't make much ++ * difference to us. Caring which one we have isn't really worth it since ++ * the low-order digits will give us enough data to calibrate TSC. So just ++ * mask the top-order byte off. ++ */ ++ cur = start = grub_inl (pmtimer) & 0xffffffUL; end = start + num_pm_ticks; start_tsc = grub_get_tsc (); while (1) { - cur = grub_inl (pmtimer) & 0xffffff; -+ cur = grub_inl (pmtimer); +- if (cur < last) +- cur |= 0x1000000; +- num_iter++; ++ cur &= 0xffffffffff000000ULL; ++ cur |= grub_inl (pmtimer) & 0xffffffUL; + -+ /* If we get 10 reads in a row that are obviously dead pins, there's no -+ reason to do this thousands of times. ++ end_tsc = grub_get_tsc(); ++ ++#ifndef GRUB_PMTIMER_IGNORE_BAD_READS ++ /* ++ * If we get 10 reads in a row that are obviously dead pins, there's no ++ * reason to do this thousands of times. + */ -+ if (cur == 0xffffffff || cur == 0) ++ if (cur == 0xffffffUL || cur == 0) + { + bad_reads++; -+ grub_dprintf ("pmtimer", "cur: 0x%08x bad_reads: %d\n", cur, bad_reads); ++ grub_dprintf ("pmtimer", ++ "pmtimer: 0x%"PRIxGRUB_UINT64_T" bad_reads: %d\n", ++ cur, bad_reads); ++ grub_dprintf ("pmtimer", "timer is broken; giving up.\n"); + + if (bad_reads == 10) + return 0; + } -+ else if (bad_reads) -+ bad_reads = 0; ++#endif + -+ cur &= 0x3fff; ++ if (cur < start) ++ cur += 0x1000000; + - if (cur < last) -- cur |= 0x1000000; -+ cur |= 0x4000; - num_iter++; if (cur >= end) { - end_tsc = grub_get_tsc (); -+ grub_dprintf ("pmtimer", "tsc delta is 0x%016lx\n", +- end_tsc = grub_get_tsc (); ++ grub_dprintf ("pmtimer", "pmtimer delta is 0x%"PRIxGRUB_UINT64_T"\n", ++ cur - start); ++ grub_dprintf ("pmtimer", "tsc delta is 0x%"PRIxGRUB_UINT64_T"\n", + end_tsc - start_tsc); return end_tsc - start_tsc; } @@ -74,23 +149,67 @@ index c9c361699..609402b83 100644 - 50000000 TSCs is between 5 ms (10GHz) and 200 ms (250 MHz) - if after this time we still don't have 1 ms on pmtimer, then - pmtimer is broken. -+ /* Check for broken PM timer. 5000 TSCs is between 5us (10GHz) and -+ 200us (250 MHz). If after this time we still don't have 1us on -+ pmtimer, then pmtimer is broken. ++ ++ /* ++ * Check for broken PM timer. 1ms at 10GHz should be 1E+7 TSCs; at ++ * 250MHz it should be 2.5E6. So if after 4E+7 TSCs on a 10GHz machine, ++ * we should have seen pmtimer show 4ms of change (i.e. cur =~ ++ * start+14320); on a 250MHz machine that should be 16ms (start+57280). ++ * If after this a time we still don't have 1ms on pmtimer, then pmtimer ++ * is broken. ++ * ++ * Likewise, if our code is perfectly efficient and introduces no delays ++ * whatsoever, on a 10GHz system we should see a TSC delta of 3580 in ++ * ~3580 iterations. On a 250MHz machine that should be ~900 iterations. ++ * ++ * With those factors in mind, there are two limits here. There's a hard ++ * limit here at 8x our desired pm timer delta, picked as an arbitrarily ++ * large value that's still not a lot of time to humans, because if we ++ * get that far this is either an implausibly fast machine or the pmtimer ++ * is not running. And there's another limit on 4x our 10GHz tsc delta ++ * without seeing cur converge on our target value. */ - if ((num_iter & 0xffffff) == 0 && grub_get_tsc () - start_tsc > 5000000) { - return 0; - } -+ end_tsc = grub_get_tsc(); -+ if ((num_iter & 0x3fff) == 0 && end_tsc - start_tsc > 5000) ++ if ((++num_iter > (grub_uint32_t)num_pm_ticks << 3UL) || ++ end_tsc - start_tsc > 40000000) + { -+ grub_dprintf ("pmtimer", "tsc delta is 0x%016lx\n", ++ grub_dprintf ("pmtimer", ++ "pmtimer delta is 0x%"PRIxGRUB_UINT64_T" (%u iterations)\n", ++ cur - start, num_iter); ++ grub_dprintf ("pmtimer", ++ "tsc delta is implausible: 0x%"PRIxGRUB_UINT64_T"\n", + end_tsc - start_tsc); + return 0; + } } } +@@ -74,12 +135,20 @@ grub_tsc_calibrate_from_pmtimer (void) + + fadt = grub_acpi_find_fadt (); + if (!fadt) +- return 0; ++ { ++ grub_dprintf ("pmtimer", "No FADT found; not using pmtimer.\n"); ++ return 0; ++ } + pmtimer = fadt->pmtimer; + if (!pmtimer) +- return 0; ++ { ++ grub_dprintf ("pmtimer", "FADT does not specify pmtimer; skipping.\n"); ++ return 0; ++ } + +- /* It's 3.579545 MHz clock. Wait 1 ms. */ ++ /* ++ * It's 3.579545 MHz clock. Wait 1 ms. ++ */ + tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer, 3580); + if (tsc_diff == 0) + return 0; -- -2.14.3 +2.15.0 diff --git a/0199-align-struct-efi_variable-better.patch b/0199-align-struct-efi_variable-better.patch new file mode 100644 index 0000000..3cea0b8 --- /dev/null +++ b/0199-align-struct-efi_variable-better.patch @@ -0,0 +1,36 @@ +From c4369d658d7a0f372e7378e119f7a16dc7d93624 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 27 Feb 2018 13:55:35 -0500 +Subject: [PATCH 199/206] align struct efi_variable better... + +--- + include/grub/efiemu/runtime.h | 2 +- + include/grub/types.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h +index 9b6b729f4cc..856774a7c34 100644 +--- a/include/grub/efiemu/runtime.h ++++ b/include/grub/efiemu/runtime.h +@@ -33,5 +33,5 @@ struct efi_variable + grub_uint32_t namelen; + grub_uint32_t size; + grub_efi_uint32_t attributes; +-} GRUB_PACKED; ++} GRUB_PACKED GRUB_ALIGNED(8); + #endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */ +diff --git a/include/grub/types.h b/include/grub/types.h +index b93e4820194..f6a9723971d 100644 +--- a/include/grub/types.h ++++ b/include/grub/types.h +@@ -29,6 +29,7 @@ + #else + #define GRUB_PACKED __attribute__ ((packed)) + #endif ++#define GRUB_ALIGNED(x) __attribute__((aligned (x))) + + #ifdef GRUB_BUILD + # define GRUB_CPU_SIZEOF_VOID_P BUILD_SIZEOF_VOID_P +-- +2.15.0 + diff --git a/0200-Add-quicksort-implementation.patch b/0200-Add-quicksort-implementation.patch new file mode 100644 index 0000000..0b41fac --- /dev/null +++ b/0200-Add-quicksort-implementation.patch @@ -0,0 +1,325 @@ +From 99be2c048e5cc307cc4daa03a7916cc794b1bcc4 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 9 Dec 2016 15:39:47 -0500 +Subject: [PATCH 200/206] Add quicksort implementation + +This will be used to sort the boot menu entries that are read from +the BootLoaderSpec config files. +--- + grub-core/kern/qsort.c | 279 +++++++++++++++++++++++++++++++++++++++++++++++++ + include/grub/misc.h | 15 +++ + 2 files changed, 294 insertions(+) + create mode 100644 grub-core/kern/qsort.c + +diff --git a/grub-core/kern/qsort.c b/grub-core/kern/qsort.c +new file mode 100644 +index 00000000000..7f3fc9ffdae +--- /dev/null ++++ b/grub-core/kern/qsort.c +@@ -0,0 +1,279 @@ ++/* quicksort ++ * This file from the GNU C Library. ++ * Copyright (C) 1991-2016 Free Software Foundation, Inc. ++ * Written by Douglas C. Schmidt (schmidt@ics.uci.edu). ++ * ++ * GRUB -- GRand Unified Bootloader ++ * ++ * 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 . ++ */ ++ ++/* If you consider tuning this algorithm, you should consult first: ++ Engineering a sort function; Jon Bentley and M. Douglas McIlroy; ++ Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993. */ ++ ++#include ++#include ++#include ++ ++#define CHAR_BIT 8 ++ ++/* Byte-wise swap two items of size SIZE. */ ++#define SWAP(a, b, size) \ ++ do \ ++ { \ ++ grub_size_t __size = (size); \ ++ char *__a = (a), *__b = (b); \ ++ do \ ++ { \ ++ char __tmp = *__a; \ ++ *__a++ = *__b; \ ++ *__b++ = __tmp; \ ++ } while (--__size > 0); \ ++ } while (0) ++ ++/* Discontinue quicksort algorithm when partition gets below this size. ++ This particular magic number was chosen to work best on a Sun 4/260. */ ++#define MAX_THRESH 4 ++ ++/* Stack node declarations used to store unfulfilled partition obligations. */ ++typedef struct ++ { ++ char *lo; ++ char *hi; ++ } stack_node; ++ ++/* The next 4 #defines implement a very fast in-line stack abstraction. */ ++/* The stack needs log (total_elements) entries (we could even subtract ++ log(MAX_THRESH)). Since total_elements has type grub_size_t, we get as ++ upper bound for log (total_elements): ++ bits per byte (CHAR_BIT) * sizeof(grub_size_t). */ ++#define STACK_SIZE (CHAR_BIT * sizeof(grub_size_t)) ++#define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top)) ++#define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi))) ++#define STACK_NOT_EMPTY (stack < top) ++ ++ ++/* Order size using quicksort. This implementation incorporates ++ four optimizations discussed in Sedgewick: ++ ++ 1. Non-recursive, using an explicit stack of pointer that store the ++ next array partition to sort. To save time, this maximum amount ++ of space required to store an array of SIZE_MAX is allocated on the ++ stack. Assuming a 32-bit (64 bit) integer for grub_size_t, this needs ++ only 32 * sizeof(stack_node) == 256 bytes (for 64 bit: 1024 bytes). ++ Pretty cheap, actually. ++ ++ 2. Chose the pivot element using a median-of-three decision tree. ++ This reduces the probability of selecting a bad pivot value and ++ eliminates certain extraneous comparisons. ++ ++ 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving ++ insertion sort to order the MAX_THRESH items within each partition. ++ This is a big win, since insertion sort is faster for small, mostly ++ sorted array segments. ++ ++ 4. The larger of the two sub-partitions is always pushed onto the ++ stack first, with the algorithm then concentrating on the ++ smaller partition. This *guarantees* no more than log (total_elems) ++ stack size is needed (actually O(1) in this case)! */ ++ ++void ++grub_qsort (void *const pbase, grub_size_t total_elems, grub_size_t size, ++ grub_compar_d_fn_t cmp, void *arg) ++{ ++ char *base_ptr = (char *) pbase; ++ ++ const grub_size_t max_thresh = MAX_THRESH * size; ++ ++ if (total_elems == 0) ++ /* Avoid lossage with unsigned arithmetic below. */ ++ return; ++ ++ if (total_elems > MAX_THRESH) ++ { ++ char *lo = base_ptr; ++ char *hi = &lo[size * (total_elems - 1)]; ++ stack_node stack[STACK_SIZE]; ++ stack_node *top = stack; ++ ++ PUSH (NULL, NULL); ++ ++ while (STACK_NOT_EMPTY) ++ { ++ char *left_ptr; ++ char *right_ptr; ++ ++ /* Select median value from among LO, MID, and HI. Rearrange ++ LO and HI so the three values are sorted. This lowers the ++ probability of picking a pathological pivot value and ++ skips a comparison for both the LEFT_PTR and RIGHT_PTR in ++ the while loops. */ ++ ++ char *mid = lo + size * ((hi - lo) / size >> 1); ++ ++ if ((*cmp) ((void *) mid, (void *) lo, arg) < 0) ++ SWAP (mid, lo, size); ++ if ((*cmp) ((void *) hi, (void *) mid, arg) < 0) ++ SWAP (mid, hi, size); ++ else ++ goto jump_over; ++ if ((*cmp) ((void *) mid, (void *) lo, arg) < 0) ++ SWAP (mid, lo, size); ++ jump_over:; ++ ++ left_ptr = lo + size; ++ right_ptr = hi - size; ++ ++ /* Here's the famous ``collapse the walls'' section of quicksort. ++ Gotta like those tight inner loops! They are the main reason ++ that this algorithm runs much faster than others. */ ++ do ++ { ++ while ((*cmp) ((void *) left_ptr, (void *) mid, arg) < 0) ++ left_ptr += size; ++ ++ while ((*cmp) ((void *) mid, (void *) right_ptr, arg) < 0) ++ right_ptr -= size; ++ ++ if (left_ptr < right_ptr) ++ { ++ SWAP (left_ptr, right_ptr, size); ++ if (mid == left_ptr) ++ mid = right_ptr; ++ else if (mid == right_ptr) ++ mid = left_ptr; ++ left_ptr += size; ++ right_ptr -= size; ++ } ++ else if (left_ptr == right_ptr) ++ { ++ left_ptr += size; ++ right_ptr -= size; ++ break; ++ } ++ } ++ while (left_ptr <= right_ptr); ++ ++ /* Set up pointers for next iteration. First determine whether ++ left and right partitions are below the threshold size. If so, ++ ignore one or both. Otherwise, push the larger partition's ++ bounds on the stack and continue sorting the smaller one. */ ++ ++ if ((grub_size_t) (right_ptr - lo) <= max_thresh) ++ { ++ if ((grub_size_t) (hi - left_ptr) <= max_thresh) ++ /* Ignore both small partitions. */ ++ POP (lo, hi); ++ else ++ /* Ignore small left partition. */ ++ lo = left_ptr; ++ } ++ else if ((grub_size_t) (hi - left_ptr) <= max_thresh) ++ /* Ignore small right partition. */ ++ hi = right_ptr; ++ else if ((right_ptr - lo) > (hi - left_ptr)) ++ { ++ /* Push larger left partition indices. */ ++ PUSH (lo, right_ptr); ++ lo = left_ptr; ++ } ++ else ++ { ++ /* Push larger right partition indices. */ ++ PUSH (left_ptr, hi); ++ hi = right_ptr; ++ } ++ } ++ } ++ ++ /* Once the BASE_PTR array is partially sorted by quicksort the rest ++ is completely sorted using insertion sort, since this is efficient ++ for partitions below MAX_THRESH size. BASE_PTR points to the beginning ++ of the array to sort, and END_PTR points at the very last element in ++ the array (*not* one beyond it!). */ ++ ++#define min(x, y) ((x) < (y) ? (x) : (y)) ++ ++ { ++ char *const end_ptr = &base_ptr[size * (total_elems - 1)]; ++ char *tmp_ptr = base_ptr; ++ char *thresh = min(end_ptr, base_ptr + max_thresh); ++ char *run_ptr; ++ ++ /* Find smallest element in first threshold and place it at the ++ array's beginning. This is the smallest array element, ++ and the operation speeds up insertion sort's inner loop. */ ++ ++ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) ++ if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0) ++ tmp_ptr = run_ptr; ++ ++ if (tmp_ptr != base_ptr) ++ SWAP (tmp_ptr, base_ptr, size); ++ ++ /* Insertion sort, running from left-hand-side up to right-hand-side. */ ++ ++ run_ptr = base_ptr + size; ++ while ((run_ptr += size) <= end_ptr) ++ { ++ tmp_ptr = run_ptr - size; ++ while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr, arg) < 0) ++ tmp_ptr -= size; ++ ++ tmp_ptr += size; ++ if (tmp_ptr != run_ptr) ++ { ++ char *trav; ++ ++ trav = run_ptr + size; ++ while (--trav >= run_ptr) ++ { ++ char c = *trav; ++ char *hi, *lo; ++ ++ for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) ++ *hi = *lo; ++ *hi = c; ++ } ++ } ++ } ++ } ++} ++ ++void * ++grub_bsearch (const void *key, const void *base, grub_size_t nmemb, grub_size_t size, ++ grub_compar_d_fn_t compar, void *state) ++{ ++ grub_size_t l, u, idx; ++ const void *p; ++ int comparison; ++ ++ l = 0; ++ u = nmemb; ++ while (l < u) ++ { ++ idx = (l + u) / 2; ++ p = (void *) (((const char *) base) + (idx * size)); ++ comparison = (*compar) (key, p, state); ++ if (comparison < 0) ++ u = idx; ++ else if (comparison > 0) ++ l = idx + 1; ++ else ++ return (void *) p; ++ } ++ ++ return NULL; ++} +diff --git a/include/grub/misc.h b/include/grub/misc.h +index 4737da1eaa9..3d55bafd64e 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -506,4 +506,19 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file, + #define grub_max(a, b) (((a) > (b)) ? (a) : (b)) + #define grub_min(a, b) (((a) < (b)) ? (a) : (b)) + ++typedef int (*grub_compar_d_fn_t) (const void *p0, const void *p1, void *state); ++ ++void *EXPORT_FUNC(grub_bsearch) (const void *key, ++ const void *base, ++ grub_size_t nmemb, ++ grub_size_t size, ++ grub_compar_d_fn_t compar, ++ void *state); ++ ++void EXPORT_FUNC(grub_qsort) (void *const pbase, ++ grub_size_t total_elems, ++ grub_size_t size, ++ grub_compar_d_fn_t cmp, ++ void *state); ++ + #endif /* ! GRUB_MISC_HEADER */ +-- +2.15.0 + diff --git a/0201-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch b/0201-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch new file mode 100644 index 0000000..54f488b --- /dev/null +++ b/0201-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch @@ -0,0 +1,1140 @@ +From ae50bd922b174a6cbb513a4cd703a4f8a94aeddb Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 9 Dec 2016 15:40:58 -0500 +Subject: [PATCH 201/206] Add blscfg command support to parse BootLoaderSpec + config fragments + +The BootLoaderSpec (BLS) defines a scheme where different bootloaders can +share a format for boot items and a configuration directory that accepts +these common configurations as drop-in files. + +GRUB2 already has a blscfg modle that can parse the config snippets using +the bls_import command, change it to blscfg and improve the BLS support. +--- + grub-core/Makefile.core.def | 4 +- + grub-core/commands/blscfg.c | 786 ++++++++++++++++++++++++++++++++++++++++--- + grub-core/commands/loadenv.c | 77 +---- + grub-core/commands/loadenv.h | 93 +++++ + include/grub/compiler.h | 2 + + 5 files changed, 830 insertions(+), 132 deletions(-) + create mode 100644 grub-core/commands/loadenv.h + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 3a5d450f3d0..0ca0bdad412 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -129,6 +129,7 @@ kernel = { + common = kern/rescue_parser.c; + common = kern/rescue_reader.c; + common = kern/term.c; ++ common = kern/qsort.c; + + noemu = kern/compiler-rt.c; + noemu = kern/mm.c; +@@ -775,8 +776,7 @@ module = { + module = { + name = blscfg; + common = commands/blscfg.c; +- enable = i386_efi; +- enable = x86_64_efi; ++ enable = efi; + enable = i386_pc; + }; + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index 4274aca5a9d..87e7d9a4c64 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -30,32 +30,405 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + ++#include "loadenv.h" ++ ++#define GRUB_BLS_CONFIG_PATH "/loader/entries/" ++#define GRUB_BOOT_DEVICE "($root)" + #ifdef GRUB_MACHINE_EFI + #define GRUB_LINUX_CMD "linuxefi" + #define GRUB_INITRD_CMD "initrdefi" +-#define GRUB_BLS_CONFIG_PATH "/EFI/fedora/loader/entries/" +-#define GRUB_BOOT_DEVICE "($boot)" + #else + #define GRUB_LINUX_CMD "linux" + #define GRUB_INITRD_CMD "initrd" +-#define GRUB_BLS_CONFIG_PATH "/loader/entries/" +-#define GRUB_BOOT_DEVICE "($root)" + #endif + +-static int parse_entry ( ++#define grub_free(x) ({grub_dprintf("blscfg", "%s freeing %p\n", __func__, x); grub_free(x); }) ++ ++struct keyval ++{ ++ const char *key; ++ char *val; ++}; ++ ++struct bls_entry ++{ ++ struct keyval **keyvals; ++ int nkeyvals; ++}; ++ ++static struct bls_entry **entries; ++static int nentries; ++ ++static struct bls_entry *bls_new_entry(void) ++{ ++ struct bls_entry **new_entries; ++ struct bls_entry *entry; ++ int new_n = nentries + 1; ++ ++ new_entries = grub_realloc (entries, new_n * sizeof (struct bls_entry *)); ++ if (!new_entries) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry list"); ++ return NULL; ++ } ++ ++ entries = new_entries; ++ ++ entry = grub_malloc (sizeof (*entry)); ++ if (!entry) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry list"); ++ return NULL; ++ } ++ ++ grub_memset (entry, 0, sizeof (*entry)); ++ entries[nentries] = entry; ++ ++ nentries = new_n; ++ ++ return entry; ++} ++ ++static int bls_add_keyval(struct bls_entry *entry, char *key, char *val) ++{ ++ char *k, *v; ++ struct keyval **kvs, *kv; ++ int new_n = entry->nkeyvals + 1; ++ ++ kvs = grub_realloc (entry->keyvals, new_n * sizeof (struct keyval *)); ++ if (!kvs) ++ return grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry"); ++ entry->keyvals = kvs; ++ ++ kv = grub_malloc (sizeof (struct keyval)); ++ if (!kv) ++ return grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry"); ++ ++ k = grub_strdup (key); ++ if (!k) ++ { ++ grub_free (kv); ++ return grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry"); ++ } ++ ++ v = grub_strdup (val); ++ if (!v) ++ { ++ grub_free (k); ++ grub_free (kv); ++ return grub_error (GRUB_ERR_OUT_OF_MEMORY, ++ "couldn't find space for BLS entry"); ++ } ++ ++ kv->key = k; ++ kv->val = v; ++ ++ entry->keyvals[entry->nkeyvals] = kv; ++ grub_dprintf("blscfg", "new keyval at %p:%p:%p\n", entry->keyvals[entry->nkeyvals], k, v); ++ entry->nkeyvals = new_n; ++ ++ return 0; ++} ++ ++static void bls_free_entry(struct bls_entry *entry) ++{ ++ int i; ++ ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ for (i = 0; i < entry->nkeyvals; i++) ++ { ++ struct keyval *kv = entry->keyvals[i]; ++ grub_free ((void *)kv->key); ++ grub_free (kv->val); ++ grub_free (kv); ++ } ++ ++ grub_free (entry->keyvals); ++ grub_memset (entry, 0, sizeof (*entry)); ++ grub_free (entry); ++} ++ ++static int keyval_cmp (const void *p0, const void *p1, ++ void *state UNUSED) ++{ ++ const struct keyval *kv0 = *(struct keyval * const *)p0; ++ const struct keyval *kv1 = *(struct keyval * const *)p1; ++ int rc; ++ ++ rc = grub_strcmp(kv0->key, kv1->key); ++ ++ return rc; ++} ++ ++/* Find they value of the key named by keyname. If there are allowed to be ++ * more than one, pass a pointer to an int set to -1 the first time, and pass ++ * the same pointer through each time after, and it'll return them in sorted ++ * order. */ ++static char *bls_get_val(struct bls_entry *entry, const char *keyname, int *last) ++{ ++ char *foo = (char *)""; ++ struct keyval *kv = NULL, **kvp, key = {keyname, foo}, *keyp = &key; ++ ++ /* if we've already found an entry that matches, just iterate */ ++ if (last && *last >= 0) ++ { ++ int next = ++last[0]; ++ ++ if (next == entry->nkeyvals) ++ { ++done: ++ *last = -1; ++ return NULL; ++ } ++ ++ kv = entry->keyvals[next]; ++ if (grub_strcmp (keyname, kv->key)) ++ goto done; ++ ++ return kv->val; ++ } ++ ++ kvp = grub_bsearch(&keyp, &entry->keyvals[0], entry->nkeyvals, ++ sizeof (struct keyval *), keyval_cmp, NULL); ++ if (kvp) ++ kv = *kvp; ++ ++ if (kv) ++ { ++ /* if we've got uninitialized but present state, track back until we find ++ * the first match */ ++ if (last) ++ { ++ grub_dprintf("blscfg", "%s trying to find another entry because last was set\n", __func__); ++ /* figure out the position of this entry in the array */ ++ int idx; ++ for (idx = 0 ; idx < entry->nkeyvals; idx++) ++ if (entry->keyvals[idx] == kv) ++ break; ++ *last = idx; ++ ++ while (idx > 0) ++ { ++ struct keyval *kvtmp = entry->keyvals[idx-1]; ++ if (idx == 0 || grub_strcmp (keyname, kvtmp->key)) ++ { ++ /* if we're at the start, or if the previous entry doesn't ++ * match, then we're done */ ++ *last = idx; ++ break; ++ } ++ else ++ /* but if it does match, keep going backwards */ ++ idx--; ++ } ++ } ++ ++ return kv->val; ++ } ++ return NULL; ++} ++ ++#define goto_return(x) ({ ret = (x); goto finish; }) ++ ++/* compare alpha and numeric segments of two versions */ ++/* return 1: a is newer than b */ ++/* 0: a and b are the same version */ ++/* -1: b is newer than a */ ++static int vercmp(const char * a, const char * b) ++{ ++ char oldch1, oldch2; ++ char *abuf, *bbuf; ++ char *str1, *str2; ++ char * one, * two; ++ int rc; ++ int isnum; ++ int ret = 0; ++ ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ if (!grub_strcmp(a, b)) ++ return 0; ++ ++ abuf = grub_malloc(grub_strlen(a) + 1); ++ bbuf = grub_malloc(grub_strlen(b) + 1); ++ str1 = abuf; ++ str2 = bbuf; ++ grub_strcpy(str1, a); ++ grub_strcpy(str2, b); ++ ++ one = str1; ++ two = str2; ++ ++ /* loop through each version segment of str1 and str2 and compare them */ ++ while (*one || *two) { ++ while (*one && !grub_isalnum(*one) && *one != '~') one++; ++ while (*two && !grub_isalnum(*two) && *two != '~') two++; ++ ++ /* handle the tilde separator, it sorts before everything else */ ++ if (*one == '~' || *two == '~') { ++ if (*one != '~') goto_return (1); ++ if (*two != '~') goto_return (-1); ++ one++; ++ two++; ++ continue; ++ } ++ ++ /* If we ran to the end of either, we are finished with the loop */ ++ if (!(*one && *two)) break; ++ ++ str1 = one; ++ str2 = two; ++ ++ /* grab first completely alpha or completely numeric segment */ ++ /* leave one and two pointing to the start of the alpha or numeric */ ++ /* segment and walk str1 and str2 to end of segment */ ++ if (grub_isdigit(*str1)) { ++ while (*str1 && grub_isdigit(*str1)) str1++; ++ while (*str2 && grub_isdigit(*str2)) str2++; ++ isnum = 1; ++ } else { ++ while (*str1 && grub_isalpha(*str1)) str1++; ++ while (*str2 && grub_isalpha(*str2)) str2++; ++ isnum = 0; ++ } ++ ++ /* save character at the end of the alpha or numeric segment */ ++ /* so that they can be restored after the comparison */ ++ oldch1 = *str1; ++ *str1 = '\0'; ++ oldch2 = *str2; ++ *str2 = '\0'; ++ ++ /* this cannot happen, as we previously tested to make sure that */ ++ /* the first string has a non-null segment */ ++ if (one == str1) goto_return(-1); /* arbitrary */ ++ ++ /* take care of the case where the two version segments are */ ++ /* different types: one numeric, the other alpha (i.e. empty) */ ++ /* numeric segments are always newer than alpha segments */ ++ /* XXX See patch #60884 (and details) from bugzilla #50977. */ ++ if (two == str2) goto_return (isnum ? 1 : -1); ++ ++ if (isnum) { ++ grub_size_t onelen, twolen; ++ /* this used to be done by converting the digit segments */ ++ /* to ints using atoi() - it's changed because long */ ++ /* digit segments can overflow an int - this should fix that. */ ++ ++ /* throw away any leading zeros - it's a number, right? */ ++ while (*one == '0') one++; ++ while (*two == '0') two++; ++ ++ /* whichever number has more digits wins */ ++ onelen = grub_strlen(one); ++ twolen = grub_strlen(two); ++ if (onelen > twolen) goto_return (1); ++ if (twolen > onelen) goto_return (-1); ++ } ++ ++ /* grub_strcmp will return which one is greater - even if the two */ ++ /* segments are alpha or if they are numeric. don't return */ ++ /* if they are equal because there might be more segments to */ ++ /* compare */ ++ rc = grub_strcmp(one, two); ++ if (rc) goto_return (rc < 1 ? -1 : 1); ++ ++ /* restore character that was replaced by null above */ ++ *str1 = oldch1; ++ one = str1; ++ *str2 = oldch2; ++ two = str2; ++ } ++ ++ /* this catches the case where all numeric and alpha segments have */ ++ /* compared identically but the segment sepparating characters were */ ++ /* different */ ++ if ((!*one) && (!*two)) goto_return (0); ++ ++ /* whichever version still has characters left over wins */ ++ if (!*one) goto_return (-1); else goto_return (1); ++ ++finish: ++ grub_free (abuf); ++ grub_free (bbuf); ++ return ret; ++} ++ ++typedef int (*void_cmp_t)(void *, void *); ++ ++static int nulcmp(char *s0, char *s1, void_cmp_t cmp) ++{ ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ if (s1 && !s0) ++ return 1; ++ if (s0 && !s1) ++ return -1; ++ if (!s0 && !s1) ++ return 0; ++ if (cmp) ++ return cmp(s0, s1); ++ return grub_strcmp(s0, s1); ++} ++ ++static int ++bls_keyval_cmp(struct bls_entry *e0, struct bls_entry *e1, const char *keyname) ++{ ++ char *val0, *val1; ++ ++ val0 = bls_get_val (e0, keyname, NULL); ++ val1 = bls_get_val (e1, keyname, NULL); ++ ++ if (val1 && !val0) ++ return 1; ++ ++ if (val0 && !val1) ++ return -1; ++ ++ if (!val0 && !val1) ++ return 0; ++ ++ return nulcmp(val0, val1, (void_cmp_t)vercmp); ++} ++ ++static int bls_cmp(const void *p0, const void *p1, void *state UNUSED) ++{ ++ struct bls_entry * e0 = *(struct bls_entry **)p0; ++ struct bls_entry * e1 = *(struct bls_entry **)p1; ++ int rc = 0; ++ ++ rc = bls_keyval_cmp (e0, e1, "id"); ++ ++ if (rc == 0) ++ rc = bls_keyval_cmp (e0, e1, "title"); ++ ++ if (rc == 0) ++ rc = bls_keyval_cmp (e0, e1, "linux"); ++ ++ return rc; ++} ++ ++static int read_entry ( + const char *filename, +- const struct grub_dirhook_info *info __attribute__ ((unused)), +- void *data __attribute__ ((unused))) ++ const struct grub_dirhook_info *info UNUSED, ++ void *data) + { + grub_size_t n; + char *p; + grub_file_t f = NULL; + grub_off_t sz; +- char *title = NULL, *options = NULL, *clinux = NULL, *initrd = NULL, *src = NULL; +- const char *args[2] = { NULL, NULL }; ++ struct bls_entry *entry; ++ const char *dirname= (const char *)data; ++ const char *devid = grub_env_get ("boot"); ++ ++ grub_dprintf ("blscfg", "filename: \"%s\"\n", filename); + + if (filename[0] == '.') + return 0; +@@ -67,7 +440,7 @@ static int parse_entry ( + if (grub_strcmp (filename + n - 5, ".conf") != 0) + return 0; + +- p = grub_xasprintf (GRUB_BLS_CONFIG_PATH "%s", filename); ++ p = grub_xasprintf ("(%s)%s/%s", devid, dirname, filename); + + f = grub_file_open (p); + if (!f) +@@ -77,54 +450,169 @@ static int parse_entry ( + if (sz == GRUB_FILE_SIZE_UNKNOWN || sz > 1024*1024) + goto finish; + ++ entry = bls_new_entry(); ++ if (!entry) ++ goto finish; ++ + for (;;) + { + char *buf; ++ char *separator; ++ int rc; + + buf = grub_file_getline (f); + if (!buf) + break; + +- if (grub_strncmp (buf, "title ", 6) == 0) +- { +- grub_free (title); +- title = grub_strdup (buf + 6); +- if (!title) +- goto finish; +- } +- else if (grub_strncmp (buf, "options ", 8) == 0) +- { +- grub_free (options); +- options = grub_strdup (buf + 8); +- if (!options) +- goto finish; +- } +- else if (grub_strncmp (buf, "linux ", 6) == 0) +- { +- grub_free (clinux); +- clinux = grub_strdup (buf + 6); +- if (!clinux) +- goto finish; +- } +- else if (grub_strncmp (buf, "initrd ", 7) == 0) ++ while (buf && buf[0] && (buf[0] == ' ' || buf[0] == '\t')) ++ buf++; ++ if (buf[0] == '#') ++ continue; ++ ++ separator = grub_strchr (buf, ' '); ++ ++ if (!separator) ++ separator = grub_strchr (buf, '\t'); ++ ++ if (!separator || separator[1] == '\0') + { +- grub_free (initrd); +- initrd = grub_strdup (buf + 7); +- if (!initrd) +- goto finish; ++ grub_free (buf); ++ break; + } + +- grub_free(buf); ++ separator[0] = '\0'; ++ ++ rc = bls_add_keyval (entry, buf, separator+1); ++ grub_free (buf); ++ if (rc < 0) ++ break; ++ } ++ ++ grub_qsort(&entry->keyvals[0], entry->nkeyvals, sizeof (struct keyval *), ++ keyval_cmp, NULL); ++ ++finish: ++ grub_free (p); ++ ++ if (f) ++ grub_file_close (f); ++ ++ return 0; ++} ++ ++static grub_envblk_t saved_env = NULL; ++ ++static int ++save_var (const char *name, const char *value, void *whitelist UNUSED) ++{ ++ const char *val = grub_env_get (name); ++ grub_dprintf("blscfg", "saving \"%s\"\n", name); ++ ++ if (val) ++ grub_envblk_set (saved_env, name, value); ++ ++ return 0; ++} ++ ++static int ++unset_var (const char *name, const char *value UNUSED, void *whitelist) ++{ ++ grub_dprintf("blscfg", "restoring \"%s\"\n", name); ++ if (! whitelist) ++ { ++ grub_env_unset (name); ++ return 0; + } + +- if (!linux) ++ if (test_whitelist_membership (name, ++ (const grub_env_whitelist_t *) whitelist)) ++ grub_env_unset (name); ++ ++ return 0; ++} ++ ++static char **bls_make_list (struct bls_entry *entry, const char *key, int *num) ++{ ++ int last = -1; ++ char *val; ++ ++ int nlist = 0; ++ char **list = NULL; ++ ++ list = grub_malloc (sizeof (char *)); ++ if (!list) ++ return NULL; ++ list[0] = NULL; ++ ++ while (1) ++ { ++ char **new; ++ ++ val = bls_get_val (entry, key, &last); ++ if (!val) ++ break; ++ ++ new = grub_realloc (list, (nlist + 2) * sizeof (char *)); ++ if (!new) ++ break; ++ ++ list = new; ++ list[nlist++] = val; ++ list[nlist] = NULL; ++ } ++ ++ if (num) ++ *num = nlist; ++ ++ return list; ++} ++ ++static void create_entry (struct bls_entry *entry, const char *cfgfile) ++{ ++ int argc = 0; ++ const char **argv = NULL; ++ ++ char *title = NULL; ++ char *clinux = NULL; ++ char *options = NULL; ++ char *initrd = NULL; ++ char *id = NULL; ++ char *hotkey = NULL; ++ ++ char *users = NULL; ++ char **classes = NULL; ++ ++ char **args = NULL; ++ ++ char *src = NULL; ++ int i; ++ ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ clinux = bls_get_val (entry, "linux", NULL); ++ if (!clinux) + { +- grub_printf ("Skipping file %s with no 'linux' key.", p); ++ grub_dprintf ("blscfg", "Skipping file %s with no 'linux' key.\n", cfgfile); + goto finish; + } + +- args[0] = title ? title : filename; ++ title = bls_get_val (entry, "title", NULL); ++ options = bls_get_val (entry, "options", NULL); ++ initrd = bls_get_val (entry, "initrd", NULL); ++ id = bls_get_val (entry, "id", NULL); + ++ hotkey = bls_get_val (entry, "grub_hotkey", NULL); ++ users = bls_get_val (entry, "grub_users", NULL); ++ classes = bls_make_list (entry, "grub_class", NULL); ++ args = bls_make_list (entry, "grub_arg", &argc); ++ ++ argc += 1; ++ argv = grub_malloc ((argc + 1) * sizeof (char *)); ++ argv[0] = title ? title : clinux; ++ for (i = 1; i < argc; i++) ++ argv[i] = args[i-1]; ++ argv[argc] = NULL; ++ ++ grub_dprintf("blscfg", "adding menu entry for \"%s\"\n", title); + src = grub_xasprintf ("load_video\n" + "set gfx_payload=keep\n" + "insmod gzio\n" +@@ -133,40 +621,217 @@ static int parse_entry ( + GRUB_BOOT_DEVICE, clinux, options ? " " : "", options ? options : "", + initrd ? GRUB_INITRD_CMD " " : "", initrd ? GRUB_BOOT_DEVICE : "", initrd ? initrd : "", initrd ? "\n" : ""); + +- grub_normal_add_menu_entry (1, args, NULL, NULL, "bls", NULL, NULL, src, 0); ++ grub_normal_add_menu_entry (argc, argv, classes, id, users, hotkey, NULL, src, 0); + + finish: +- grub_free (p); +- grub_free (title); +- grub_free (options); +- grub_free (clinux); +- grub_free (initrd); +- grub_free (src); ++ if (classes) ++ grub_free (classes); ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ if (args) ++ grub_free (args); ++ ++ if (argv) ++ grub_free (argv); ++ ++ if (src) ++ grub_free (src); ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++} ++ ++struct find_entry_info { ++ grub_device_t dev; ++ grub_fs_t fs; ++ int efi; ++}; ++ ++/* ++ * filename: if the directory is /EFI/something/ , filename is "something" ++ * info: unused ++ * data: the filesystem object the file is on. ++ */ ++static int find_entry (const char *filename, ++ const struct grub_dirhook_info *dirhook_info UNUSED, ++ void *data) ++{ ++ struct find_entry_info *info = (struct find_entry_info *)data; ++ grub_file_t f = NULL; ++ char *grubenv_path = NULL; ++ grub_envblk_t env = NULL; ++ char *default_blsdir = NULL; ++ const char *blsdir = NULL; ++ char *saved_env_buf = NULL; ++ int r = 0; ++ const char *devid = grub_env_get ("boot"); ++ ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ if (!grub_strcmp (filename, ".") || ++ !grub_strcmp (filename, "..")) ++ return 0; ++ ++ if (info->efi && !grub_strcasecmp (filename, "boot")) ++ return 0; ++ ++ saved_env_buf = grub_malloc (512); ++ ++ // set a default blsdir ++ if (info->efi) ++ default_blsdir = grub_xasprintf ("/EFI/%s%s", filename, ++ GRUB_BLS_CONFIG_PATH); ++ else ++ default_blsdir = grub_xasprintf ("%s", GRUB_BLS_CONFIG_PATH); ++ ++ grub_env_set ("blsdir", default_blsdir); ++ grub_dprintf ("blscfg", "default_blsdir: \"%s\"\n", default_blsdir); ++ ++ /* ++ * try to load a grubenv from /EFI/wherever/grubenv ++ */ ++ if (info->efi) ++ grubenv_path = grub_xasprintf ("(%s)/EFI/%s/grubenv", devid, filename); ++ else ++ grubenv_path = grub_xasprintf ("(%s)/grub2/grubenv", devid); ++ ++ grub_dprintf ("blscfg", "looking for \"%s\"\n", grubenv_path); ++ f = grub_file_open (grubenv_path); ++ ++ grub_dprintf ("blscfg", "%s it\n", f ? "found" : "did not find"); ++ grub_free (grubenv_path); ++ if (f) ++ { ++ grub_off_t sz; ++ ++ grub_dprintf ("blscfg", "getting size\n"); ++ sz = grub_file_size (f); ++ if (sz == GRUB_FILE_SIZE_UNKNOWN || sz > 1024*1024) ++ goto finish; ++ ++ grub_dprintf ("blscfg", "reading env\n"); ++ env = read_envblk_file (f); ++ if (!env) ++ goto finish; ++ grub_dprintf ("blscfg", "read env file\n"); ++ ++ grub_memset (saved_env_buf, '#', 512); ++ grub_memcpy (saved_env_buf, GRUB_ENVBLK_SIGNATURE, ++ sizeof (GRUB_ENVBLK_SIGNATURE)); ++ grub_dprintf ("blscfg", "saving env\n"); ++ saved_env = grub_envblk_open (saved_env_buf, 512); ++ if (!saved_env) ++ goto finish; ++ ++ // save everything listed in "env" with values from our existing grub env ++ grub_envblk_iterate (env, NULL, save_var); ++ // set everything from our loaded grubenv into the real grub env ++ grub_envblk_iterate (env, NULL, set_var); ++ } ++ else ++ { ++ grub_err_t e; ++ grub_dprintf ("blscfg", "no such file\n"); ++ do ++ { ++ e = grub_error_pop(); ++ } while (e); ++ ++ } ++ ++ blsdir = grub_env_get ("blsdir"); ++ if (!blsdir) ++ goto finish; ++ ++ grub_dprintf ("blscfg", "blsdir: \"%s\"\n", blsdir); ++ if (blsdir[0] != '/' && info->efi) ++ blsdir = grub_xasprintf ("/EFI/%s/%s/", filename, blsdir); ++ else ++ blsdir = grub_strdup (blsdir); ++ ++ if (!blsdir) ++ goto finish; ++ ++ grub_dprintf ("blscfg", "blsdir: \"%s\"\n", blsdir); ++ r = info->fs->dir (info->dev, blsdir, read_entry, (char *)blsdir); ++ if (r != 0) { ++ grub_dprintf ("blscfg", "read_entry returned error\n"); ++ grub_err_t e; ++ do ++ { ++ e = grub_error_pop(); ++ } while (e); ++ } ++ ++ grub_dprintf ("blscfg", "Sorting %d entries\n", nentries); ++ grub_qsort(&entries[0], nentries, sizeof (struct bls_entry *), bls_cmp, NULL); ++ ++ grub_dprintf ("blscfg", "%s Creating %d entries from bls\n", __func__, nentries); ++ for (r = nentries - 1; r >= 0; r--) ++ create_entry(entries[r], filename); ++ ++ for (r = 0; r < nentries; r++) ++ bls_free_entry (entries[r]); ++finish: ++ nentries = 0; ++ grub_free (entries); ++ ++ grub_free ((char *)blsdir); ++ ++ grub_env_unset ("blsdir"); ++ ++ if (saved_env) ++ { ++ // remove everything from the real environment that's defined in env ++ grub_envblk_iterate (env, NULL, unset_var); ++ ++ // re-set the things from our original environment ++ grub_envblk_iterate (saved_env, NULL, set_var); ++ grub_envblk_close (saved_env); ++ saved_env = NULL; ++ } ++ else if (saved_env_buf) ++ { ++ // if we have a saved environment, grub_envblk_close() freed this. ++ grub_free (saved_env_buf); ++ } ++ ++ if (env) ++ grub_envblk_close (env); + + if (f) + grub_file_close (f); + ++ grub_free (default_blsdir); ++ + return 0; + } + + static grub_err_t +-grub_cmd_bls_import (grub_extcmd_context_t ctxt __attribute__ ((unused)), +- int argc __attribute__ ((unused)), +- char **args __attribute__ ((unused))) ++grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED, ++ int argc UNUSED, ++ char **args UNUSED) + { + grub_fs_t fs; + grub_device_t dev; + static grub_err_t r; + const char *devid; ++ struct find_entry_info info = ++ { ++ .dev = NULL, ++ .fs = NULL, ++ .efi = 0, ++ }; + +- devid = grub_env_get ("root"); ++ ++ grub_dprintf ("blscfg", "finding boot\n"); ++ devid = grub_env_get ("boot"); + if (!devid) +- return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "root"); ++ return grub_error (GRUB_ERR_FILE_NOT_FOUND, ++ N_("variable `%s' isn't set"), "boot"); + ++ grub_dprintf ("blscfg", "opening %s\n", devid); + dev = grub_device_open (devid); + if (!dev) + return grub_errno; + ++ grub_dprintf ("blscfg", "probing fs\n"); + fs = grub_fs_probe (dev); + if (!fs) + { +@@ -174,7 +839,17 @@ grub_cmd_bls_import (grub_extcmd_context_t ctxt __attribute__ ((unused)), + goto finish; + } + +- r = fs->dir (dev, GRUB_BLS_CONFIG_PATH, parse_entry, NULL); ++ info.dev = dev; ++ info.fs = fs; ++#ifdef GRUB_MACHINE_EFI ++ info.efi = 1; ++ grub_dprintf ("blscfg", "scanning /EFI/\n"); ++ r = fs->dir (dev, "/EFI/", find_entry, &info); ++#else ++ info.efi = 0; ++ grub_dprintf ("blscfg", "scanning %s\n", GRUB_BLS_CONFIG_PATH); ++ r = fs->dir (dev, "/", find_entry, &info); ++#endif + + finish: + if (dev) +@@ -187,8 +862,9 @@ static grub_extcmd_t cmd; + + GRUB_MOD_INIT(bls) + { +- cmd = grub_register_extcmd ("bls_import", +- grub_cmd_bls_import, ++ grub_dprintf("blscfg", "%s got here\n", __func__); ++ cmd = grub_register_extcmd ("blscfg", ++ grub_cmd_blscfg, + 0, + NULL, + N_("Import Boot Loader Specification snippets."), +diff --git a/grub-core/commands/loadenv.c b/grub-core/commands/loadenv.c +index acd93d123ed..91c99456091 100644 +--- a/grub-core/commands/loadenv.c ++++ b/grub-core/commands/loadenv.c +@@ -28,6 +28,8 @@ + #include + #include + ++#include "loadenv.h" ++ + GRUB_MOD_LICENSE ("GPLv3+"); + + static const struct grub_arg_option options[] = +@@ -84,81 +86,6 @@ open_envblk_file (char *filename, int untrusted) + return file; + } + +-static grub_envblk_t +-read_envblk_file (grub_file_t file) +-{ +- grub_off_t offset = 0; +- char *buf; +- grub_size_t size = grub_file_size (file); +- grub_envblk_t envblk; +- +- buf = grub_malloc (size); +- if (! buf) +- return 0; +- +- while (size > 0) +- { +- grub_ssize_t ret; +- +- ret = grub_file_read (file, buf + offset, size); +- if (ret <= 0) +- { +- grub_free (buf); +- return 0; +- } +- +- size -= ret; +- offset += ret; +- } +- +- envblk = grub_envblk_open (buf, offset); +- if (! envblk) +- { +- grub_free (buf); +- grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); +- return 0; +- } +- +- return envblk; +-} +- +-struct grub_env_whitelist +-{ +- grub_size_t len; +- char **list; +-}; +-typedef struct grub_env_whitelist grub_env_whitelist_t; +- +-static int +-test_whitelist_membership (const char* name, +- const grub_env_whitelist_t* whitelist) +-{ +- grub_size_t i; +- +- for (i = 0; i < whitelist->len; i++) +- if (grub_strcmp (name, whitelist->list[i]) == 0) +- return 1; /* found it */ +- +- return 0; /* not found */ +-} +- +-/* Helper for grub_cmd_load_env. */ +-static int +-set_var (const char *name, const char *value, void *whitelist) +-{ +- if (! whitelist) +- { +- grub_env_set (name, value); +- return 0; +- } +- +- if (test_whitelist_membership (name, +- (const grub_env_whitelist_t *) whitelist)) +- grub_env_set (name, value); +- +- return 0; +-} +- + static grub_err_t + grub_cmd_load_env (grub_extcmd_context_t ctxt, int argc, char **args) + { +diff --git a/grub-core/commands/loadenv.h b/grub-core/commands/loadenv.h +new file mode 100644 +index 00000000000..952f46121bd +--- /dev/null ++++ b/grub-core/commands/loadenv.h +@@ -0,0 +1,93 @@ ++/* loadenv.c - command to load/save environment variable. */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2008,2009,2010 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++static grub_envblk_t UNUSED ++read_envblk_file (grub_file_t file) ++{ ++ grub_off_t offset = 0; ++ char *buf; ++ grub_size_t size = grub_file_size (file); ++ grub_envblk_t envblk; ++ ++ buf = grub_malloc (size); ++ if (! buf) ++ return 0; ++ ++ while (size > 0) ++ { ++ grub_ssize_t ret; ++ ++ ret = grub_file_read (file, buf + offset, size); ++ if (ret <= 0) ++ { ++ grub_free (buf); ++ return 0; ++ } ++ ++ size -= ret; ++ offset += ret; ++ } ++ ++ envblk = grub_envblk_open (buf, offset); ++ if (! envblk) ++ { ++ grub_free (buf); ++ grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); ++ return 0; ++ } ++ ++ return envblk; ++} ++ ++struct grub_env_whitelist ++{ ++ grub_size_t len; ++ char **list; ++}; ++typedef struct grub_env_whitelist grub_env_whitelist_t; ++ ++static int UNUSED ++test_whitelist_membership (const char* name, ++ const grub_env_whitelist_t* whitelist) ++{ ++ grub_size_t i; ++ ++ for (i = 0; i < whitelist->len; i++) ++ if (grub_strcmp (name, whitelist->list[i]) == 0) ++ return 1; /* found it */ ++ ++ return 0; /* not found */ ++} ++ ++/* Helper for grub_cmd_load_env. */ ++static int UNUSED ++set_var (const char *name, const char *value, void *whitelist) ++{ ++ if (! whitelist) ++ { ++ grub_env_set (name, value); ++ return 0; ++ } ++ ++ if (test_whitelist_membership (name, ++ (const grub_env_whitelist_t *) whitelist)) ++ grub_env_set (name, value); ++ ++ return 0; ++} +diff --git a/include/grub/compiler.h b/include/grub/compiler.h +index c9e1d7a73dc..9859ff4cc79 100644 +--- a/include/grub/compiler.h ++++ b/include/grub/compiler.h +@@ -48,4 +48,6 @@ + # define WARN_UNUSED_RESULT + #endif + ++#define UNUSED __attribute__((__unused__)) ++ + #endif /* ! GRUB_COMPILER_HEADER */ +-- +2.15.0 + diff --git a/0202-Add-BLS-support-to-grub-mkconfig.patch b/0202-Add-BLS-support-to-grub-mkconfig.patch new file mode 100644 index 0000000..99a532a --- /dev/null +++ b/0202-Add-BLS-support-to-grub-mkconfig.patch @@ -0,0 +1,169 @@ +From 3f54a7a23b2d239ccee7e13ee3b699e085f54301 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 9 Dec 2016 15:40:29 -0500 +Subject: [PATCH 202/206] Add BLS support to grub-mkconfig + +GRUB now has BootLoaderSpec support, the user can choose to use this by +setting GRUB_ENABLE_BLSCFG to true in /etc/default/grub. On this setup, +the boot menu entries are not added to the grub.cfg, instead BLS config +files are parsed by blscfg command and the entries created dynamically. +--- + util/grub-mkconfig.in | 3 ++- + util/grub-mkconfig_lib.in | 29 +++++++++++++++++++---------- + util/grub.d/10_linux.in | 36 ++++++++++++++++++++++++++++++++++-- + 3 files changed, 55 insertions(+), 13 deletions(-) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 3b0bfe40308..760fe08727f 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -240,7 +240,8 @@ export GRUB_DEFAULT \ + GRUB_OS_PROBER_SKIP_LIST \ + GRUB_DISABLE_SUBMENU \ + GRUB_DEFAULT_DTB \ +- SUSE_BTRFS_SNAPSHOT_BOOTING ++ SUSE_BTRFS_SNAPSHOT_BOOTING \ ++ GRUB_ENABLE_BLSCFG + + if test "x${grub_cfg}" != "x"; then + rm -f "${grub_cfg}.new" +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 2fb4f4f8143..70dc8d57e92 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -30,6 +30,9 @@ fi + if test "x$grub_file" = x; then + grub_file="${bindir}/@grub_file@" + fi ++if test "x$grub_editenv" = x; then ++ grub_editenv="${bindir}/@grub_editenv@" ++fi + if test "x$grub_mkrelpath" = x; then + grub_mkrelpath="${bindir}/@grub_mkrelpath@" + fi +@@ -127,10 +130,16 @@ EOF + + prepare_grub_to_access_device () + { ++ local device=$1 && shift ++ if [ "$#" -gt 0 ]; then ++ local variable=$1 && shift ++ else ++ local variable=root ++ fi + old_ifs="$IFS" + IFS=' + ' +- partmap="`"${grub_probe}" --device $@ --target=partmap`" ++ partmap="`"${grub_probe}" --device ${device} --target=partmap`" + for module in ${partmap} ; do + case "${module}" in + netbsd | openbsd) +@@ -141,34 +150,34 @@ prepare_grub_to_access_device () + done + + # Abstraction modules aren't auto-loaded. +- abstraction="`"${grub_probe}" --device $@ --target=abstraction`" ++ abstraction="`"${grub_probe}" --device ${device} --target=abstraction`" + for module in ${abstraction} ; do + echo "insmod ${module}" + done + +- fs="`"${grub_probe}" --device $@ --target=fs`" ++ fs="`"${grub_probe}" --device ${device} --target=fs`" + for module in ${fs} ; do + echo "insmod ${module}" + done + + if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then +- for uuid in `"${grub_probe}" --device $@ --target=cryptodisk_uuid`; do ++ for uuid in `"${grub_probe}" --device ${device} --target=cryptodisk_uuid`; do + echo "cryptomount -u $uuid" + done + fi + + # If there's a filesystem UUID that GRUB is capable of identifying, use it; + # otherwise set root as per value in device.map. +- fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`" ++ fs_hint="`"${grub_probe}" --device ${device} --target=compatibility_hint`" + if [ "x$fs_hint" != x ]; then +- echo "set root='$fs_hint'" ++ echo "set ${variable}='$fs_hint'" + fi +- if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then +- hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= ++ if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then ++ hints="`"${grub_probe}" --device ${device} --target=hints_string 2> /dev/null`" || hints= + echo "if [ x\$feature_platform_search_hint = xy ]; then" +- echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" ++ echo " search --no-floppy --fs-uuid --set=${variable} ${hints} ${fs_uuid}" + echo "else" +- echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}" ++ echo " search --no-floppy --fs-uuid --set=${variable} ${fs_uuid}" + echo "fi" + fi + IFS="$old_ifs" +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 7e78ad33636..68f631772c3 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -126,6 +126,33 @@ linux_entry () + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi ++ ++ if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then ++ if [ x$dirname = x/ ]; then ++ if [ -z "${prepare_root_cache}" ]; then ++ prepare_grub_to_access_device ${GRUB_DEVICE} ++ fi ++ else ++ if [ -z "${prepare_boot_cache}" ]; then ++ prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} ++ fi ++ fi ++ ++ bootefi_device="`${grub_probe} --target=device /boot/efi/`" ++ prepare_grub_to_access_device ${bootefi_device} boot ++ ++ cat << EOF ++blscfg ++if [ -s \$prefix/grubenv ]; then ++ load_env ++fi ++EOF ++ ++ ${grub_editenv} - set kernelopts="root=${linux_root_device_thisversion} ro ${args}" ++ ++ exit 0 ++ fi ++ + if [ x$type != xsimple ] ; then + title=$(mktitle "$type" "$version") + if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then +@@ -236,7 +263,10 @@ submenu_indentation="" + is_top_level=true + while [ "x$list" != "x" ] ; do + linux=`version_find_latest $list` +- gettext_printf "Found linux image: %s\n" "$linux" >&2 ++ if [ "x${GRUB_ENABLE_BLSCFG}" != "xtrue" ]; then ++ gettext_printf "Found linux image: %s\n" "$linux" >&2 ++ fi ++ + basename=`basename $linux` + dirname=`dirname $linux` + rel_dirname=`make_system_path_relative_to_its_root $dirname` +@@ -281,7 +311,9 @@ while [ "x$list" != "x" ] ; do + fi + + if test -n "${initrd}" ; then +- gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 ++ if [ "x${GRUB_ENABLE_BLSCFG}" != "xtrue" ]; then ++ gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 ++ fi + elif test -z "${initramfs}" ; then + # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's + # no initrd or builtin initramfs, it can't work here. +-- +2.15.0 + diff --git a/0203-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch b/0203-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch new file mode 100644 index 0000000..c3a7b74 --- /dev/null +++ b/0203-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch @@ -0,0 +1,36 @@ +From 1706e90ed0c2634b6f06e97fa1c7057278a7096b Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 6 Feb 2018 11:02:09 +0100 +Subject: [PATCH 203/206] Remove duplicated grub_exit() definition for grub-emu + platform + +The grub_exit() function signature was changed on all platforms to take a +return code, but latter on a following commit the grub_exit() for the emu +platform was duplicated. It causes a build error so remove the duplicated +function definition. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/kern/emu/main.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c +index 7e47ec81263..55ea5a11ccd 100644 +--- a/grub-core/kern/emu/main.c ++++ b/grub-core/kern/emu/main.c +@@ -72,12 +72,6 @@ grub_exit (int retval __attribute__((unused))) + grub_reboot (); + } + +-void +-grub_exit (int retval __attribute__((unused))) +-{ +- grub_reboot (); +-} +- + void + grub_machine_init (void) + { +-- +2.15.0 + diff --git a/0204-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch b/0204-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch new file mode 100644 index 0000000..30d3f4b --- /dev/null +++ b/0204-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch @@ -0,0 +1,30 @@ +From 6bebad4c7172ba23d3994828945b21ed74bcc6c2 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 6 Feb 2018 11:16:28 +0100 +Subject: [PATCH 204/206] Don't attempt to backtrace on grub_abort() for + grub-emu + +The emu platform doesn't have a grub_backtrace() implementation, so this +causes a build error. Don't attempt to call this when building grub-emu. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/kern/misc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 04371ac49f2..636f97e1ba1 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -1103,7 +1103,7 @@ static void __attribute__ ((noreturn)) + grub_abort (void) + { + #ifndef GRUB_UTIL +-#if defined(__i386__) || defined(__x86_64__) ++#if (defined(__i386__) || defined(__x86_64__)) && !defined(GRUB_MACHINE_EMU) + grub_backtrace(); + #endif + #endif +-- +2.15.0 + diff --git a/0205-Enable-blscfg-command-for-the-emu-platform.patch b/0205-Enable-blscfg-command-for-the-emu-platform.patch new file mode 100644 index 0000000..bcb2b93 --- /dev/null +++ b/0205-Enable-blscfg-command-for-the-emu-platform.patch @@ -0,0 +1,167 @@ +From 32679a10c1297104cf89ba53f238b4233ba922ce Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 2 Feb 2018 11:36:29 +0100 +Subject: [PATCH 205/206] Enable blscfg command for the emu platform + +Allow grub-emu to call a blscfg command. This may be useful for platforms +that don't support GRUB, so grub-emu can be used to parse the BLS configs +and kexec a new kernel using that information. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/Makefile.core.def | 1 + + grub-core/commands/blscfg.c | 46 +++++++++++++++++++++++++++++++++++---------- + 2 files changed, 37 insertions(+), 10 deletions(-) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 0ca0bdad412..420cbf0a024 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -778,6 +778,7 @@ module = { + common = commands/blscfg.c; + enable = efi; + enable = i386_pc; ++ enable = emu; + }; + + module = { +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index 87e7d9a4c64..12104d490ec 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -37,7 +37,12 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #include "loadenv.h" + + #define GRUB_BLS_CONFIG_PATH "/loader/entries/" ++#ifdef GRUB_MACHINE_EMU ++#define GRUB_BOOT_DEVICE "/boot" ++#else + #define GRUB_BOOT_DEVICE "($root)" ++#endif ++ + #ifdef GRUB_MACHINE_EFI + #define GRUB_LINUX_CMD "linuxefi" + #define GRUB_INITRD_CMD "initrdefi" +@@ -46,6 +51,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #define GRUB_INITRD_CMD "initrd" + #endif + ++enum ++ { ++ PLATFORM_EFI, ++ PLATFORM_EMU, ++ PLATFORM_BIOS, ++ }; ++ + #define grub_free(x) ({grub_dprintf("blscfg", "%s freeing %p\n", __func__, x); grub_free(x); }) + + struct keyval +@@ -641,7 +653,7 @@ finish: + struct find_entry_info { + grub_device_t dev; + grub_fs_t fs; +- int efi; ++ int platform; + }; + + /* +@@ -668,13 +680,16 @@ static int find_entry (const char *filename, + !grub_strcmp (filename, "..")) + return 0; + +- if (info->efi && !grub_strcasecmp (filename, "boot")) ++ if (info->platform == PLATFORM_EFI && !grub_strcasecmp (filename, "boot")) + return 0; + + saved_env_buf = grub_malloc (512); + + // set a default blsdir +- if (info->efi) ++ if (info->platform == PLATFORM_EMU) ++ default_blsdir = grub_xasprintf ("%s%s", GRUB_BOOT_DEVICE, ++ GRUB_BLS_CONFIG_PATH); ++ else if (info->platform == PLATFORM_EFI) + default_blsdir = grub_xasprintf ("/EFI/%s%s", filename, + GRUB_BLS_CONFIG_PATH); + else +@@ -686,7 +701,7 @@ static int find_entry (const char *filename, + /* + * try to load a grubenv from /EFI/wherever/grubenv + */ +- if (info->efi) ++ if (info->platform == PLATFORM_EFI) + grubenv_path = grub_xasprintf ("(%s)/EFI/%s/grubenv", devid, filename); + else + grubenv_path = grub_xasprintf ("(%s)/grub2/grubenv", devid); +@@ -740,7 +755,7 @@ static int find_entry (const char *filename, + goto finish; + + grub_dprintf ("blscfg", "blsdir: \"%s\"\n", blsdir); +- if (blsdir[0] != '/' && info->efi) ++ if (blsdir[0] != '/' && info->platform == PLATFORM_EFI) + blsdir = grub_xasprintf ("/EFI/%s/%s/", filename, blsdir); + else + blsdir = grub_strdup (blsdir); +@@ -816,15 +831,21 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED, + { + .dev = NULL, + .fs = NULL, +- .efi = 0, ++ .platform = PLATFORM_BIOS, + }; + + + grub_dprintf ("blscfg", "finding boot\n"); ++ ++#ifdef GRUB_MACHINE_EMU ++ devid = "host"; ++ grub_env_set ("boot", devid); ++#else + devid = grub_env_get ("boot"); + if (!devid) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, + N_("variable `%s' isn't set"), "boot"); ++#endif + + grub_dprintf ("blscfg", "opening %s\n", devid); + dev = grub_device_open (devid); +@@ -842,11 +863,16 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED, + info.dev = dev; + info.fs = fs; + #ifdef GRUB_MACHINE_EFI +- info.efi = 1; ++ info.platform = PLATFORM_EFI; + grub_dprintf ("blscfg", "scanning /EFI/\n"); + r = fs->dir (dev, "/EFI/", find_entry, &info); ++#elif GRUB_MACHINE_EMU ++ info.platform = PLATFORM_EMU; ++ grub_dprintf ("blscfg", "scanning %s%s\n", GRUB_BOOT_DEVICE, ++ GRUB_BLS_CONFIG_PATH); ++ r = fs->dir (dev, "/boot/loader/", ++ find_entry, &info); + #else +- info.efi = 0; + grub_dprintf ("blscfg", "scanning %s\n", GRUB_BLS_CONFIG_PATH); + r = fs->dir (dev, "/", find_entry, &info); + #endif +@@ -860,7 +886,7 @@ finish: + + static grub_extcmd_t cmd; + +-GRUB_MOD_INIT(bls) ++GRUB_MOD_INIT(blscfg) + { + grub_dprintf("blscfg", "%s got here\n", __func__); + cmd = grub_register_extcmd ("blscfg", +@@ -871,7 +897,7 @@ GRUB_MOD_INIT(bls) + NULL); + } + +-GRUB_MOD_FINI(bls) ++GRUB_MOD_FINI(blscfg) + { + grub_unregister_extcmd (cmd); + } +-- +2.15.0 + diff --git a/0206-Add-linux-and-initrd-commands-for-grub-emu.patch b/0206-Add-linux-and-initrd-commands-for-grub-emu.patch new file mode 100644 index 0000000..3239550 --- /dev/null +++ b/0206-Add-linux-and-initrd-commands-for-grub-emu.patch @@ -0,0 +1,354 @@ +From b22a512b55d4234c7ae2610fe78a70e97ad66918 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 6 Feb 2018 09:09:00 +0100 +Subject: [PATCH 206/206] Add linux and initrd commands for grub-emu + +When using grub-emu, the linux and initrd commands are used as arguments +to the kexec command line tool, to allow booting the selected menu entry. +--- + grub-core/Makefile.core.def | 2 +- + grub-core/kern/emu/main.c | 4 + + grub-core/kern/emu/misc.c | 18 ++++- + grub-core/loader/emu/linux.c | 172 +++++++++++++++++++++++++++++++++++++++++++ + include/grub/emu/exec.h | 4 +- + include/grub/emu/hostfile.h | 3 +- + include/grub/emu/misc.h | 3 + + grub-core/Makefile.am | 1 + + 8 files changed, 203 insertions(+), 4 deletions(-) + create mode 100644 grub-core/loader/emu/linux.c + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 420cbf0a024..533e1408f74 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1715,10 +1715,10 @@ module = { + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; + arm64 = loader/efi/linux.c; ++ emu = loader/emu/linux.c; + fdt = lib/fdt.c; + common = loader/linux.c; + common = lib/cmdline.c; +- enable = noemu; + }; + + module = { +diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c +index 55ea5a11ccd..846fe9715ec 100644 +--- a/grub-core/kern/emu/main.c ++++ b/grub-core/kern/emu/main.c +@@ -107,6 +107,7 @@ static struct argp_option options[] = { + N_("use GRUB files in the directory DIR [default=%s]"), 0}, + {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, + {"hold", 'H', N_("SECS"), OPTION_ARG_OPTIONAL, N_("wait until a debugger will attach"), 0}, ++ {"kexec", 'X', 0, 0, N_("try the untryable."), 0}, + { 0, 0, 0, 0, 0, 0 } + }; + +@@ -164,6 +165,9 @@ argp_parser (int key, char *arg, struct argp_state *state) + case 'v': + verbosity++; + break; ++ case 'X': ++ grub_util_set_kexecute(); ++ break; + + case ARGP_KEY_ARG: + { +diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c +index 82012a72fcb..3d3a4a4a975 100644 +--- a/grub-core/kern/emu/misc.c ++++ b/grub-core/kern/emu/misc.c +@@ -37,6 +37,7 @@ + #include + + int verbosity; ++int kexecute; + + void + grub_util_warn (const char *fmt, ...) +@@ -80,7 +81,7 @@ grub_util_error (const char *fmt, ...) + vfprintf (stderr, fmt, ap); + va_end (ap); + fprintf (stderr, ".\n"); +- exit (1); ++ grub_exit (1); + } + + void * +@@ -140,6 +141,9 @@ void + __attribute__ ((noreturn)) + grub_exit (int rc) + { ++#if defined (GRUB_KERNEL) ++ grub_reboot(); ++#endif + exit (rc < 0 ? 1 : rc); + } + #endif +@@ -201,3 +205,15 @@ grub_util_load_image (const char *path, char *buf) + + fclose (fp); + } ++ ++void ++grub_util_set_kexecute(void) ++{ ++ kexecute++; ++} ++ ++int ++grub_util_get_kexecute(void) ++{ ++ return kexecute; ++} +diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c +new file mode 100644 +index 00000000000..fda9e00d24c +--- /dev/null ++++ b/grub-core/loader/emu/linux.c +@@ -0,0 +1,172 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_dl_t my_mod; ++ ++static char *kernel_path; ++static char *initrd_path; ++static char *boot_cmdline; ++ ++static grub_err_t ++grub_linux_boot (void) ++{ ++ grub_err_t rc = GRUB_ERR_NONE; ++ char *initrd_param; ++ const char *kexec[] = { "kexec", "-l", kernel_path, boot_cmdline, NULL, NULL }; ++ const char *systemctl[] = { "systemctl", "kexec", NULL }; ++ int kexecute = grub_util_get_kexecute(); ++ ++ if (initrd_path) { ++ initrd_param = grub_xasprintf("--initrd=%s", initrd_path); ++ kexec[3] = initrd_param; ++ kexec[4] = boot_cmdline; ++ } else { ++ initrd_param = grub_xasprintf("%s", ""); ++ } ++ ++ grub_printf("%serforming 'kexec -l %s %s %s'\n", ++ (kexecute) ? "P" : "Not p", ++ kernel_path, initrd_param, boot_cmdline); ++ ++ if (kexecute) ++ rc = grub_util_exec(kexec); ++ ++ grub_free(initrd_param); ++ ++ if (rc != GRUB_ERR_NONE) { ++ grub_error (rc, N_("Error trying to perform kexec load operation.")); ++ grub_sleep (3); ++ return rc; ++ } ++ if (kexecute < 1) ++ grub_fatal (N_("Use '"PACKAGE"-emu --kexec' to force a system restart.")); ++ ++ grub_printf("Performing 'systemctl kexec' (%s) ", ++ (kexecute==1) ? "do-or-die" : "just-in-case"); ++ rc = grub_util_exec (systemctl); ++ ++ if (kexecute == 1) ++ grub_fatal (N_("Error trying to perform 'systemctl kexec'")); ++ ++ /* need to check read-only root before resetting hard!? */ ++ grub_printf("Performing 'kexec -e'"); ++ kexec[1] = "-e"; ++ kexec[2] = NULL; ++ rc = grub_util_exec(kexec); ++ if ( rc != GRUB_ERR_NONE ) ++ grub_fatal (N_("Error trying to directly perform 'kexec -e'.")); ++ ++ return rc; ++} ++ ++static grub_err_t ++grub_linux_unload (void) ++{ ++ grub_dl_unref (my_mod); ++ if ( boot_cmdline != NULL ) ++ grub_free (boot_cmdline); ++ boot_cmdline = NULL; ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) ++{ ++ int i; ++ char *tempstr; ++ ++ grub_dl_ref (my_mod); ++ ++ if (argc == 0) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ ++ if ( !grub_util_is_regular(argv[0]) ) ++ return grub_error(GRUB_ERR_FILE_NOT_FOUND, N_("Cannot find kernel file %s"), argv[0]); ++ ++ if ( kernel_path != NULL ) ++ grub_free(kernel_path); ++ ++ kernel_path = grub_xasprintf("%s", argv[0]); ++ ++ if ( boot_cmdline != NULL ) { ++ grub_free(boot_cmdline); ++ boot_cmdline = NULL; ++ } ++ ++ if ( argc > 1 ) ++ { ++ boot_cmdline = grub_xasprintf("--command-line=%s", argv[1]); ++ for ( i = 2; i < argc; i++ ) { ++ tempstr = grub_xasprintf("%s %s", boot_cmdline, argv[i]); ++ grub_free(boot_cmdline); ++ boot_cmdline = tempstr; ++ } ++ } ++ ++ grub_loader_set (grub_linux_boot, grub_linux_unload, 0); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) ++{ ++ if (argc == 0) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ ++ if ( !grub_util_is_regular(argv[0]) ) ++ return grub_error(GRUB_ERR_FILE_NOT_FOUND, N_("Cannot find initrd file %s"), argv[0]); ++ ++ if ( initrd_path != NULL ) ++ grub_free(initrd_path); ++ ++ initrd_path = grub_xasprintf("%s", argv[0]); ++ ++ grub_dl_unref (my_mod); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_command_t cmd_linux, cmd_initrd; ++ ++GRUB_MOD_INIT(linux) ++{ ++ cmd_linux = grub_register_command ("linux", grub_cmd_linux, 0, N_("Load Linux.")); ++ cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, 0, N_("Load initrd.")); ++ my_mod = mod; ++ kernel_path = NULL; ++ initrd_path = NULL; ++ boot_cmdline = NULL; ++} ++ ++GRUB_MOD_FINI(linux) ++{ ++ grub_unregister_command (cmd_linux); ++ grub_unregister_command (cmd_initrd); ++} +diff --git a/include/grub/emu/exec.h b/include/grub/emu/exec.h +index d1073ef86af..1b61b4a2e5d 100644 +--- a/include/grub/emu/exec.h ++++ b/include/grub/emu/exec.h +@@ -23,6 +23,8 @@ + #include + + #include ++#include ++ + pid_t + grub_util_exec_pipe (const char *const *argv, int *fd); + pid_t +@@ -32,7 +34,7 @@ int + grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file, + const char *stdout_file, const char *stderr_file); + int +-grub_util_exec (const char *const *argv); ++EXPORT_FUNC(grub_util_exec) (const char *const *argv); + int + grub_util_exec_redirect (const char *const *argv, const char *stdin_file, + const char *stdout_file); +diff --git a/include/grub/emu/hostfile.h b/include/grub/emu/hostfile.h +index 8e37d5acb42..12c937a1af9 100644 +--- a/include/grub/emu/hostfile.h ++++ b/include/grub/emu/hostfile.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + int +@@ -29,7 +30,7 @@ grub_util_is_directory (const char *path); + int + grub_util_is_special_file (const char *path); + int +-grub_util_is_regular (const char *path); ++EXPORT_FUNC(grub_util_is_regular) (const char *path); + + char * + grub_util_path_concat (size_t n, ...); +diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h +index df6085bcb7c..a653132e36a 100644 +--- a/include/grub/emu/misc.h ++++ b/include/grub/emu/misc.h +@@ -60,6 +60,9 @@ void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format ( + void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); + void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn)); + ++void EXPORT_FUNC(grub_util_set_kexecute) (void); ++int EXPORT_FUNC(grub_util_get_kexecute) (void) WARN_UNUSED_RESULT; ++ + grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); + + #ifdef HAVE_DEVICE_MAPPER +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index f7b4d29b0b3..75e8715e631 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -275,6 +275,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/net.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostdisk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostfile.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/exec.h + if COND_GRUB_EMU_SDL + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h + endif +-- +2.15.0 + diff --git a/grub.patches b/grub.patches index cae311a..ff973fe 100644 --- a/grub.patches +++ b/grub.patches @@ -196,3 +196,11 @@ Patch0195: 0195-Use-grub-file-to-figure-out-whether-multiboot2-shoul.patch Patch0196: 0196-20_linux_xen-load-xen-or-multiboot-2-modules-as-need.patch Patch0197: 0197-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch Patch0198: 0198-Make-pmtimer-tsc-calibration-not-take-51-seconds-to-.patch +Patch0199: 0199-align-struct-efi_variable-better.patch +Patch0200: 0200-Add-quicksort-implementation.patch +Patch0201: 0201-Add-blscfg-command-support-to-parse-BootLoaderSpec-c.patch +Patch0202: 0202-Add-BLS-support-to-grub-mkconfig.patch +Patch0203: 0203-Remove-duplicated-grub_exit-definition-for-grub-emu-.patch +Patch0204: 0204-Don-t-attempt-to-backtrace-on-grub_abort-for-grub-em.patch +Patch0205: 0205-Enable-blscfg-command-for-the-emu-platform.patch +Patch0206: 0206-Add-linux-and-initrd-commands-for-grub-emu.patch diff --git a/grub2.spec b/grub2.spec index 3511bdd..7cc6f41 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 25%{?dist} +Release: 26%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -451,6 +451,17 @@ fi %endif %changelog +* Wed Feb 28 2018 Peter Jones - 2.02-26 +- Try to fix things for new compiler madness. + I really don't know why gcc decided __attribute__((packed)) on a "typedef + struct" should imply __attribute__((align (1))) and that it should have a + warning that it does so. The obvious behavior would be to keep the alignment + of the first element unless it's used in another object or type that /also/ + hask the packed attribute. Why should it change the default alignment at + all? +- Merge in the BLS patches Javier and I wrote. +- Attempt to fix pmtimer initialization failures to not be super duper slow. + * Fri Feb 09 2018 Igor Gnatenko - Escape macros in %%changelog